diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2018-06-21 21:12:49 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2018-06-21 21:12:49 +0000 |
commit | 6e22bbf66e37e82f572d8cf7a2be5b333c8f41f8 (patch) | |
tree | 443c3f0811caa72c6fd5689fac483c808d3d2008 /sys/kern/kern_sig.c | |
parent | ac4bc0c171f8839e74d9f0bcd8e5e31322167361 (diff) | |
download | src-6e22bbf66e37e82f572d8cf7a2be5b333c8f41f8.tar.gz src-6e22bbf66e37e82f572d8cf7a2be5b333c8f41f8.zip |
fork: avoid endless wait with PTRACE_FORK and RFSTOPPED.
An RFSTOPPED thread can't clean TDB_STOPATFORK, which is done in the
fork_return() in its context, so parent is stuck forever. Triggered
when trying to ptrace linux process. Instead of waiting for the new
thread to clear TDB_STOPATFORK, tag it as traced and reparent to the
debugger in do_fork(), and let it only notify the debugger when run.
Submitted by: Yanko Yankulov <yanko.yankulov@gmail.com>
Reviewed by: jhb
MFC after: 1 week
X-MFC-Note: keep p_dbgwait placeholder intact
Differential revision: https://reviews.freebsd.org/D15857
Notes
Notes:
svn path=/head/; revision=335504
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index d907b40434f8..3acd26f5c1a5 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2581,7 +2581,6 @@ ptracestop(struct thread *td, int sig, ksiginfo_t *si) } if ((td->td_dbgflags & TDB_STOPATFORK) != 0) { td->td_dbgflags &= ~TDB_STOPATFORK; - cv_broadcast(&p->p_dbgwait); } stopme: thread_suspend_switch(td, p); |