When the process is already a child of its reaper, proc_reparent() returns early and does not re-enable waitpid(2), so after the last process descriptor was closed nobody could reap the zombie. If the reaper was also tracing the process, it was additionally linked onto the reaper's own orphan list, and after PT_DETACH it stayed there untraced, again without a waitpid(2) reference. PR: 301072
<Commit author is set to Laam Alif <laamalif@proton.me>. I restructured original patch>
tests/sys/kern/procdesc: test the reaper's own PD_NOWAITPID child Check that the reaper can waitpid(2) for its PD_NOWAITPID child after closing the last process descriptor, untraced, detached, or with the tracing reaper exiting. Based on reproducers provided by Laam Alif <laamalif@proton.me>. PR: 301072