Defunct process

Chris Torek chris at mimsy.umd.edu
Sat Mar 10 17:12:33 AEST 1990


In article <6840005 at hpcllcm.HP.COM> pratap at hpcllcm.HP.COM
(Pratap Subrahmanyam) writes:
>... race condition ... The child dies soon after the parent is "killed",
>that is the child dies before it can be reparented.  Then the signal that
>the child sends out, will be lost in space.

That would be a kernel bug.  Fortunately, those who wrote the kernel were
not that sloppy.  When a parent exits, its children are passed over to
/etc/init (process 1).  If they try to exit while they are moving, nothing
happens until they finish moving; then they finish exiting and init wait()s
for them.  Then then go away.

>That is why you see <defunct> processes with ps -ef.

No.  There are two reasons for <defunct> or <exiting> processes: kernel
bugs (typically in device drivers), and parent processes that do not wait()
for children.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list