You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Dave Rolsky <au...@urth.org> on 2002/05/17 22:57:18 UTC

method handlers broken in latest CVS?

I'm playing with the latest CVS version in order to make sure that Mason
will work with the backwards compatibility layer.

Defining a "sub handler : method" does not seem to be working.

If I do this:

sub handler : method
{
    my ($package, $r) = @_;

    my $ah = $AH || $package->make_ah();

    return $ah->handle_request($r);
}

and then in my config file I have:

PerlResponseHandler HTML::Mason::ApacheHandler

I get this error message:

     Error message:
Can't locate object method "" via package "HTML::Mason::ApacheHandler"
(perhaps you forgot to load "HTML::Mason::ApacheHandler"?).

Which is a bit bizarre.  If I get rid of the method attribute it seems to
work properly, but I need this to be a method handler.

Just for yucks I added this to the ApacheHandler module:

sub AUTOLOAD { warn Devel::StackTrace->new }

which got me this:

HTML::Mason::ApacheHandler::AUTOLOAD('HTML::Mason::ApacheHandler', 'Apache::RequestRec=SCALAR(0x83f8104)') called at -e line 0
eval {...}('HTML::Mason::ApacheHandler', 'Apache::RequestRec=SCALAR(0x83f8104)') called at -e line 0


I know that there's no guarantee that CVS will ever work, but I figured
I'd report it just in case anyone is interested.

FWIW, a non-method handler seems to work fine but then I get segfaults
later in the code when I call "$r->filename".

Also, it seems that Apache::compat needs to 'use Apache::ServerUtil' so
that the Apache->server method works.


-dave

/*==================
www.urth.org
we await the New Sun
==================*/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Doug MacEachern <do...@covalent.net>.
On Sat, 18 May 2002, Dave Rolsky wrote:
 
> CCFLAGS = ... -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

that's the problem.  these are supposed to be ripped out.
can you mail me (off the list), that Makefile and your Config.pm?



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Dave Rolsky <au...@urth.org>.
On Sat, 18 May 2002, Doug MacEachern wrote:

> what about 'make test' ?

I actually hadn't run that yet, in my zeal to play with Mason & mod_perl 2
;)

But they pretty much all fail.

waiting for server to start: ok (waited 2 secs)
server localhost:8529 started
server localhost:8530 listening (TestDirective::perlmodule)
server localhost:8531 listening (TestDirective::perlrequire)
server localhost:8532 listening (TestProtocol::eliza)
server localhost:8533 listening (TestProtocol::echo)
server localhost:8534 listening (TestProtocol::echo_filter)
server localhost:8535 listening (TestFilter::input_msg)
apache/cgihandler........FAILED tests 1-2
	Failed 2/2 tests, 0.00% okay
apache/compat............FAILED tests 1-3
	Failed 3/3 tests, 0.00% okay
apache/compat2...........FAILED before any test output arrived
apache/conftree..........FAILED before any test output arrived
apache/constants.........ok
apache/post..............FAILED tests 1-2
	Failed 2/2 tests, 0.00% okay
apache/read..............dubious
	Test returned status 0 (wstat 13, 0xd)
DIED. FAILED test 1
	Failed 1/1 tests, 0.00% okay
apache/scanhdrs..........NOK 1Use of uninitialized value in string eq at
apache/scanhdrs.t line 16.
apache/scanhdrs..........dubious
	Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED tests 1-4
	Failed 4/4 tests, 0.00% okay
apache/subprocess........FAILED before any test output arrived
apache/write.............FAILED before any test output arrived
api/access...............FAILED before any test output arrived
api/aplog................FAILED before any test output arrived
api/conn_rec.............FAILED before any test output arrived
api/lookup_uri...........FAILED before any test output arrived
api/lookup_uri2..........FAILED before any test output arrived
api/module...............FAILED before any test output arrived
api/r_subclass...........FAILED before any test output arrived
api/request_rec..........FAILED before any test output arrived
api/response.............FAILED before any test output arrived
api/rutil................FAILED before any test output arrived
api/send_fd..............FAILED tests 1-3
	Failed 3/3 tests, 0.00% okay
api/sendfile.............FAILED tests 1-3
	Failed 3/3 tests, 0.00% okay
api/server_rec...........FAILED before any test output arrived
api/server_util..........FAILED before any test output arrived
api/uri..................FAILED before any test output arrived
apr/base64...............FAILED before any test output arrived
apr/constants............ok
apr/date.................FAILED before any test output arrived
apr/netlib...............FAILED before any test output arrived
apr/perlio...............FAILED before any test output arrived
apr/pool.................FAILED before any test output arrived
apr/string...............FAILED before any test output arrived
apr/table................FAILED before any test output arrived
apr/util.................FAILED before any test output arrived
apr/uuid.................FAILED before any test output arrived
directive/env............FAILED before any test output arrived
directive/perlmodule.....FAILED test 1
	Failed 1/1 tests, 0.00% okay
directive/perlrequire....FAILED test 1
	Failed 1/1 tests, 0.00% okay
directive/setupenv.......FAILED tests 1-2
	Failed 2/3 tests, 33.33% okay
filter/api...............FAILED before any test output arrived
filter/buckets...........FAILED before any test output arrived
filter/input_body........FAILED tests 1-2
	Failed 2/2 tests, 0.00% okay
filter/input_msg.........FAILED before any test output arrived
filter/lc................ok
filter/reverse...........FAILED before any test output arrived
hooks/access.............FAILED tests 2-3
	Failed 2/4 tests, 50.00% okay
hooks/authen.............FAILED tests 2-3
	Failed 2/4 tests, 50.00% okay
hooks/authz..............FAILED tests 2-3
	Failed 2/4 tests, 50.00% okay
hooks/fixup..............FAILED before any test output arrived
hooks/headerparser.......FAILED before any test output arrived
hooks/init...............FAILED before any test output arrived
hooks/trans..............FAILED tests 1-3
	Failed 3/3 tests, 0.00% okay
modperl/dir_config.......FAILED before any test output arrived
modperl/endav............FAILED before any test output arrived
modperl/env..............FAILED before any test output arrived
modperl/exit.............FAILED before any test output arrived
modperl/getc.............FAILED tests 1-2
	Failed 2/2 tests, 0.00% okay
modperl/method...........FAILED before any test output arrived
modperl/methodname.......FAILED before any test output arrived
modperl/methodobj........FAILED before any test output arrived
modperl/pnotes...........FAILED before any test output arrived
modperl/print............FAILED before any test output arrived
modperl/printf...........FAILED before any test output arrived
modperl/readline.........FAILED tests 1-2
	Failed 2/2 tests, 0.00% okay
modperl/sameinterp.......NOK 1must pass an interpreter id to work with at
/home/autarch/modperl-2.0/Apache-Test/lib/Apache/TestRequest.pm line 466.
modperl/sameinterp.......dubious
	Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED tests 1-12
	Failed 12/12 tests, 0.00% okay
modules/cgi..............FAILED tests 1-4
	Failed 4/5 tests, 20.00% okay
modules/cgiupload........FAILED tests 1-2
	Failed 2/2 tests, 0.00% okay
modules/include..........FAILED tests 1-6
	Failed 6/6 tests, 0.00% okay
protocol/echo............ok
protocol/echo_filter.....ok
protocol/eliza...........skipped: cannot find module 'Chatbot::Eliza'
Failed Test             Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
apache/cgihandler.t                    2    2 100.00%  1-2
apache/compat.t                        3    3 100.00%  1-3
apache/compat2.t                      ??   ??       %  ??
apache/conftree.t                     ??   ??       %  ??
apache/post.t                          2    2 100.00%  1-2
apache/read.t              0    13     1    1 100.00%  1
apache/scanhdrs.t          9  2304     4    4 100.00%  1-4
apache/subprocess.t                   ??   ??       %  ??
apache/write.t                        ??   ??       %  ??
api/access.t                          ??   ??       %  ??
api/aplog.t                           ??   ??       %  ??
api/conn_rec.t                        ??   ??       %  ??
api/lookup_uri.t                      ??   ??       %  ??
api/lookup_uri2.t                     ??   ??       %  ??
api/module.t                          ??   ??       %  ??
api/r_subclass.t                      ??   ??       %  ??
api/request_rec.t                     ??   ??       %  ??
api/response.t                        ??   ??       %  ??
api/rutil.t                           ??   ??       %  ??
api/send_fd.t                          3    3 100.00%  1-3
api/sendfile.t                         3    3 100.00%  1-3
api/server_rec.t                      ??   ??       %  ??
api/server_util.t                     ??   ??       %  ??
api/uri.t                             ??   ??       %  ??
apr/base64.t                          ??   ??       %  ??
apr/date.t                            ??   ??       %  ??
apr/netlib.t                          ??   ??       %  ??
apr/perlio.t                          ??   ??       %  ??
apr/pool.t                            ??   ??       %  ??
apr/string.t                          ??   ??       %  ??
apr/table.t                           ??   ??       %  ??
apr/util.t                            ??   ??       %  ??
apr/uuid.t                            ??   ??       %  ??
directive/env.t                       ??   ??       %  ??
directive/perlmodule.t                 1    1 100.00%  1
directive/perlrequire.t                1    1 100.00%  1
directive/setupenv.t                   3    2  66.67%  1-2
filter/api.t                          ??   ??       %  ??
filter/buckets.t                      ??   ??       %  ??
filter/input_body.t                    2    2 100.00%  1-2
filter/input_msg.t                    ??   ??       %  ??
filter/reverse.t                      ??   ??       %  ??
hooks/access.t                         4    2  50.00%  2-3
hooks/authen.t                         4    2  50.00%  2-3
hooks/authz.t                          4    2  50.00%  2-3
hooks/fixup.t                         ??   ??       %  ??
hooks/headerparser.t                  ??   ??       %  ??
hooks/init.t                          ??   ??       %  ??
hooks/trans.t                          3    3 100.00%  1-3
modperl/dir_config.t                  ??   ??       %  ??
modperl/endav.t                       ??   ??       %  ??
modperl/env.t                         ??   ??       %  ??
modperl/exit.t                        ??   ??       %  ??
modperl/getc.t                         2    2 100.00%  1-2
modperl/method.t                      ??   ??       %  ??
modperl/methodname.t                  ??   ??       %  ??
modperl/methodobj.t                   ??   ??       %  ??
modperl/pnotes.t                      ??   ??       %  ??
Failed Test             Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
modperl/print.t                       ??   ??       %  ??
modperl/printf.t                      ??   ??       %  ??
modperl/readline.t                     2    2 100.00%  1-2
modperl/sameinterp.t       9  2304    12   12 100.00%  1-12
modules/cgi.t                          5    4  80.00%  1-4
modules/cgiupload.t                    2    2 100.00%  1-2
modules/include.t                      6    6 100.00%  1-6
1 test skipped.
*** : server localhost:8529 shutdown
!!! : error running tests (please examine t/logs/error_log)
!!! : oh darn, server dumped core
!!! : for stacktrace, run: gdb /usr/local/apache2/bin/httpd -core
/home/autarch/modperl-2.0/t/coremake: *** [run_tests] Error 1

The logs have a bunch of segfaults

> my first guess is that this is largefiles related.  but normally if lfs is
> the problem, modperl will blow up before it has a chance to call into perl.
> but it could be that lfs flags are not getting stripped (or added back in
> somehow) when building the extension .so's.  does this turn up anything?
> % grep LARGEFILE WrapXS/Apache/RequestRec/Makefile

CCFLAGS = -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64


-dave

/*==================
www.urth.org
we await the New Sun
==================*/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 17 May 2002, Dave Rolsky wrote:
 
> Nope, looks like any "$r" method blows chunks.  Even trying
> "$r->can('uri')" dies.

what about 'make test' ?

my first guess is that this is largefiles related.  but normally if lfs is 
the problem, modperl will blow up before it has a chance to call into perl.
but it could be that lfs flags are not getting stripped (or added back in 
somehow) when building the extension .so's.  does this turn up anything?
% grep LARGEFILE WrapXS/Apache/RequestRec/Makefile



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Dave Rolsky <au...@urth.org>.
On Fri, 17 May 2002, Doug MacEachern wrote:

> On Fri, 17 May 2002, Dave Rolsky wrote:
>
> > And code:
> >
> > package HTML::Mason::FileEcho;
>
> works fine here.  can you use $r->anything?  $r->uri, $r->hostname or
> $r->the_request for example?  perl -V might shed some light.

Nope, looks like any "$r" method blows chunks.  Even trying
"$r->can('uri')" dies.

perl -V:

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.4.13, archname=i386-linux
    uname='linux duende 2.4.13 #1 wed oct 31 19:18:07 est 2001 i686 unknown '
    config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1 -Darchlib=/usr/lib/perl/5.6.1 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1 -Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Duseshrplib -Dlibperl=libperl.so.5.6.1 -Dd_dosuid -des'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2',
    cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.4  (Debian prerelease)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldb -ldl -lm -lc -lcrypt
    perllibs=-ldl -lm -lc -lcrypt
    libc=/lib/libc-2.2.4.so, so=so, useshrplib=true, libperl=libperl.so.5.6.1
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Jun 22 2001 18:52:37
  @INC:
    /usr/local/lib/perl/5.6.1
    /usr/local/share/perl/5.6.1
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.6.1
    /usr/share/perl/5.6.1
    /usr/local/lib/site_perl
    /usr/lib/perl5/5.6
    /usr/lib/perl5/5.005
    .



/*==================
www.urth.org
we await the New Sun
==================*/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 17 May 2002, Dave Rolsky wrote:
 
> And code:
> 
> package HTML::Mason::FileEcho;

works fine here.  can you use $r->anything?  $r->uri, $r->hostname or 
$r->the_request for example?  perl -V might shed some light.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Dave Rolsky <au...@urth.org>.
On Fri, 17 May 2002, Doug MacEachern wrote:

> actually, 5.6.1 would have had the same issue.  its 5.6.0 where G_METHOD
> is not implemented.  if you give a whirl with cvs, it should be working
> now.

Yep, that part seems to work fine.

> ok, i'd need a test case to reproduce to figure out the problem.

But of course.

Apache config:


PerlModule Apache2

PerlModule Apache::compat

PerlSwitches -w -Mlib=/home/autarch/mason/dist/lib

<IfModule mod_perl.c>
  <Directory /var/www>
     SetHandler perl-script
     PerlResponseHandler HTML::Mason::FileEcho
  </Directory>
</IfModule>


And code:

package HTML::Mason::FileEcho;

sub handler
{
    my ($r) = @_;

    print "File is ", $r->filename, "\n";

    return 200;
}

1;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 17 May 2002, Dave Rolsky wrote:
 
> Nope, I'm using 5.6.1.  Perhaps that explains the problem?

actually, 5.6.1 would have had the same issue.  its 5.6.0 where G_METHOD 
is not implemented.  if you give a whirl with cvs, it should be working 
now.
 
> > > FWIW, a non-method handler seems to work fine but then I get segfaults
> > > later in the code when I call "$r->filename".
> >
> > is $r something other than an Apache::RequestRec?
> 
> Nope.

ok, i'd need a test case to reproduce to figure out the problem.
 
> Mason sometimes tries to get the dir_config info at server startup, so it
> uses Apache->server.  Other times it uses Apache->request.

Apache::ServerUtil has been added to Apache::compat in cvs.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Dave Rolsky <au...@urth.org>.
On Fri, 17 May 2002, Doug MacEachern wrote:

> On Fri, 17 May 2002, Dave Rolsky wrote:
>
> > Defining a "sub handler : method" does not seem to be working.
>
> you are using bleedperl, yes?  this should be fixed now.  we had been
> passing the G_METHOD flag to call_sv(), which does nothing with 5.6.1, but
> broke bleedperl.  there no need for us to use that flag.

Nope, I'm using 5.6.1.  Perhaps that explains the problem?

> > FWIW, a non-method handler seems to work fine but then I get segfaults
> > later in the code when I call "$r->filename".
>
> is $r something other than an Apache::RequestRec?

Nope.

> > Also, it seems that Apache::compat needs to 'use Apache::ServerUtil' so
> > that the Apache->server method works.
>
> where does mason use Apache->server?  it should use $r->server if $r is
> available.  but i'll add it to Apache::compat in case it needs this at
> startup.

Mason sometimes tries to get the dir_config info at server startup, so it
uses Apache->server.  Other times it uses Apache->request.


-dave

/*==================
www.urth.org
we await the New Sun
==================*/


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: method handlers broken in latest CVS?

Posted by Doug MacEachern <do...@covalent.net>.
On Fri, 17 May 2002, Dave Rolsky wrote:

> Defining a "sub handler : method" does not seem to be working.

you are using bleedperl, yes?  this should be fixed now.  we had been 
passing the G_METHOD flag to call_sv(), which does nothing with 5.6.1, but 
broke bleedperl.  there no need for us to use that flag.
 
> FWIW, a non-method handler seems to work fine but then I get segfaults
> later in the code when I call "$r->filename".

is $r something other than an Apache::RequestRec?
 
> Also, it seems that Apache::compat needs to 'use Apache::ServerUtil' so
> that the Apache->server method works.

where does mason use Apache->server?  it should use $r->server if $r is 
available.  but i'll add it to Apache::compat in case it needs this at 
startup.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org