Your message dated Wed, 9 Apr 2008 10:08:06 +0300 with message-id <[EMAIL PROTECTED]> and subject line Re: Bug#153201: perl-doc: Poor signal handling in multithreaded TCP echo server on perlipc man page has caused the Debian Bug report #153201, regarding perl-doc: Poor signal handling in multithreaded TCP echo server on perlipc man page to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [EMAIL PROTECTED] immediately.) -- 153201: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=153201 Debian Bug Tracking System Contact [EMAIL PROTECTED] with problems
--- Begin Message ---Package: perl-doc Version: 5.6.1-7 Severity: minor Tags: patch Summary: The multithreaded echo TCP Server example under _Sockets: Client/Server Communication_ on the perlipc man page is a poor example of signal handling. It may fail to reap all of the child processes. This behavior results from signal semantics. A pending signal means only that a signal has been raised at least once. If the signal handler is still handling the first CHLD signal when the second AND third CHLD come in, the third CHLD will be ignored. When the signal handler handles the second CHLD, the third child has already exited. wait() does not care which child is reaped, so it reaps this third child. Thus, the second child is left as a zombie. In the patch, waitpid is used to reap all finished child processes when called, so the second invocation of the signal handler reaps the second and third children. Note that this method is presented, but not elaborated on, in the same man page under _Signals_. Steps to reproduce: Patch the example to include sleep(1) at the end of REAPER() and the end of the code segment passed to spawn(). Start the multithreaded echo server. Start three copies of the echo presented in the same man page client at roughly the same time: perl client.pl & perl client.pl & perl client.pl Patch: *** server.pl Tue Jul 16 14:31:35 2002 --- server-patched.pl Tue Jul 16 14:32:51 2002 *************** *** 25,33 **** my $paddr; sub REAPER { ! $waitedpid = wait; $SIG{CHLD} = \&REAPER; # loathe sysV - logmsg "reaped $waitedpid" . ($? ? " with exit $?" : ''); } $SIG{CHLD} = \&REAPER; --- 25,34 ---- my $paddr; sub REAPER { ! while (($waitedpid = waitpid(-1, 0)) > 0) { ! logmsg "reaped $waitedpid" . ($? ? " with exit $?" : ''); ! } $SIG{CHLD} = \&REAPER; # loathe sysV } Example output of unpatched version: ipc.pl 24314: server started on port 2345 at Tue Jul 16 14:13:41 2002 ipc.pl 24314: connection from zossima [ 127.0.0.1 ] at port 58531 at Tue Jul 16 14:13:45 2002 ipc.pl 24314: begat 24318 at Tue Jul 16 14:13:45 2002 ipc.pl 24314: connection from zossima [ 127.0.0.1 ] at port 58532 at Tue Jul 16 14:13:45 2002 ipc.pl 24314: begat 24319 at Tue Jul 16 14:13:45 2002 ipc.pl 24314: connection from zossima [ 127.0.0.1 ] at port 58533 at Tue Jul 16 14:13:45 2002 ipc.pl 24314: begat 24320 at Tue Jul 16 14:13:45 2002 ipc.pl 24314: reaped 24318 with exit 256 at Tue Jul 16 14:13:46 2002 ipc.pl 24314: reaped 24320 with exit 256 at Tue Jul 16 14:13:47 2002 -- System Information Debian Release: 3.0 Architecture: i386 Kernel: Linux zossima 2.4.17 #4 Thu Jul 4 16:04:11 CDT 2002 i686 Locale: LANG=C, LC_CTYPE=C Versions of packages perl-doc depends on: ii perl 5.6.1-7 Larry Wall's Practical Extraction
--- End Message ---
--- Begin Message ---Version: 5.8.0-7 On Tue, Jul 16, 2002 at 02:42:49PM -0500, Tom Milford wrote: > Package: perl-doc > Version: 5.6.1-7 > Severity: minor > Tags: patch > > Summary: > The multithreaded echo TCP Server example under _Sockets: > Client/Server Communication_ on the perlipc man page is a poor example > of signal handling. It may fail to reap all of the child processes. > - logmsg "reaped $waitedpid" . ($? ? " with exit $?" : ''); > ! while (($waitedpid = waitpid(-1, 0)) > 0) { > ! logmsg "reaped $waitedpid" . ($? ? " with exit $?" : ''); > ! } This was fixed by upstream change [ 11987] By: jhi on 2001/09/10 23:24:11 Log: Subject: avoiding hoardes of zombies From: Nicholas Clark <[EMAIL PROTECTED]> Date: Mon, 10 Sep 2001 22:00:40 +0100 Message-ID: <[EMAIL PROTECTED]> Branch: perl ! pod/perlipc.pod which was included in 5.8.0. Closing accordingly. Cheers, -- Niko Tyni [EMAIL PROTECTED]
--- End Message ---

