Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!sundc!hqda-ai!merlin From: merlin@hqda-ai.UUCP (David S. Hayes) Newsgroups: comp.unix.wizards Subject: Re: Zombies ??? Message-ID: <165@hqda-ai.UUCP> Date: Mon, 8-Dec-86 10:46:18 EST Article-I.D.: hqda-ai.165 Posted: Mon Dec 8 10:46:18 1986 Date-Received: Mon, 8-Dec-86 21:38:42 EST References: <1327@brl-adm.ARPA> Organization: Army AI Center, Pentagon Lines: 33 Summary: How Zombies are Created No, you don't need chicken blood and a candle. :-) A zombie process is the visible artifact of the fact that Unix says that a parent can read the exit status of a child. When a child process exits, a status value is generated. (If it just returns from main, it still has an exit value. Normally zero, but it depends on your compiler.) The parent may want to read this status value, but the child process itself is no longer needed. When the child dies, its memory resources are reclaimed. The process table entry, which contains the exit status, is retained by the kernel. The table entry is kept so that the parent may pick up the exit status (via wait(2)). While the table entry is being preserved, its status is ZOMBIE. When the parent reads the child's exit status, the remaining table entry for the child is purged from the system. 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. Thus, the ZOMBIEs stick around until reboot. The preceding was discovered on a VAX running 4.2BSD, as a result of some problem with emacs. I think Sys V runs the same way, but I can't be sure, as I don't have a Sys V machine. -- David S. Hayes, The Merlin of Avalon PhoneNet: (202) 694-6900 ARPA: merlin%hqda-ai@brl UUCP: ...!seismo!sundc!hqda-ai!merlin