changeset 3828:ab5910e1f24a

6533431 assertion failed: code == 119 || code == 142, file: ../../intel/ia32/os/syscall.c, line: 607
author raf
date Thu, 15 Mar 2007 14:07:33 -0700
parents d6ed80ac20be
children b969fce2e86f
files usr/src/uts/common/os/fork.c usr/src/uts/common/sys/proc.h usr/src/uts/common/sys/thread.h usr/src/uts/intel/ia32/os/syscall.c usr/src/uts/sparc/os/syscall.c
diffstat 5 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/os/fork.c	Thu Mar 15 13:48:10 2007 -0700
+++ b/usr/src/uts/common/os/fork.c	Thu Mar 15 14:07:33 2007 -0700
@@ -560,7 +560,8 @@
 	if (isvfork) {
 		CPU_STATS_ADDQ(CPU, sys, sysvfork, 1);
 		mutex_enter(&p->p_lock);
-		p->p_flag |= (SVFPARENT | SVFWAIT);
+		p->p_flag |= SVFWAIT;
+		curthread->t_flag |= T_VFPARENT;
 		DTRACE_PROC1(create, proc_t *, cp);
 		cv_broadcast(&pr_pid_cv[p->p_slot]);	/* inform /proc */
 		mutex_exit(&p->p_lock);
@@ -1352,7 +1353,6 @@
 
 	mutex_enter(&pp->p_lock);
 	prbarrier(pp);	/* barrier against /proc locking */
-	pp->p_flag &= ~SVFPARENT;
 	continuelwps(pp);
 	mutex_exit(&pp->p_lock);
 }
--- a/usr/src/uts/common/sys/proc.h	Thu Mar 15 13:48:10 2007 -0700
+++ b/usr/src/uts/common/sys/proc.h	Thu Mar 15 14:07:33 2007 -0700
@@ -474,7 +474,6 @@
 #define	SVFWAIT	   0x00080000	/* parent of vfork waiting for child to exec */
 #define	SEXITLWPS  0x00100000	/* have lwps exit within the process */
 #define	SHOLDFORK  0x00200000	/* hold lwps where they're cloneable */
-#define	SVFPARENT  0x00400000	/* parent of vfork, must call vfwait() */
 #define	SHOLDFORK1 0x00800000	/* hold lwps in place (not cloning) */
 #define	SCOREDUMP  0x01000000	/* process is dumping core */
 #define	SMSACCT    0x02000000	/* process is keeping micro-state accounting */
--- a/usr/src/uts/common/sys/thread.h	Thu Mar 15 13:48:10 2007 -0700
+++ b/usr/src/uts/common/sys/thread.h	Thu Mar 15 14:07:33 2007 -0700
@@ -18,6 +18,7 @@
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
@@ -363,6 +364,7 @@
 #define	T_PANIC		0x0800	/* thread initiated a system panic */
 #define	T_DFLTSTK	0x1000	/* stack is default size */
 #define	T_CAPTURING	0x2000	/* thread is in page capture logic */
+#define	T_VFPARENT	0x4000	/* thread is vfork parent, must call vfwait */
 
 /*
  * Flags in t_proc_flag.
--- a/usr/src/uts/intel/ia32/os/syscall.c	Thu Mar 15 13:48:10 2007 -0700
+++ b/usr/src/uts/intel/ia32/os/syscall.c	Thu Mar 15 14:07:33 2007 -0700
@@ -603,10 +603,11 @@
 	 * This code must be here and not in the bowels of the system
 	 * so that /proc can intercept exit from vfork in a timely way.
 	 */
-	if (p->p_flag & SVFPARENT) {
+	if (t->t_flag & T_VFPARENT) {
 		ASSERT(code == SYS_vfork || code == SYS_forksys);
 		ASSERT(rp->r_r1 == 0 && error == 0);
 		vfwait((pid_t)rval1);
+		t->t_flag &= ~T_VFPARENT;
 	}
 
 	/*
--- a/usr/src/uts/sparc/os/syscall.c	Thu Mar 15 13:48:10 2007 -0700
+++ b/usr/src/uts/sparc/os/syscall.c	Thu Mar 15 14:07:33 2007 -0700
@@ -708,10 +708,11 @@
 	 * This code must be here and not in the bowels of the system
 	 * so that /proc can intercept exit from vfork in a timely way.
 	 */
-	if (p->p_flag & SVFPARENT) {
+	if (t->t_flag & T_VFPARENT) {
 		ASSERT(code == SYS_vfork || code == SYS_forksys);
 		ASSERT(rp->r_o1 == 0 && error == 0);
 		vfwait((pid_t)rval1);
+		t->t_flag &= ~T_VFPARENT;
 	}
 
 	/*