Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103248358
D20381.id58041.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D20381.id58041.diff
View Options
Index: head/sys/kern/kern_sig.c
===================================================================
--- head/sys/kern/kern_sig.c
+++ head/sys/kern/kern_sig.c
@@ -2576,7 +2576,15 @@
p->p_xthread == NULL)) {
p->p_xsig = sig;
p->p_xthread = td;
- td->td_dbgflags &= ~TDB_FSTP;
+
+ /*
+ * If we are on sleepqueue already,
+ * let sleepqueue code decide if it
+ * needs to go sleep after attach.
+ */
+ if (td->td_wchan == NULL)
+ td->td_dbgflags &= ~TDB_FSTP;
+
p->p_flag2 &= ~P2_PTRACE_FSTP;
p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE;
sig_suspend_threads(td, p, 0);
Index: head/sys/kern/subr_sleepqueue.c
===================================================================
--- head/sys/kern/subr_sleepqueue.c
+++ head/sys/kern/subr_sleepqueue.c
@@ -498,6 +498,19 @@
} else {
mtx_unlock(&ps->ps_mtx);
}
+
+ /*
+ * Do not go into sleep if this thread was the
+ * ptrace(2) attach leader. cursig() consumed
+ * SIGSTOP from PT_ATTACH, but we usually act
+ * on the signal by interrupting sleep, and
+ * should do that here as well.
+ */
+ if ((td->td_dbgflags & TDB_FSTP) != 0) {
+ if (ret == 0)
+ ret = EINTR;
+ td->td_dbgflags &= ~TDB_FSTP;
+ }
}
/*
* Lock the per-process spinlock prior to dropping the PROC_LOCK
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 3:05 PM (10 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14797684
Default Alt Text
D20381.id58041.diff (1 KB)
Attached To
Mode
D20381: Do not go into sleep in sleepq_catch_signals() when SIGSTOP from PT_ATTACH was consumed.
Attached
Detach File
Event Timeline
Log In to Comment