diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 52a0c405713..2685a8b1384 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -2436,9 +2436,10 @@ ptracestop(struct thread *td, int sig) } stopme: thread_suspend_switch(td); - if (!(p->p_flag & P_TRACED)) { + if (p->p_xthread == td) + p->p_xthread = NULL; + if (!(p->p_flag & P_TRACED)) break; - } if (td->td_dbgflags & TDB_SUSPEND) { if (p->p_flag & P_SINGLE_EXIT) break;