mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Always clear p_xthread if current thread no longer needs it, in theory, if
debugger exited without calling ptrace(PT_DETACH), there is a time window that the p_xthread may be pointing to non-existing thread, in practical, this is not a problem because child process soon will be killed by parent process.
This commit is contained in:
parent
4a4c0f7c24
commit
7ce60f6013
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue