Question

The apache children on my server (ubuntu 12.04 upgraded from 11.10, apache 2.2.22, perl 5.14.2, mod_perl 2.0.5) are hanging.

I tried to catch signals usr2, and alarm but without success (when using sleep for testing, it works like excpected but when the programm hangs by itself no output is given)

sub handler : method{
my $mask      = POSIX::SigSet->new(&POSIX::SIGUSR2, &POSIX::SIGALRM);
my $oldaction_usr2 = POSIX::SigAction->new();
my $oldaction_alarm = POSIX::SigAction->new();
my $action = POSIX::SigAction->new(sub {
    Carp::confess("hm caught SIGUSR2 or ALARM DEAD LOCK YOU can run but not hide!");
},$mask,&POSIX::SA_NODEFER);
POSIX::sigaction(&POSIX::SIGUSR2,$action, $oldaction_usr2);
POSIX::sigaction(&POSIX::SIGALRM,$action, $oldaction_alarm);
alarm(30); #max 30 seconds per request

So I used Apache status to get the pid of the child which is hanging (cpu time is not increasing but only SS (Seconds since beginning of most recent request).

Then I attach gdb with the pid to get an backtrace:

(gdb) bt
#0  0x00007fc4610fb606 in myck_entersub (my_perl=0x7fc47f7f63e0, op=0x7fc484b40910) at lib/Params/Classify.xs:682
#1  0x00007fc477a67abd in Perl_convert () from /usr/lib/libperl.so.5.14
#2  0x00007fc477a6f769 in Perl_utilize () from /usr/lib/libperl.so.5.14
#3  0x00007fc477a9daef in Perl_yyparse () from /usr/lib/libperl.so.5.14
#4  0x00007fc477b1635d in ?? () from /usr/lib/libperl.so.5.14

the problem is I have no idea how to fix this or what this means. On modper 1 gude I found:

% gdb httpd <pid of spinning process>
(gdb) where
(gdb) source mod_perl-x.xx/.gdbinit
(gdb) curinfo

but I don't know where .gdbinit is located or which package I need to install or do I need to make this file by my self from source (maybe with Devel::DebugInit::GDB) ?

Was it helpful?

Solution

The problem may be "Params::Classify," which is not thread-safe. See:

https://bugs.launchpad.net/ubuntu/+source/libmodule-runtime-perl/+bug/991650

mod_perl script going in to a tight loop during 'use' processing

http://www.perlmonks.org/?node_id=886909

The author of Params::Classify acknowledged the problem in November 2011 but has not released a fix.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top