Re: zombie after startup
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
Re: zombie after startup
Peter Garrett wrote: > On Fri, 25 Jul 2008 22:03:52 +1000 > Sebastian Spiess <[EMAIL PROTECTED]> wrote: > >> hi all, >> >> for quite a while now I've been having one or sometimes 2 zombie processes >> showing in my system monitor >> >> I tried to kill them using the system monitor. I tried killall and PID but >> everything I tried did not work. > > You can't kill a zombie process - that's why they are called > "zombies" :) > >> After reboot the zombie is back. >> >> PID is always >6000 if that matters. > > It is probably a misbehaving program that doesn't clean up after itself > correctly. Zombie processes are inherited by "init" (PID 1), but it > would be more useful for you to see which program is doing this. > > For example, you could run > > ps auxw | grep or grep for "Z" (capital Z is what > shows up in the process table). If this is reappearing on reboot you > have a buggy program... the parent process (whatever it is) is leaving > its children behind. Bad parent :) > >> How can I investigate what causes this zombie and how can I kill it. > > See above. You *cannot kill a zombie*, by definition. That said, a > zombie does no harm, since it uses no resources except what is required > to exist in the process list. You would need a huge army ( a horde?) of > zombies before there would be any impact on system performance. > > "Why You Can't Kill a Zombie Process" > http://www.unix.com.ua/orelly/unix/upt/ch38_16.htm > >> I would prefer the shot gun which worked well on zombies in some games but >> here in my system probably not :-) > > Garlic and silver bullets, waving crosses etc. don't work on zombies? > *grin* > Thanks Peter, I did as you suggested ~$ ps aux | grep 6141 seb 6141 0.0 0.0 0 0 ?ZJul25 0:00 [sh] seb 18058 0.0 0.0 3008 744 pts/1R+ 10:54 0:00 grep 6141 [EMAIL PROTECTED]:~$ ps aux | grep 14560 seb 14560 0.0 0.0 0 0 ?Z10:20 0:00 [sh] seb 18077 0.0 0.0 3008 752 pts/1R+ 10:54 0:00 grep 14560 [EMAIL PROTECTED]:~$ ps aux | grep Z USER PID %CPU %MEMVSZ RSS TTY STAT START TIME COMMAND seb 6141 0.0 0.0 0 0 ?ZJul25 0:00 [sh] seb 14560 0.0 0.0 0 0 ?Z10:20 0:00 [sh] seb 18088 0.0 0.0 3012 772 pts/1R+ 10:54 0:00 grep Z but what does that give me. A shell is the zombie... reading your link tells me that the problem could be a device driver. From what I remember I did not attach any new devices to my notebook, everything I use now I used when I installed hardy. I did though do some changes to installed software, my feeling is ever since I set up tracker to crawl my files the zombie was there, but I can't tell for sure. Another thing is that since I have the zombie (or two) I clicking on the clock/date left of the log out/shut down the panel seems to crash or slow every thing down. the menu with calendar and the locations won't even open. Any ideas here would be great because I am lost with this one :-/ thanks, sebastian -- ubuntu-au mailing list ubuntu-au@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-au
Re: zombie after startup
On Fri, 25 Jul 2008 22:03:52 +1000 Sebastian Spiess <[EMAIL PROTECTED]> wrote: > hi all, > > for quite a while now I've been having one or sometimes 2 zombie processes > showing in my system monitor > > I tried to kill them using the system monitor. I tried killall and PID but > everything I tried did not work. You can't kill a zombie process - that's why they are called "zombies" :) > After reboot the zombie is back. > > PID is always >6000 if that matters. It is probably a misbehaving program that doesn't clean up after itself correctly. Zombie processes are inherited by "init" (PID 1), but it would be more useful for you to see which program is doing this. For example, you could run ps auxw | grep or grep for "Z" (capital Z is what shows up in the process table). If this is reappearing on reboot you have a buggy program... the parent process (whatever it is) is leaving its children behind. Bad parent :) > How can I investigate what causes this zombie and how can I kill it. See above. You *cannot kill a zombie*, by definition. That said, a zombie does no harm, since it uses no resources except what is required to exist in the process list. You would need a huge army ( a horde?) of zombies before there would be any impact on system performance. "Why You Can't Kill a Zombie Process" http://www.unix.com.ua/orelly/unix/upt/ch38_16.htm > I would prefer the shot gun which worked well on zombies in some games but > here in my system probably not :-) Garlic and silver bullets, waving crosses etc. don't work on zombies? *grin* -- Peter Garrett <[EMAIL PROTECTED]> pgpOOGYexxRp9.pgp Description: PGP signature -- ubuntu-au mailing list ubuntu-au@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-au
zombie after startup
hi all, for quite a while now I've been having one or sometimes 2 zombie processes showing in my system monitor 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. PID is always >6000 if that matters. 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 :-) Thanks, Sebastian -- ubuntu-au mailing list ubuntu-au@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-au