Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
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"