Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 2015 18:16:23 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r284418 - in stable/10/sys: fs/procfs kern
Message-ID:  <201506151816.t5FIGNlC088427@svn.freebsd.org>

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

Log:
  MFC r283889,r283891:
  
  Clear p_stops when doing PT_DETACH and PROCFS_CTL_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.

Modified:
  stable/10/sys/fs/procfs/procfs_ctl.c
  stable/10/sys/kern/sys_process.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/procfs/procfs_ctl.c
==============================================================================
--- stable/10/sys/fs/procfs/procfs_ctl.c	Mon Jun 15 15:34:20 2015	(r284417)
+++ stable/10/sys/fs/procfs/procfs_ctl.c	Mon Jun 15 18:16:23 2015	(r284418)
@@ -235,6 +235,7 @@ out:
 		} else
 			PROC_LOCK(p);
 		p->p_oppid = 0;
+		p->p_stops = 0;
 		p->p_flag &= ~P_WAITED;	/* XXX ? */
 		sx_xunlock(&proctree_lock);
 

Modified: stable/10/sys/kern/sys_process.c
==============================================================================
--- stable/10/sys/kern/sys_process.c	Mon Jun 15 15:34:20 2015	(r284417)
+++ stable/10/sys/kern/sys_process.c	Mon Jun 15 18:16:23 2015	(r284418)
@@ -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?201506151816.t5FIGNlC088427>