Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145399483
D49961.id154357.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
D49961.id154357.diff
View Options
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -930,12 +930,10 @@
}
if (tid == 0) {
- if ((p->p_flag & P_STOPPED_TRACE) != 0) {
- KASSERT(p->p_xthread != NULL, ("NULL p_xthread"));
+ if ((p->p_flag & P_STOPPED_TRACE) != 0)
td2 = p->p_xthread;
- } else {
+ if (td2 == NULL)
td2 = FIRST_THREAD_IN_PROC(p);
- }
tid = td2->td_tid;
}
@@ -1322,16 +1320,19 @@
/*
* Clear the pending event for the thread that just
- * reported its event (p_xthread). This may not be
- * the thread passed to PT_CONTINUE, PT_STEP, etc. if
- * the debugger is resuming a different thread.
+ * reported its event (p_xthread), if any. This may
+ * not be the thread passed to PT_CONTINUE, PT_STEP,
+ * etc. if the debugger is resuming a different
+ * thread. There might be no reporting thread if
+ * the process was just attached.
*
* Deliver any pending signal via the reporting thread.
*/
- MPASS(p->p_xthread != NULL);
- p->p_xthread->td_dbgflags &= ~TDB_XSIG;
- p->p_xthread->td_xsig = data;
- p->p_xthread = NULL;
+ if (p->p_xthread != NULL) {
+ p->p_xthread->td_dbgflags &= ~TDB_XSIG;
+ p->p_xthread->td_xsig = data;
+ p->p_xthread = NULL;
+ }
p->p_xsig = data;
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Feb 20, 8:35 AM (1 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28889004
Default Alt Text
D49961.id154357.diff (1 KB)
Attached To
Mode
D49961: Fix handling of p_xthread
Attached
Detach File
Event Timeline
Log In to Comment