Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 2009 00:19:56 +0900
From:      Takahiro Kurosawa <takahiro.kurosawa@gmail.com>
To:        "Arno J. Klaassen" <arno@heho.snv.jussieu.fr>
Cc:        freebsd-bugs@freebsd.org
Subject:   Re: kern/131506: pipes in forked procs sometimes hang under Linux  emulation 2.6.16
Message-ID:  <b72f377d0902170719v48fdfd16k4bc1f22c1cff8f3b@mail.gmail.com>
In-Reply-To: <200902081700.n18H0EvJ046014@freefall.freebsd.org>
References:  <200902081700.n18H0EvJ046014@freefall.freebsd.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
It seems that vfork/exec synchronization was changed recently
but the linux emulation code keeps using the obsolete mechanism.

The attached patch may fix the problem.

[-- Attachment #2 --]
=== sys/amd64/linux32/linux32_machdep.c
==================================================================
--- sys/amd64/linux32/linux32_machdep.c	(revision 188741)
+++ sys/amd64/linux32/linux32_machdep.c	(local)
@@ -560,7 +560,7 @@
 	/* wait for the children to exit, ie. emulate vfork */
 	PROC_LOCK(p2);
 	while (p2->p_flag & P_PPWAIT)
-	   	msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+		cv_wait(&p2->p_pwait, &p2->p_mtx);
 	PROC_UNLOCK(p2);
 
 	return (0);
@@ -749,7 +749,7 @@
 		/* wait for the children to exit, ie. emulate vfork */
 		PROC_LOCK(p2);
 		while (p2->p_flag & P_PPWAIT)
-			msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+			cv_wait(&p2->p_pwait, &p2->p_mtx);
 		PROC_UNLOCK(p2);
 	}
 
=== sys/i386/linux/linux_machdep.c
==================================================================
--- sys/i386/linux/linux_machdep.c	(revision 188741)
+++ sys/i386/linux/linux_machdep.c	(local)
@@ -376,7 +376,7 @@
 	/* wait for the children to exit, ie. emulate vfork */
 	PROC_LOCK(p2);
 	while (p2->p_flag & P_PPWAIT)
-	   	msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+		cv_wait(&p2->p_pwait, &p2->p_mtx);
 	PROC_UNLOCK(p2);
 
 	return (0);
@@ -581,7 +581,7 @@
    	   	/* wait for the children to exit, ie. emulate vfork */
    	   	PROC_LOCK(p2);
 		while (p2->p_flag & P_PPWAIT)
-   		   	msleep(td->td_proc, &p2->p_mtx, PWAIT, "ppwait", 0);
+			cv_wait(&p2->p_pwait, &p2->p_mtx);
 		PROC_UNLOCK(p2);
 	}
 
help

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