You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2002/01/17 18:41:24 UTC

modperl fails to load non-default handlers at run time with worker mpm/bleadperl

I'm trying the test suite with worker mpm, it works perfectly with 
5.6.1, but with bleadperl it doesn't work. This and the another 
following email supply the details of the debug I've done so far.

So the first problem is this:

The modperl_mgv_resolve doesn't resolve the handlers from the httpd.conf 
at the startup stage, but postpones this till the first request (because 
AUTOLOAD flag is not in set), so we see a trace like this:

...
modperl_mgv_resolve: `handler' not found in class 
`TestHooks::fixup::response'
modperl_mgv_resolve: `handler' not found in class `TestHooks::headerparser'
modperl_mgv_resolve: `handler' not found in class 
`TestHooks::headerparser::response'
...

When modperl_mgv_resolve tries to resolve the handler at run time, it 
works for all handlers whose sub name is 'handler', if the used sub name 
is a non-default, tries to load the package by the handler's name and 
fails which is OK, but under bleadperl/worker this failure is fatal.

So for example the server won't start because it tries to load:
TestHooks::init::first as TestHooks/init/first.pm and gets a fatal error:

[Fri Jan 18 01:36:19 2002] [error] [client 127.0.0.1] Can't locate 
TestHooks/init/first.pm in @INC (@INC contains: /home/stas......

Now I've tried to debug this problem, but I cannot figure out how to 
attach to the thread :( Any hints how to work with gdb and the worker 
mpm? The moment the threads are started the main thread gets:

Program received signal SIG32, Real-time event 32.
0x402b0bb2 in ?? () from /lib/libc.so.6

and then if I try to attach to the thread the whole server goes down, 
without any traces. I start the server from gdb as:

run -DONE_PROCESS -d /home/stas/apache.org/modperl-2.0/t -f 
/home/stas/apache.org/modperl-2.0/t/conf/httpd.conf -DAPACHE2 
-DPERL_USEITHREADS

so of course I'd love to finish debugging this problem by myself, but I 
need help to get to the thread at the very beginning of it so I can step 
through it.

Thanks!

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


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


Re: modperl fails to load non-default handlers at run time with worker mpm/bleadperl

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> 
>> Now I've tried to debug this problem, but I cannot figure out how to 
>> attach to the thread :( Any hints how to work with gdb and the worker 
>> mpm? The moment the threads are started the main thread gets:
>>
>> Program received signal SIG32, Real-time event 32.
>> 0x402b0bb2 in ?? () from /lib/libc.so.6
>>
>> and then if I try to attach to the thread the whole server goes down, 
>> without any traces. 

replying to my own 1 year old question. When debugging the worker mpm with gdb 
and using:

   set auto-solib-add 0

one absolutely must have:

   sharedlibrary libpthread

only then it's possible to debug it. I'll update the online docs.

This was a strange week, suddenly things start to work...

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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


Re: modperl fails to load non-default handlers at run time with worker mpm/bleadperl

Posted by Stas Bekman <st...@stason.org>.
> Now I've tried to debug this problem, but I cannot figure out how to 
> attach to the thread :( Any hints how to work with gdb and the worker 
> mpm? The moment the threads are started the main thread gets:
> 
> Program received signal SIG32, Real-time event 32.
> 0x402b0bb2 in ?? () from /lib/libc.so.6
> 
> and then if I try to attach to the thread the whole server goes down, 
> without any traces. 


To give some more details. After getting SIG32:

gdb) info threads

shows nothing, so I couldn't say:

gdb) thread 1

or similar. I could attach to the cgid thread as a process

gdb) attach PID

and then 'info threads' was showing the cgid thread. So it's not a gdb 
problem.

ps(1) shows 5 httpd procs (on linux threads are shown as processes)

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
stas     19567  0.5  1.7 18436 9168 pts/24   T    11:29   0:01 httpd
stas     19604  0.0  1.6 11768 8580 pts/24   S    11:29   0:00 httpd
stas     19605  0.0  1.7 18436 9168 pts/24   S    11:29   0:00 httpd
stas     19607  0.0  1.7 18436 9168 pts/24   S    11:29   0:00 httpd
stas     19608  0.0  1.7 18436 9168 pts/24   S    11:29   0:00 httpd

the first one appears to be the main thread, the second cgid and the 
other three must be listener and worker threads, but without being able 
to attach to any of these I don't know what are they.

pstree(1) makes it easy to understand who created whom:

pstree -p | grep httpd
         | 
`-tcsh(3913)-+-ddd(19563)---gdb(19566)---httpd(19567)-+-httpd(19604)
         |                                   | 
               `-httpd(19605)-+-httpd(19607)
         |                                   | 
                              `-httpd(19608)


_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


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