Print this page
OS-5373 lx_proc panic while reading /proc/<pid>/exe link
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
OS-3820 lxbrand ptrace(2): the next generation
OS-3685 lxbrand PTRACE_O_TRACEFORK race condition
OS-3834 lxbrand 64-bit strace(1) reports 64-bit process as using x32 ABI
OS-3794 lxbrand panic on init signal death
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Bryan Cantrill <bryan@joyent.com>

@@ -19,11 +19,11 @@
  * CDDL HEADER END
  */
 
 /*
  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
+ * Copyright 2016, Joyent, Inc.
  */
 
 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
 /*        All Rights Reserved   */
 

@@ -199,10 +199,11 @@
                                 break;
                         case PR_SYSENTRY:
                         case PR_SYSEXIT:
                         case PR_SIGNALLED:
                         case PR_FAULTED:
+                        case PR_BRAND:
                                 /*
                                  * Make an lwp calling exit() be the
                                  * last lwp seen in the process.
                                  */
                                 if (t_istop == NULL ||

@@ -532,10 +533,16 @@
                         pcp->prc_datamodel = model;
                         pcp->prc_tid = tid;
                         pcp->prc_tslot = tslot;
                 }
         }
+
+        /*
+         * There may be threads waiting for the flag change blocked behind the
+         * pr_pid_cv as well.
+         */
+        cv_signal(&pr_pid_cv[p->p_slot]);
 }
 
 /*
  * Called from a hook in relvm() just before freeing the address space.
  * We free all the watched areas now.