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

Problems with the undead (zombies)

I was hacking around on xfstt earlier today. I decided that it was too
limited in that it would only accept 1 simultaneous connection 
(ie for each xfstt you run you can only have 1 session of X using
it as a font path) so I decided to see if I could make it accept
multiple connections...

This turned out to be almost trivial...simply a few mods, instead of servicing
requests after connect, it fork()s and lets the child service that connection
while the parent loops and waits fo rthe next connect. [I think I changed 
10 lines of code total]

This SEEMS to work fine (I havn't really given it a good test -YET)
except when I connect and then disconnect...the child exists 
(via _exit(0)) after the client disconnects. The problem is that the
child then become a zombie.

The zombie does go away when I kill xfstt...unfortunatly that is not a great
solution (for obvious reasons)...soo...
How do I avoid this?
I seem to remember it had something to do with a child exiting..and when it 
does this it goes into kernel code to send the SIGCHLD signal to its parent
but it hangs there forever because the parent never takes the signal
(am I way off base?)

I installed a signal handler for SIGCHLD which does nothing 
what should I do? how can I make th eparent clean up its little zombie

[btw I plan to give this hack on xfstt a good stress test over the weekend
and upload a new version of the package when I am satisfied...will also
send my patch to the upstream author -- eventually I would like to
give the network portion of the code a major overhaul/re-write/face-lift but
thats another story]

To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: