* Re: Cannot kill <defunct> processes [not found] <7acpii$2df$1@charm.magnus.acs.ohio-state.edu> @ 1999-02-17 5:00 ` Sergey Yu. Bobrovnikov 1999-02-18 5:00 ` Gene Homan 1999-02-17 5:00 ` Jeff Denham 1 sibling, 1 reply; 5+ messages in thread From: Sergey Yu. Bobrovnikov @ 1999-02-17 5:00 UTC (permalink / raw) On Wed, 17 Feb 1999, Steen Hansen wrote: >We have a purchased application running on our 4.0D version of Compaq's >Unix (I refuse to call it the new stupid name). > >It leaves a stack of defunct processes sitting out there, which I would >like to clean up, ahile we wait for the vendor to clean up his code. But I >cannot kill them, I *believe* I can do that with other Unixes, though it's >quite awhile ago I had any there. > >Why can't I kill this one? > ># ps -ef|grep 1018 >iii 1018 10710 0.0 - ?? 0:00.00 <defunct> >root 19371 8041 0.2 16:48:27 ttyr1 0:00.02 grep 1018 ># kill 1018 >kill: 1018: no such process Try to # ps -fe | grep 10710 # kill 10710 > > >Thanks > >Steen >-- >Steen Hansen (Hviid), Systems & LAN Admin, The Ohio State University Sergey ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Cannot kill <defunct> processes 1999-02-17 5:00 ` Cannot kill <defunct> processes Sergey Yu. Bobrovnikov @ 1999-02-18 5:00 ` Gene Homan 0 siblings, 0 replies; 5+ messages in thread From: Gene Homan @ 1999-02-18 5:00 UTC (permalink / raw) You cannot kill a zombied process. Well, I shouldn't say can't as there is a trick where you can try to convince a zombie that it is a child of another parent via the kernel debugger, but that works on a 50-50 scale and can cuase problems if done improperly. The only way to clean up defunct procs with a "Z" state is to reboot. Sorry, its just a fact of UNIX. This is the same on ALL versions of UNIX that I know of. Later, Gene Homan UNIX Technical Analyst Oracle Worldwide Support Sergey Yu. Bobrovnikov wrote in message <919263863.20985@monet>... >On Wed, 17 Feb 1999, Steen Hansen wrote: >>We have a purchased application running on our 4.0D version of Compaq's >>Unix (I refuse to call it the new stupid name). >> >>It leaves a stack of defunct processes sitting out there, which I would >>like to clean up, ahile we wait for the vendor to clean up his code. But I >>cannot kill them, I *believe* I can do that with other Unixes, though it's >>quite awhile ago I had any there. >> >>Why can't I kill this one? >> >># ps -ef|grep 1018 >>iii 1018 10710 0.0 - ?? 0:00.00 <defunct> >>root 19371 8041 0.2 16:48:27 ttyr1 0:00.02 grep 1018 >># kill 1018 >>kill: 1018: no such process > >Try to ># ps -fe | grep 10710 ># kill 10710 > >> >> >>Thanks >> >>Steen >>-- >>Steen Hansen (Hviid), Systems & LAN Admin, The Ohio State University > >Sergey > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Cannot kill <defunct> processes [not found] <7acpii$2df$1@charm.magnus.acs.ohio-state.edu> 1999-02-17 5:00 ` Cannot kill <defunct> processes Sergey Yu. Bobrovnikov @ 1999-02-17 5:00 ` Jeff Denham 1999-02-18 5:00 ` Ori Tzoran 1 sibling, 1 reply; 5+ messages in thread From: Jeff Denham @ 1999-02-17 5:00 UTC (permalink / raw) Steen Hansen wrote: > We have a purchased application running on our 4.0D version of Compaq's > Unix (I refuse to call it the new stupid name). > > It leaves a stack of defunct processes sitting out there, which I would > like to clean up, ahile we wait for the vendor to clean up his code. But I > cannot kill them, I *believe* I can do that with other Unixes, though it's > quite awhile ago I had any there. > > Why can't I kill this one? > > # ps -ef|grep 1018 > iii 1018 10710 0.0 - ?? 0:00.00 <defunct> > root 19371 8041 0.2 16:48:27 ttyr1 0:00.02 grep 1018 > # kill 1018 > kill: 1018: no such process Outside the realm of vampires, you can't kill something that's already dead, even a zombie process. That defunct process still has a PID and a parent, but that's about it. If the parent PID of these defunct processes is 1 (the init process), then you've hit an OS bug -- init should be cleaning these up. But if the parent isn't PID 1, then the only way to clean them up is to kill the buggy parent, which isn't cleaning up its zombie children. Most likely, this app was ported from a System V base, where it used signal() to set SIGCHLD to SIG_IGN, which causes the system to clean up zombies automatically. Under Tru64 UNIX, formerly known as Digital UNIX, formerly know as DEC OSF/1, formerly known as OSF/1, formerly known as Mach 2.5, you have to use sigaction() with SA_FLAGS set to SA_NOCLDWAIT for SIGCHLD to get the same automatic cleanup behavior (or run in the UNIX 95 evironment using, of course, the c89 compiler, or link with libsys5). Maybe you can pass that on to your vendor. __________________________________________________ Jeff Denham (jdenham@brighttiger.com) Bright Tiger Technologies: Resource-management software for building and managing fast, reliable web sites See us at http://www.brighttiger.com 125 Nagog Park Acton, MA 01720 Phone: (978) 263-5455 x177 Fax: (978) 263-5547 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Cannot kill <defunct> processes 1999-02-17 5:00 ` Jeff Denham @ 1999-02-18 5:00 ` Ori Tzoran 1999-02-19 5:00 ` Jeff Denham 0 siblings, 1 reply; 5+ messages in thread From: Ori Tzoran @ 1999-02-18 5:00 UTC (permalink / raw) To: Jeff Denham, Sergey Yu. Bobrovnikov [-- Attachment #1: Type: text/plain, Size: 2429 bytes --] both postings from Sergey and Jeff are missing the point. the answer is simple: when a parent forks a child, the child does an exit (for whatever reason, this may also be an abnormal exit) but the parent doesn't wait(2) on it, the kernel holds the accounting information for the child. as soon as the parent do one of the wait variants, the kernel releases the PCB for the child and you wont see the defunct anymore. a defunct is not annoying so much, it doesn't take system resources, except for a slot in the (limited) array of tasks. if you encounter a pbl with "no more processes", max_task is reached. you can work around that by setting maxusers higher and wait for your vendor to fix the pbl. now for some pedagogy, first lets handle Sergey: you suggest: > Try to > # ps -fe | grep 10710 > # kill 10710 > did you try your idea? it won't work. so what's the point in making a posting? i saw a similar posting for a question regarding "truss" on DUX: someone says "try one of the CDs" in reply to someone who asks on which CD he can find truss. the latter mentions he searched them... then Jeff: > .... > > Outside the realm of vampires, you can't kill something that's > already dead, even a zombie process. That defunct process > still has a PID and a parent, but that's about it. well, defunct is EXACTLY a zombie. one is legacy unix term, the other is slang... > > If the parent PID of these defunct processes is 1 (the init process), > then you've hit an OS bug -- init should be cleaning these up. you wont encounter that.... > > > But if the parent isn't PID 1, then the only way to clean them up is > to kill the buggy parent, which isn't cleaning up its zombie children. what an interesting idea. mind you, on DUX 4.0x, yppasswdd also leaves a zombie. so kill it too... > > > Most likely, this app was ported from a System V base, where it > used signal() to set SIGCHLD to SIG_IGN, which causes the system to > clean up zombies automatically. > > Under Tru64 UNIX, formerly known as Digital UNIX, formerly know > as DEC OSF/1, formerly known as OSF/1, formerly known as > Mach 2.5, you have to use sigaction() with SA_FLAGS set to > SA_NOCLDWAIT for SIGCHLD to get the same automatic cleanup > behavior (or run in the UNIX 95 evironment using, > of course, the c89 compiler, or link with libsys5). Maybe you > can pass that on to your vendor. this is quite interesting, but is a bit aside the issue. [-- Attachment #2: Type: text/html, Size: 2771 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Cannot kill <defunct> processes 1999-02-18 5:00 ` Ori Tzoran @ 1999-02-19 5:00 ` Jeff Denham 0 siblings, 0 replies; 5+ messages in thread From: Jeff Denham @ 1999-02-19 5:00 UTC (permalink / raw) Ori Tzoran wrote: > then Jeff: > > > .... > > > > Outside the realm of vampires, you can't kill something that's > > already dead, even a zombie process. That defunct process > > still has a PID and a parent, but that's about it. > > well, defunct is EXACTLY a zombie. one is legacy unix term, the other is slang... > I never said they were different. Sorry you didn't understand. I guess I just should have said, "No, you can kill a defunct process; it's already dead." > > > > > If the parent PID of these defunct processes is 1 (the init process), > > then you've hit an OS bug -- init should be cleaning these up. > > you wont encounter that.... > No, probably not. But it does/has happened. I've fixed such bugs in the Digital UNIX kernel myself. Guess I'm still on the look out for more. > > > > > > But if the parent isn't PID 1, then the only way to clean them up is > > to kill the buggy parent, which isn't cleaning up its zombie children. > > what an interesting idea. mind you, on DUX 4.0x, yppasswdd also leaves a zombie. so kill it too... > Again, you've misunderstood. I *never* said he *should* kill the parent. Just stating a plain and simple fact, thank you. > > > > > > Most likely, this app was ported from a System V base, where it > > used signal() to set SIGCHLD to SIG_IGN, which causes the system to > > clean up zombies automatically. > > > > Under Tru64 UNIX, formerly known as Digital UNIX, formerly know > > as DEC OSF/1, formerly known as OSF/1, formerly known as > > Mach 2.5, you have to use sigaction() with SA_FLAGS set to > > SA_NOCLDWAIT for SIGCHLD to get the same automatic cleanup > > behavior (or run in the UNIX 95 evironment using, > > of course, the c89 compiler, or link with libsys5). Maybe you > > can pass that on to your vendor. > > this is quite interesting, but is a bit aside the issue. > No, it's not beside aside the issue. I've helped too many developers/customers with exactly this problem, which happens exactly for the reason I stated. The zombies are there because the parent didn't call wait() to reap them. Under SysV, you don't necessarily have to call wait -- you just do signal(SIGCHLD, SIG_IGN). Porting this code to a BSD-based system causes zombies to be created. Seen it over and over. End of story. It may not be why the zombies are there, but it's a decent possibility. Jeff ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1999-02-19 5:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <7acpii$2df$1@charm.magnus.acs.ohio-state.edu>
1999-02-17 5:00 ` Cannot kill <defunct> processes Sergey Yu. Bobrovnikov
1999-02-18 5:00 ` Gene Homan
1999-02-17 5:00 ` Jeff Denham
1999-02-18 5:00 ` Ori Tzoran
1999-02-19 5:00 ` Jeff Denham
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox