Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jun 2015 18:15:46 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283889 - head/sys/kern
Message-ID:  <201506011815.t51IFkPv027540@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Jun  1 18:15:45 2015
New Revision: 283889
URL: https://svnweb.freebsd.org/changeset/base/283889

Log:
  Clear p_stops when doing PT_DETACH.
  
  Without this, if a process was being traced by truss(1), which
  uses different p_stops bits than gdb(1), the latter would
  misbehave because of the unexpected bits.
  
  Reported by:	jceel
  Submitted by:	sef
  Sponsored by:	iXsystems, Inc.
  MFC after:	2 weeks

Modified:
  head/sys/kern/sys_process.c

Modified: head/sys/kern/sys_process.c
==============================================================================
--- head/sys/kern/sys_process.c	Mon Jun  1 18:15:44 2015	(r283888)
+++ head/sys/kern/sys_process.c	Mon Jun  1 18:15:45 2015	(r283889)
@@ -963,6 +963,7 @@ kern_ptrace(struct thread *td, int req, 
 				CTR1(KTR_PTRACE, "PT_DETACH: pid %d", p->p_pid);
 			p->p_oppid = 0;
 			p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK);
+			p->p_stops = 0;
 
 			/* should we send SIGCHLD? */
 			/* childproc_continued(p); */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201506011815.t51IFkPv027540>