Zombies ???

Chris Lewis clewis at spectrix.UUCP
Wed Dec 10 03:50:25 AEST 1986


In article <165 at hqda-ai.UUCP> merlin at hqda-ai.UUCP (David S. Hayes) writes:
>All processes ZOMBIE for a short time: the time between the process
>exit and their parent's wait().  Processes that you see on ps(1) as
>ZOMBIE are the result of the parent process exiting before the child,
>or exiting without reading the child's exit status.  When this
>happens, he child (now considered an "orphan" process) becomes a child
>of init (process 1).  The kernel doesn't think about this, though, and
>just ZOMBIE's the child as usual.  Init, though, does not check the
>exit status either.  

Close but not quite.

>Thus, the ZOMBIEs stick around until reboot.

Not true - normally.

[Sort of reminds me of what somebody told one of our customers: "You should 
do a "ps-l" frequently.  If you see the words "csh" that means
the process has crashed, and you should issue a "kill -9 <pid>" to clear
it".... Sigh... ]

"init" is issuing "wait"'s continuously - that's how it figgers out that a 
login session has gone away.  It has a loop something like this:

	/* fork/exec all getty's specified in /etc/ttys (or whatever) 
	   and remember their pids */
	while(1) {
	    pid = wait(&status);
	    if (pid == one of the getty processes init spawned)
		fork/exec a new getty
	    else
		/* ignore completely */
	}

Therefore, in a normally running system init will eventually "wait" for all
processes that have died without their parent having waited for them, and
all Zombies will disappear.  Usually pretty quickly.

Situations where Zombie processes stay around are:

	1) init has died or hung (repeat by: "kill -9 1" [You hear the
	   howling of the Banshee....])
	2) the process isn't totally dead.  This can happen when the process
	   is trying to die, but during attempts to close all of it's open
	   devices, the driver hangs.  Especially when a tty driver hangs 
	   in "close" because of some odd state - common in some earlier 
	   EXORmacs UNIX systems.  Their not-quite-perfect tty driver and 
	   hardware would hang when a modem dropped the line - in this 
	   case, one "stuck" Zombie would prevent all other Zombies from 
	   being seen by init.

If your system ever starts getting large numbers of Zombies that are
staying around, first check to ensure that "init" is still running (process 1).
If it ain't, it'll be a Zombie too - You MUST reboot your system to recover
(tho, some systems autoreboot if init goes away - eg: Pyramids).  Once init
has gone away, no "new" getty's will be spawned until reboot.

Otherwise, suspect devices associated with the Zombie processes.  Until you 
have the "device hang" problem fixed you will always have to reboot to clear 
Zombies (if the number is increasing).  Contact your support organization.
-- 
Chris Lewis, Spectrix Microsystems Inc,
UUCP: {utzoo|utcs|yetti|genat|seismo}!mnetor!spectrix!clewis
ARPA: mnetor!spectrix!clewis at seismo.css.gov
Phone: (416)-474-1955



More information about the Comp.unix.wizards mailing list