A process appears in ps with a state of Z and the unsettling label <defunct>. It survives kill -9. Repeating the command changes nothing.
The common claim is that SIGKILL can remove any process. Linux provides no way for a running process to catch, block, or ignore SIGKILL—but a zombie is no longer running. The signal has arrived after the relevant part of the process has already disappeared.
What remains after exit
When a process exits, the kernel releases almost everything associated with it:
- Its address space is destroyed.
- Open file descriptors are closed.
- Its executable code stops running.
- Its schedulable task is gone.
A small record remains in the process table. It contains information the parent may need, especially the child’s PID, exit status, and resource-usage statistics.
That record is the zombie.
running child | | exit() v zombie record | | parent calls wait() v fully removed The zombie is therefore evidence of an unfinished conversation between the kernel and the parent process. The child has reported its departure, but the parent has not collected the report.
Why kill -9 changes nothing
Signals affect process execution. SIGKILL forces the kernel to terminate a process without giving its code a chance to respond.
A zombie has no code left to execute and no execution context to terminate. It cannot “ignore” SIGKILL; there is simply nothing alive for SIGKILL to kill. Depending on timing and process-table state, kill may even report success although the zombie entry remains. Successful signal delivery does not mean the zombie was reaped.
The only operation that completes the lifecycle is a wait operation by the responsible parent, such as wait(), waitpid(), or an equivalent library call.
Find the process that matters
The useful identifier is not merely the zombie’s PID, but its parent PID:
ps -o pid,ppid,state,comm -p 4312 Example output:
PID PPID S COMMAND 4312 1187 Z worker PID 4312 is already dead. PID 1187 is the process that has not collected its child’s status.
This often points to a bug or design error in the parent: perhaps it launches workers but never handles their termination, or its child-reaping loop has stalled.
Removing the zombie
The clean remedy is to make the parent perform its wait operation. Restarting or correcting the parent may accomplish that.
If the parent exits, Linux reparents the zombie to an appropriate child subreaper or, ultimately, an init-like process. That adopter normally waits for the child and removes the remaining record. Terminating a parent solely to clear a zombie can disrupt a service, so the parent’s role should be understood first.
One zombie consumes little beyond a process-table slot. Thousands are different: they can exhaust available PIDs and prevent new processes from starting.
The stubborn <defunct> entry is not an indestructible process. It is a receipt that nobody has picked up.
