cancel
Showing results for 
Search instead for 
Did you mean: 

zombies

Jaro_2
Occasional Contributor

zombies

hello.

Sorry for this basic question, but it will help me.
Please give me the most common reasons, why could zombies processes occur.
Thanx.
j
5 REPLIES
Stephen Burt
Occasional Visitor

Re: zombies

A zombie process is a process that has exited, but whose exit code has
not been delivered to its parent process yet. The parent process has to
do a wait(2)-type system call to read the exit code of a child.

Some programs fork child processes, but do not wait for them when they
(the children) exit. The child processes remain as zombies. The only
resource a zombie takes is a slot in the process table.

When a parent process exits itself, its children become children of init,
process number 1. Init waits for its children. So when a parent exits, its
zombie children effectively disappear because they are waited for by init.

If you really really really want to kill a zombie, kill its parent. The
zombie goes to init, and subsequently disappears.
Michael Schulte zur Sur
Honored Contributor

Re: zombies

You should recognize a zombie by in the ps listing.

greetings,

Michael
Jaro_2
Occasional Contributor

Re: zombies

thanks.

What could be the reasons, that child's exit code hasn't been received by its parent process yet?

bye,
jk
Stephen Burt
Occasional Visitor

Re: zombies

Hi,

The parent process has to
do a wait(2)-type system call to read the exit code of a child.

Basically the parent has to issue another call it could well be that the parent has not issued it for reasons unknown
Mark Grant
Honored Contributor

Re: zombies

Jaro,

It is basically due to software not behaving properly. A process that forks a child is supposed to trap SIGCHLD (death of a child)and do a "wait()" immediately. If it doesn't because it isn't written properly then you will have a "zombie" process. You can't kill a zombie but then again, it isn't taking up any system resources except one slot in your process table.
Never preceed any demonstration with anything more predictive than "watch this"