sys.kern.pdeathsig.signal_delivered_ptrace: fix debugger detach
ptrace(PT_DETACH) requires stopped debuggee, otherwise it fails. When the call fails, the C process is left as debuggee of the process D, and might be killed too early if process D exits occurs fast enough. Since pipes are not closed in the forked children, this resulted in the test hanging, since no write occured from C to wake A. PR: 237657 Reported and tested by: lwhsu Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
55d26365b1
commit
39ba52c0b7
@ -305,7 +305,9 @@ ATF_TC_BODY(signal_delivered_ptrace, tc)
|
||||
WSTOPSIG(status));
|
||||
assert(rc == 0);
|
||||
|
||||
ptrace(PT_DETACH, c_pid, 0, 0);
|
||||
waitpid(c_pid, &status, 0);
|
||||
if (!WIFEXITED(status))
|
||||
ptrace(PT_DETACH, c_pid, 0, 0);
|
||||
|
||||
_exit(0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user