Bug#708180: applications die() because of SIGCHLD vs. SIGCLD confusion
Steinar H. Gunderson
sgunderson at bigfoot.com
Mon May 13 19:28:14 UTC 2013
Package: libnet-server-perl
Version: 2.006-1
Severity: grave
Hi,
I have a starman application that regularly dies under load with a backtrace like:
Message: Can't use string ("") as a subroutine ref while "strict refs" in use at /usr/share/perl5/Net/Server/SIG.pm line 72, <$read> line 2002.
at /usr/share/perl5/Net/Server/SIG.pm line 72
Net::Server::SIG::check_sigs() called at /usr/share/perl5/Net/Server/PreForkSimple.pm line 337
Net::Server::PreForkSimple::close_children('Starman::Server=HASH(0x84e7a8)') called at /usr/share/perl5/Net/Server.pm line 735
Net::Server::server_close('Starman::Server=HASH(0x84e7a8)') called at /usr/share/perl5/Starman/Server.pm line 124
(...)
Some debugging shows that the problem is that several Net::Server modules
(e.g. Net::Server::PreforkSimple) tries to trap signals with Net::Server::SIG
using “CHLD” as the signal name. Net::Server::SIG in turn adds a signal handler
like this:
$SIG{$sig} = sub{ $Net::Server::SIG::_SIG{$_[0]} = 1; };
However, when that sub is called, it is called with “CLD” as signal, not
“CHLD” (seemingly Perl has two names for this). This in turn confuses
check_sigs, which wants to do this with $sig set to “CLD”:
$_SIG_SUB{$sig}->($sig);
whereupon the crash happens.
I think the smallest fix around this is something like
$sig = 'CLD' if ($sig eq 'CHLD');
in the top of register_sig(), but I might be mistaken.
In any case, this makes Net::Server::PreforkSimple, and probably several others,
rather unusable, since they may crash at almost any time, and there is no simple
workaround that I can see. (Thus the RC severity.)
-- System Information:
Debian Release: 7.0
APT prefers stable
APT policy: (750, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.9.0+sesse01 (SMP w/16 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libnet-server-perl depends on:
ii libio-multiplex-perl 1.13-1
ii libio-socket-inet6-perl 2.69-2
ii libnet-cidr-perl 0.15-1
ii libsocket6-perl 0.23-1+b2
ii perl 5.14.2-21
libnet-server-perl recommends no packages.
Versions of packages libnet-server-perl suggests:
ii libio-socket-ssl-perl 1.76-2
ii liblog-log4perl-perl 1.29-1
ii libnet-ssleay-perl 1.48-1+b1
-- no debconf information
More information about the pkg-perl-maintainers
mailing list