]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sys.kern.pdeathsig.signal_delivered_ptrace: fix debugger detach
authorkib <kib@FreeBSD.org>
Mon, 19 Aug 2019 09:29:27 +0000 (09:29 +0000)
committerkib <kib@FreeBSD.org>
Mon, 19 Aug 2019 09:29:27 +0000 (09:29 +0000)
commitc7867f406d07bc62cb83d6ef2d292fef57307355
tree87228fbe3f3fdf0267a0ecbc5ef58c848a7539b3
parent41a4c010326cd697d92141076bab53c424edb56f
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
tests/sys/kern/pdeathsig.c