in reply to exec creating zombie processes
exec creating zombie processes
exec doesn't create processes. exec cannot cause processes to become zombies.
when I have to "kill" the process, it is leaving a zombie child process.
In unix, whenever a program exits (from a signal or otherwise), it becomes a zombie until it is reaped by its parent. This serves two purposes: It reserves the PID until the parent knows that it cannot use it anymore, and it allows the parent to obtain the exit code of the child.
In the code path where you kill the child, you don't reap the child. Add a call to waitpid.
|
|---|