1753784 Members
6901 Online
108799 Solutions
New Discussion юеВ

Top Question???

 
SOLVED
Go to solution
John Booth_1
Advisor

Top Question???

What is a zombie??

241 processes: 232 sleeping, 2 running, 7 zombies
9 REPLIES 9
Robin Wakefield
Honored Contributor

Re: Top Question???

Zombies are processes that have died, but have not removed from the process table. Often caused by a parent process not keeping track of its children.

Robin
Paula J Frazer-Campbell
Honored Contributor

Re: Top Question???

Hi

Zombies on a normal system get cleaned up and a kill will not get ruid if them.

If you get stuck with lots of zombies then a reboot is required.

"Zombie -- Dead but won't lie down----"


Paula
If you can spell SysAdmin then you is one - anon
James R. Ferguson
Acclaimed Contributor

Re: Top Question???

Hi John:

A zombie process is one that is never going to wake up. Most generally, it is waiting on its parent process to collect its termination information by doing a wait().

...JRF...
Magdi KAMAL
Respected Contributor
Solution

Re: Top Question???

Hi John,

Look, Zambie process are those one that when they finish working ( normal or abnormal exit ) they didn't find their parents still a live( waiting ) for them.

That's mean, consider a process P0 wis doing a fork ( creates a copy of himeself ). The copy process is P1 called the child process and P0 is the parent process of P1.

If P1 finish his work ( normal or abnormal exit ) and P0 is not listening to him with a wait() function. So , P1 became a ZAMBIE process.

Alot of devellopers fall into this problem ( they are no more accepted into the system under their loginnames till these zambies are killed with a BOOT of course ) and the only way to kill them is REBOOTING the system.

Why booting, is that Zambies are considered as
1. Not live nor not Died !!! So how to kill them.

If you need any help to avoid this miss programming, I have the solution just append your request .

Hope this helps.

Magdi
MANOJ SRIVASTAVA
Honored Contributor

Re: Top Question???

Hi John

It is like this , when you kill a paretn process and not the children procees associated with it then that process become a zombie or defunct process . There is no way to kill it except for rebooting the system .

Manoj Srivastava
Vincenzo Restuccia
Honored Contributor

Re: Top Question???

Zombies are processes that have died, but can't remove with kill -9,only with reboot.
Magdi KAMAL
Respected Contributor

Re: Top Question???

Hi again,

I am not sure MANOJ !!!

If you kill the parent process, all children are killed as well. This is sure.

The phenomena of Zambies is :

The child exit and his parent is not listening to him. That's really all !

Have a look in the following book :

Advanced Programming in the UNIX Environment.
Addison-Wesley
W. Richard Stevens.
Pages 195 and 196

Magdi

MANOJ SRIVASTAVA
Honored Contributor

Re: Top Question???

Yep Kamal

I also agree but then if child process dies with the parent process then we can never have zombies . So what you say is genreally true but in some cases it may not by when the Zombies get created.
Cheers

Manoj Srivastava
Magdi KAMAL
Respected Contributor

Re: Top Question???

Hi Manoj,

You said , "I also agree but then if child process dies with the parent process then we can never have zombies ", :

I don't undrestand the sentence : "if child process dies with the parent" ?

The situation is :

P0 is the parent of P1.
P1 is the child of P0.

Normal programming is :
1. The parent P0 should execute a wait() function before a child process terminates normally or abnormally.
2. If Child process is not sure that his parent is waiting for him , he will execute the function getppid() function and executes an exit() as soon the function getppid() returns 1 ( that means that the unix init process (pid 1) is the actual parent).

unix init process ( pid one ) inheriets all orphan processes and immediately executes a wait() function as soon as a child process exits ( normal or abnormal exit ).

It's really the Client/Server model from a process point of vue and I implement this solution in 1995.

Of course, after two systems boots !!!

The manner by which the Unix model avoid that is :

P0 forks twice ,

P0 fork and gives P1
P1 fork and gives P2

1.The first instruction of P2 is to loop till getppid() returns 1; getppid means GetParentProcessIdentification. ( init process )
2. The first instruction of P1 is exit() function.
3. P2 became ORPHAN.
4. init process become the actual parent of P2.
5. The function getppid() returns 1 now.
6. The P2 process executes its task.
7. P2 terminates normally or abnormally.
8. init process executes an immediate wait() function.
9. P2 died without being ZAMBIE.

If you follow this protocol, your application will never have zambies processes.

Hope this explain the issue.
Wainting for any discussion.


Magdi