in reply to Re^5: Pipes and IO::Select's method can_write()
in thread Pipes and IO::Select's method can_write()

In both cases, the child is not (completely) dead. It only disappears after waitpid allows it to die.

I feel this phrasing is slightly misleading...

ZOMBIE is the final state of a process (It does not "run" anymore). In that state all ressources used by the process are freed, all except one, the slot corresponding to the process in the kernel process table. If the father of that process is not a daemon and finishes eventually (even without handling /SIGC(H)?LD/) then the process is orphaned and init will reclaim it . If the father is a daemon then it *must* handle /SIGC(H)?LD/ or there is potential for the system process table to fill up. After that chaos is guaranteed, as nobody can fork!

Some systems allow a process to ignore /SIGC(H)?ILD/ so that the system does the reaping for it. I think it's POSIX but not (yet) fully portable. Note Un*x does not do this reaping systematically as the information is useful especially if you just want to control a pool of processes etc...The single UNIX spec (since 98 I think -- at least my HP-UX 11.0 manpage says so) does sanctify the "ignore" shortcut.

cheers --stephan
  • Comment on Re^6: Pipes and IO::Select's method can_write()