wait3 (waitpid alias) returns -1 with errno set to ECHILD when it should not

TLDR: you are currently relying on unspecified behaviour of signal(2); use sigaction (carefully) instead. Firstly, SIGCHLD is strange. From the manual page for sigaction; POSIX.1-1990 disallowed setting the action for SIGCHLD to SIG_IGN. POSIX.1-2001 allows this possibility, so that ignoring SIGCHLD can be used to prevent the creation of zombies (see wait(2)). Nevertheless, the historical … Read more

What are Zombies and what causes them? Are there Zombie processes and Zombie objects?

Zombie processes and zombie objects are totally unrelated. Zombie processes are when a parent starts a child process and the child process ends, but the parent doesn’t pick up the child’s exit code. The process object has to stay around until this happens – it consumes no resources and is dead, but it still exists … Read more

Killing a defunct process on UNIX system [closed]

You have killed the process, but a dead process doesn’t disappear from the process table until its parent process performs a task called “reaping” (essentially calling wait(3) for that process to read its exit status). Dead processes that haven’t been reaped are called “zombie processes.” The parent process id you see for 31756 is process … Read more

Do zombies exist … in .NET?

Is there a clearer definition of a “zombie thread” than what I’ve explained here? Seems like a pretty good explanation to me – a thread that has terminated (and can therefore no longer release any resources), but whose resources (e.g. handles) are still around and (potentially) causing problems. Can zombie threads occur on .NET? (Why/Why … Read more