[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Possible bug (perl server spawns zombies)

>The server below, written in perl, accepts connections on port 4242
>and sends a cliche to the client.  Some of you may recognize it as the
>server in appendix B of 'learning perl', modified to fork a child to
>handle each incoming connection.
>The subroutine 'wait_on_kid' should get rid of these children; indeed,
>it does so under SunOS.  However, on my machine runing Debian 0.91, it
>leaves one zombie for each connection accepted.
>Is this a peculiarity of Debian, or of Linux in general?  I'd
>appreciate it if someone would run the server, telnet to it a few
>times, and let me know if it leaves zombies on your machine as well.
>It would be even more informative if someone who has access to a
>machine running another distribution could do the same.

This is THE most frequent question when it comes to porting software
to Linux. Linux, due to POSIX, resets the signal handler once it has
been activated. You have to explictly re-establish the signal handler.
In C you get around this by using -D__USE_BSD_SIGNAL, this will use
BSD semantics for signal() which is what SunOS uses. Perl is obviously
assuming BSD semantics for its signal handling.
I know nothing about Perl, but you either have to recompile it using
the above define or fiddle with the wait_on_kid function to re-establish
the signal handler.

>Ted Hajek      Distributed Computing Services     University of Minnesota
>=-=-=-=-=-=-=-=-=-=-= CUT HERE -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Reply to: