On Wed, Mar 12, 2008 at 09:57:16AM +0100, Otto Moerbeek wrote:
> zombie state happend if a child process exits, but its parent did not
> execute a wait(2) system call (or one if its alternatives) for the
> process (yet). So this seem a bug in the handling of CGIs.

I'd like to add a bit to the above and to Paul de Weerd's comments:

Zombie processes are there to maintain a little info in case the parent
process calls wait() later to retrieve it. Some program designs catch
SIGCHILD or have a thread block on wait*, and in those cases the zombie
lasts such a short time you'll probably never see it in top or ps. Other
designs use non-blocking forms and zombies may stick around long enough
to notice, but then disappear later when the parent makes a pass. If the
parent dies before calling wait, then the zombie is inherited by init
which will take care of it.

So, zombies happen, but the only time they stay around for a long time
is a negligent/misdesigned parent that is still alive but not calling
wait* on the children. The OS can't make a badly written program into a
well written program. So as admin you are stuck restarting the parent
periodically, switching to something else, or bugging the developers to
fix the problem.

-- 
Darrin Chandler            |  Phoenix BSD User Group  |  MetaBUG
[EMAIL PROTECTED]   |  http://phxbug.org/      |  http://metabug.org/
http://www.stilyagin.com/  |  Daemons in the Desert   |  Global BUG Federation

Reply via email to