On Fri, 25 Jul 2008 09:33:52 pm Sebastian Spiess wrote:
> hi all,
>
> for quite a while now I've been having one or sometimes 2 zombie processes
> showing in my system monitor

zombie is a defunct process; a process which hasn't been wait(2)'ed upon by 
its parent procecss after dying. In terms of non-programming jargon, this 
basically means that a process goes into a zombie state when it dies but 
hasn't been recollected by its parent because the child hasn't returned yet.
PARENT---
         |- CHILD (via fork), died but not returned to the parent yet, so a     
       
           zombie. 

> I tried to kill them using the system monitor. I tried killall and PID but
> everything I tried did not work. After reboot the zombie is back.

I don't think you can kill a zombie process normally. You can try issuing 
SIGCHLD(signal(7)), install a signal handler specifically for SIGCHLD 
(because it is ignored on Linux afaik) and then issue wait(2) on the child 
but that's about it. If that doesn't work out, init (PID 1) automatically 
handles defunct processes and issues wait(2) on it. However, do remember that 
it does take up space in the running kernel (for process table entries) but 
not actual system memory.

> PID is always >6000 if that matters.

PID - Incremented sequentially so that doesn't really matter afaik unless they 
are more than what the system can handle (max value is available via 
procs - /proc/sys/kernel/pid_max, which is tunable)

> How can I investigate what causes this zombie and how can I kill it.
> I would prefer the shot gun which worked well on zombies in some games but
> here in my system probably not :-)

heh. :)
You could write a small code that -
1) adds a hook to SIGCHLD (signal(7)) by installing a signal handler (because 
a SIGCHLD signal is ignored by default on Linux).
2) issue wait(2) on process.
If they don't do the magic, then I guess init(8) [PID 1] will adopt the 
zombies and then set wait(2) on it so it can reap it. That's the last resort.

I guess the most important statement from [1] is that - "Zombies that exist 
for more than a short period of time typically indicate a bug in the parent 
program." So, if that's the case it may be a good idea to contact the 
upstream author of whatever piece of code that is.

I am no guru but since its weekend, I thought I could help you out a bit ;)

[1] http://en.wikipedia.org/wiki/Zombie_process

cheers


-- 
ubuntu-au mailing list
ubuntu-au@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-au

Reply via email to