View | Details | Raw Unified | Return to bug 231445
Collapse All | Expand All

(-)b/sys/kern/kern_sig.c (-1 / +9 lines)
Lines 2576-2582 ptracestop(struct thread *td, int sig, ksiginfo_t *si) Link Here
2576
			    p->p_xthread == NULL)) {
2576
			    p->p_xthread == NULL)) {
2577
				p->p_xsig = sig;
2577
				p->p_xsig = sig;
2578
				p->p_xthread = td;
2578
				p->p_xthread = td;
2579
				td->td_dbgflags &= ~TDB_FSTP;
2579
2580
				/*
2581
				 * If we are on sleepqueue already,
2582
				 * let sleepqueue code decide if it
2583
				 * needs to go sleep after attach.
2584
				 */
2585
				if (td->td_wchan == NULL)
2586
					td->td_dbgflags &= ~TDB_FSTP;
2587
2580
				p->p_flag2 &= ~P2_PTRACE_FSTP;
2588
				p->p_flag2 &= ~P2_PTRACE_FSTP;
2581
				p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE;
2589
				p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE;
2582
				sig_suspend_threads(td, p, 0);
2590
				sig_suspend_threads(td, p, 0);
(-)b/sys/kern/subr_sleepqueue.c (+13 lines)
Lines 498-503 sleepq_catch_signals(void *wchan, int pri) Link Here
498
			} else {
498
			} else {
499
				mtx_unlock(&ps->ps_mtx);
499
				mtx_unlock(&ps->ps_mtx);
500
			}
500
			}
501
502
			/*
503
			 * Do not go into sleep if this thread was the
504
			 * ptrace(2) attach leader.  cursig() consumed
505
			 * SIGSTOP from PT_ATTACH, but we usually act
506
			 * on the signal by interrupting sleep, and
507
			 * should do it there as well.
508
			 */
509
			if ((td->td_dbgflags & TDB_FSTP) != 0) {
510
				if (ret == 0)
511
					ret = EINTR;
512
				td->td_dbgflags &= ~TDB_FSTP;
513
			}
501
		}
514
		}
502
		/*
515
		/*
503
		 * Lock the per-process spinlock prior to dropping the PROC_LOCK
516
		 * Lock the per-process spinlock prior to dropping the PROC_LOCK

Return to bug 231445