Author: markj
Date: Fri Sep 11 03:06:34 2015
New Revision: 287642
URL: https://svnweb.freebsd.org/changeset/base/287642

Log:
  MFV r283513:
  5930 fasttrap_pid_enable() panics when prfind() fails in forking process
  Reviewed by: Adam Leventhal <[email protected]>
  Reviewed by: Gordon Ross <[email protected]>
  Approved by: Richard Lowe <[email protected]>
  Author: Bryan Cantrill <[email protected]>
  
  illumos/illumos-gate@9df7e4e12eb093557252d3bec029b5c382613e36

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c      Fri Sep 
11 03:04:24 2015        (r287641)
+++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c      Fri Sep 
11 03:06:34 2015        (r287642)
@@ -29,7 +29,7 @@
  */
 
 /*
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright (c) 2015, Joyent, Inc. All rights reserved.
  */
 
 #include <sys/atomic.h>
@@ -1190,11 +1190,21 @@ fasttrap_pid_enable(void *arg, dtrace_id
                mutex_enter(&pidlock);
                p = prfind(probe->ftp_pid);
 
+               if (p == NULL) {
+                       /*
+                        * So it's not that the target process is being born,
+                        * it's that it isn't there at all (and we simply
+                        * happen to be forking).  Anyway, we know that the
+                        * target is definitely gone, so bail out.
+                        */
+                       mutex_exit(&pidlock);
+                       return (0);
+               }
+
                /*
                 * Confirm that curproc is indeed forking the process in which
                 * we're trying to enable probes.
                 */
-               ASSERT(p != NULL);
                ASSERT(p->p_parent == curproc);
                ASSERT(p->p_stat == SIDL);
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to