Does every exit(either_exit or exit) from a child send SIGCHLD to its parent?If it is so then how is a zombie process created?As wait system call is commonly invoked in the SIGCHLD handler.
Asked
Active
Viewed 1,384 times
2
-
1One major cause: The parent does not call wait() for the child, does not exit. So init cannot reap the child process. IF the parent exited without calling wait() then init would take over "onwership" and reap the child process. Zombies are usually the result of poor coding practices. – jim mcnamara Jun 04 '13 at 14:55
1 Answers
3
Yes, every process that dies causes a SIGCHLD to be sent to its parent — unless of course the parent has set SIGCHLD to be ignored.
If the process' parent is not ignoring SIGCHLD, then the dead child becomes a zombie until such time as it is reaped by the parent using waitpid()
or one of its variants. If the parent doesn't reap the dead child, it will remain a zombie.

Celada
- 21,627
- 4
- 64
- 78