Date: Tue, 10 Jul 2012 05:45:13 +0000 (UTC) From: David Xu <davidxu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r238336 - head/sys/kern Message-ID: <201207100545.q6A5jDV5062728@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davidxu Date: Tue Jul 10 05:45:13 2012 New Revision: 238336 URL: http://svn.freebsd.org/changeset/base/238336 Log: 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. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Jul 10 05:39:06 2012 (r238335) +++ head/sys/kern/kern_sig.c Tue Jul 10 05:45:13 2012 (r238336) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201207100545.q6A5jDV5062728>