Você gerou um processo filho, o matou e não usou wait(2)
para isso. O processo agora é um zumbi, andando por seus pais. Quando o processo pai morre, o zumbi se torna órfão, e o init cuida disso. De man 2 wait
no Linux:
In the case of a terminated child, performing a wait allows the system to release the resources associated with the child; if a wait is not performed, then the terminated child remains in a "zombie" state (see NOTES below).
E das anotações:
A child that terminates, but has not been waited for becomes a "zombie". The kernel maintains a minimal set of information about the zombie process (PID, termination status, resource usage information) in order to allow the parent to later perform a wait to obtain information about the child. As long as a zombie is not removed from the system via a wait, it will consume a slot in the kernel process table, and if this table fills, it will not be possible to create further processes. If a parent process terminates, then its "zombie" children (if any) are adopted by init(1), (or by the nearest "subreaper" process as defined through the use of the prctl(2) PR_SET_CHILD_SUBREAPER operation); init(1) automatically performs a wait to remove the zombies.
Portanto, wait()
para o processo filho, ou ele permanecerá até que o processo pai seja interrompido.