How do you get rid of <defunct> processes? (AT&T UNIXpc)

David Herron -- Resident E-mail Hack david at ms.uky.edu
Thu Feb 11 14:27:14 AEST 1988


In article <260 at icus.UUCP> lenny at icus.UUCP (Lenny Tropiano) writes:
>I don't know how I do it, but sometimes a process terminates abnormally
>and it turns into a ZOMBIE <defunct> process.
>
>  F S   UID   PID  PPID  C PRI NI ADR SZ:RSZ   WCHAN TTY  TIME COMD
>  1 Z     0 14275 14273240  80  0                     <defunct>
>  1 S     0 14273     1  3  21  0  61 22:  0   4157c  w1  0:00 sh

The process is in an in-between state ... the process itself has
exitted and all of its' core is deallocated, the only thing left
is a process table slot.  That slot will go away whenever its' parent
does a wait().  "wait()" reaps zombies.  Probably the parent isn't
ready to do any wait()'s?

hmm... I just looked a bit closer at your example.  How in the world
did you get an "sh" with init as it's parent?  Are you running
without the window manager?  (er... /usr/bin/ua?)  (Yes, I already
know that you're running on a Unix PC).

Anyway ... a less drastic way of reaping that zombie is to have the
"sh" exit ... the zombie will then be inheritted by process 1
(init), and since init is doing wait()'s all the time eventually
the zombie will get reaped.  In general, this is the way of getting
zombies to be reaped is to cause them to be inheritted by init
somehow.

He's not tying up much resources.  I have a dim memory, however,
that a zombie can, in some cases, keep some device which can
only be exclusively opened (mag tapes?) from being used by anyone
else until the zombie is reaped.  Also seems like back then I hadn't
realized that the zombie merely had to be inheritted by process
1...
-- 
<---- David Herron -- The E-Mail guy            <david at ms.uky.edu>
<---- or:                {rutgers,uunet,cbosgd}!ukma!david, david at UKMA.BITNET
<----
<---- It takes more than a good memory to have good memories.



More information about the Comp.sys.att mailing list