Re: [gtk-list] Defunct processes after fork/_exit



[...]
>I've written some code that forks and does some useful
>work in the child process. While the child process is executing,
>everything is fine, but once it terminates and calls _exit(0) the
>process listing shows it as being defunct:
[...]
>Any idea what I might be doing wrong to cause this?

Standard unix question #4582: the kernel is keeping the process structure 
around in case the parent wants to find out how the child died. This process 
stub is called a zombie process; to get rid of it you need to wait() for it in 
the parent. (Or you can just ignore it; it'll get destroyed when the parent 
exits, though this is usually considered bad practice.)

-- 
+- David Given ---------------McQ-+ "Gaping from its single obling socket was
|  Work: dg@tao-group.com         | scintillating, many fauceted scarlet
|  Play: dgiven@iname.com         | emerald..." --- Jim Theis, _The Eye of
+- http://wired.st-and.ac.uk/~dg -+ Argon_                                     




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]