HomeFreeBSD

Do not allow a process to reap an orphan (a child currently being

Description

Do not allow a process to reap an orphan (a child currently being
traced by another process such as a debugger). The parent process does
need to check for matching orphan pids to avoid returning ECHILD if an
orphan has exited, but it should not return the exited status for the
child until after the debugger has detached from the orphan process
either explicitly or implicitly via wait().

Add two tests for for this case: one where the debugger is the direct
child (thus the parent has a non-empty children list) and one where
the debugger is not a direct child (so the only "child" of the parent
is the orphan).

Differential Revision: https://reviews.freebsd.org/D2644
Reviewed by: kib
MFC after: 2 weeks

Details

Provenance
jhbAuthored on
Reviewer
kib
Differential Revision
D2644: Don't reap orphan processes during wait.
Parents
rS283561: Added comment.
Branches
Unknown
Tags
Unknown