From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,73c56f328cda1230 X-Google-Attributes: gidfee84,public From: Ori Tzoran Subject: Re: Cannot kill processes Date: 1999/02/18 Message-ID: <36CC80E8.BE8049D5@netvision.net.il> X-Deja-AN: 445844405 References: <7acpii$2df$1@charm.magnus.acs.ohio-state.edu> <36CAE18D.A8AE9476@brighttiger.com> To: Jeff Denham , "Sergey Yu. Bobrovnikov" X-Accept-Language: en,fr-FR Content-Type: multipart/alternative; boundary="------------3AC3A96E7B3DDD4D3F35E3EA" X-Complaints-To: abuse@netvision.net.il X-Trace: news.netvision.net.il 919371875 28468 62.0.176.208 (18 Feb 1999 21:04:35 GMT) Organization: NetVision Israel Mime-Version: 1.0 NNTP-Posting-Date: 18 Feb 1999 21:04:35 GMT Newsgroups: comp.unix.osf.osf1 --------------3AC3A96E7B3DDD4D3F35E3EA Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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. --------------3AC3A96E7B3DDD4D3F35E3EA Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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. --------------3AC3A96E7B3DDD4D3F35E3EA-- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,73c56f328cda1230 X-Google-Attributes: gidfee84,public From: "Gene Homan" Subject: Re: Cannot kill processes Date: 1999/02/18 Message-ID: <7aiv37$grv$1@newman.pcisys.net>#1/1 X-Deja-AN: 445974036 References: <7acpii$2df$1@charm.magnus.acs.ohio-state.edu> <919263863.20985@monet> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: PCI Systems Inc. Newsgroups: comp.unix.osf.osf1 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 >>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 > From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,73c56f328cda1230 X-Google-Attributes: gidfee84,public From: Jeff Denham Subject: Re: Cannot kill processes Date: 1999/02/19 Message-ID: <36CDDF6D.CA3E7837@brighttiger.com>#1/1 X-Deja-AN: 446208866 Content-Transfer-Encoding: 7bit References: <7acpii$2df$1@charm.magnus.acs.ohio-state.edu> <36CAE18D.A8AE9476@brighttiger.com> <36CC80E8.BE8049D5@netvision.net.il> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@digex.net X-Trace: dca1-nnrp1.news.digex.net 919461801 207.86.119.34 (Fri, 19 Feb 1999 17:03:21 EDT) Organization: Bright Tiger Technologies MIME-Version: 1.0 NNTP-Posting-Date: Fri, 19 Feb 1999 17:03:21 EDT Newsgroups: comp.unix.osf.osf1 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 From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,73c56f328cda1230,start X-Google-Attributes: gidfee84,public From: Jeff Denham Subject: Re: Cannot kill processes Date: 1999/02/17 Message-ID: <36CAE18D.A8AE9476@brighttiger.com>#1/1 X-Deja-AN: 445347290 Content-Transfer-Encoding: 7bit References: <7acpii$2df$1@charm.magnus.acs.ohio-state.edu> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@digex.net X-Trace: dca1-nnrp1.news.digex.net 919265719 207.86.119.34 (Wed, 17 Feb 1999 10:35:19 EDT) Organization: Bright Tiger Technologies MIME-Version: 1.0 NNTP-Posting-Date: Wed, 17 Feb 1999 10:35:19 EDT Newsgroups: comp.unix.osf.osf1 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 > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,73c56f328cda1230 X-Google-Attributes: gidfee84,public From: Sergey Yu. Bobrovnikov Subject: Re: Cannot kill processes Date: 1999/02/17 Message-ID: <919263863.20985@monet>#1/1 X-Deja-AN: 445362411 Content-Transfer-Encoding: 8bit References: <7acpii$2df$1@charm.magnus.acs.ohio-state.edu> Followup-To: comp.unix.osf.osf1 Content-Type: text/plain; charset="us-ascii" X-Complaints-To: usenet@monet.npi.msu.su X-Trace: monet.npi.msu.su 919263279 2677 158.250.5.155 (17 Feb 1999 14:54:39 GMT) Organization: Inst. of Nuclear Physics, Moscow State University Mime-Version: 1.0 NNTP-Posting-Date: 17 Feb 1999 14:54:39 GMT Newsgroups: comp.unix.osf.osf1 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 >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