Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Aug 2013 00:57:01 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254198 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace
Message-ID:  <201308110057.r7B0v1Ca067287@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Sun Aug 11 00:57:01 2013
New Revision: 254198
URL: http://svnweb.freebsd.org/changeset/base/254198

Log:
  fasttrap_fork(): unlock the processes before removing the tracepoints.
  
  In the future, we'll need to come up with new proc_*() functions that accept
  locked processes. For now, this prevents postgresql + DTrace from crashing the
  system.
  
  MFC after:	1 month

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Sat Aug 10 23:17:09 2013	(r254197)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c	Sun Aug 11 00:57:01 2013	(r254198)
@@ -502,7 +502,13 @@ fasttrap_fork(proc_t *p, proc_t *cp)
 	sprlock_proc(cp);
 	mtx_unlock_spin(&cp->p_slock);
 #else
+	/*
+	 * fasttrap_tracepoint_remove() expects the child process to be
+	 * unlocked and the VM then expects curproc to be unlocked.
+	 */
 	_PHOLD(cp);
+	PROC_UNLOCK(cp);
+	PROC_UNLOCK(p);
 #endif
 
 	/*
@@ -537,6 +543,8 @@ fasttrap_fork(proc_t *p, proc_t *cp)
 	mutex_enter(&cp->p_lock);
 	sprunlock(cp);
 #else
+	PROC_LOCK(p);
+	PROC_LOCK(cp);
 	_PRELE(cp);
 #endif
 }



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