Skip to main content

Timeline for Why cannot we kill a zombie?

Current License: CC BY-SA 3.0

11 events
when toggle format what by license comment
Jan 4, 2015 at 20:26 history edited Pavel Šimerda CC BY-SA 3.0
added 182 characters in body
Jan 4, 2015 at 20:24 comment added Pavel Šimerda Does it happen in practice, or is it just a theoretical problem? Also isn't it much slower to allocate old pid values than to allocate unused ones incrementally?
Jan 4, 2015 at 19:58 comment added ctrl-alt-delor On a system that creates a lot of processes, the next pid will wrap around (PIDs will be reused). Imagine a parent process with a window and a red stop button. It starts several child processes. The user presses the red button, so the parent send a kill to all children (based on a list of all pids). While half way through this very long list of children. One of the children finishes (this is ok, you can not kill something that is already dead), but then another process starts and gets same pid. Could easily happen on system where there are lot of processes being created, or parent is slow.
Jan 4, 2015 at 12:41 comment added Pavel Šimerda @richard Incorporated info from your comments, feel free to make another edit. I didn't include the pid part though, as I don't think that applies. You can easily avoid it by only assigning incrementally, which I think is the case already.
Jan 4, 2015 at 12:40 history edited Pavel Šimerda CC BY-SA 3.0
Incorporated information from Richard.
Jan 4, 2015 at 12:00 comment added ctrl-alt-delor @sree Because it is already dead: When a process dies it becomes a zombie (almost all resources are freed, except pid and exit status). This is true of all processes, however they usually don't stay in this state for long. It they no longer have a parent, then they are adopted by init (pid=1). Then when the parent (or init) acknowledges the death of the child, the process is reaped and is no longer in the process table.
Jan 4, 2015 at 11:54 comment added ctrl-alt-delor and to prevent the pid being reused. The parent has the pid of the child and may signal the child (may try to kill it), just from the pid it recieved when it created the child. It would be bad for the pid to be reused. Therefore the child remains in a zombie state until the parent acknowledges the death of the child, or the parent dies.
Jan 4, 2015 at 9:49 comment added Pavel Šimerda I think now it is pretty clear.
Jan 4, 2015 at 9:48 history edited Pavel Šimerda CC BY-SA 3.0
added 689 characters in body
Jan 4, 2015 at 9:29 comment added Sreeraj Yes. I am aware of that. My question is why wouldn't the SIGKILL remove the zombie from the process table?
Jan 4, 2015 at 9:15 history answered Pavel Šimerda CC BY-SA 3.0