diff options
author | rpaulo <rpaulo@FreeBSD.org> | 2013-08-11 00:57:01 +0000 |
---|---|---|
committer | rpaulo <rpaulo@FreeBSD.org> | 2013-08-11 00:57:01 +0000 |
commit | 7257b4a872811b4c6e627b8ee5d5f83dfed5a7ea (patch) | |
tree | 94eef5bb2948dde5e31a854118d54ad617720463 | |
parent | 10427f9082e3a8df9b9618153e05f8b1e9a78071 (diff) | |
download | FreeBSD-src-7257b4a872811b4c6e627b8ee5d5f83dfed5a7ea.zip FreeBSD-src-7257b4a872811b4c6e627b8ee5d5f83dfed5a7ea.tar.gz |
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
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c index 5cf964d..fd5508f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c @@ -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 } |