For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > July 2006 > Unruly children









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Unruly children
Al Balmer

2006-07-24, 6:59 pm

I've been debugging a server written in Perl, running on HP-UX. It
spawns a pool of children to handle connections. The problem is that a
zombie is created for each child in the pool. Doesn't hurt anything,
apparently, but makes the customers nervous :-)

The parent sets $SIG{CHLD} to a straightforward handler which waits
for the expired child, but each of the children sets $SIG{CHLD} to
DEFAULT. I noticed that the parent's sig_chld handler was never
called. If I remove the childrens' signal assignment, the handler is
called and all but one of the zombies go away.

I (and the original programmer) had assumed that each child gets its
own copy of the signal vectors, and the signal routing in the parent
wouldn't be affected. Is this incorrect?

--
Al Balmer
Sun City, AZ
Al Balmer

2006-07-24, 6:59 pm

On Mon, 24 Jul 2006 19:32:59 GMT, Al Balmer <albalmer@att.net> wrote:

>I've been debugging a server written in Perl, running on HP-UX. It
>spawns a pool of children to handle connections. The problem is that a
>zombie is created for each child in the pool. Doesn't hurt anything,
>apparently, but makes the customers nervous :-)
>
>The parent sets $SIG{CHLD} to a straightforward handler which waits
>for the expired child, but each of the children sets $SIG{CHLD} to
>DEFAULT. I noticed that the parent's sig_chld handler was never
>called. If I remove the childrens' signal assignment, the handler is
>called and all but one of the zombies go away.
>
>I (and the original programmer) had assumed that each child gets its
>own copy of the signal vectors, and the signal routing in the parent
>wouldn't be affected. Is this incorrect?


Never mind ;-) A careful study of the pids involved shows that the
parent is cleaning up just fine, but somewhere the children are
spawning children of their own, and can't clean them up if the signal
is defaulted.

--
Al Balmer
Sun City, AZ
Rick Jones

2006-07-24, 6:59 pm

Al Balmer <albalmer@att.net> wrote:
> Never mind ;-) A careful study of the pids involved shows that the
> parent is cleaning up just fine, but somewhere the children are
> spawning children of their own, and can't clean them up if the
> signal is defaulted.


Grandchildren are a parent's revenge :) and one's children are never
as neat and tidy as one was :)

rick jones
--
denial, anger, bargaining, depression, acceptance, rebirth...
where do you want to be today?
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com