From owner-freebsd-threads@FreeBSD.ORG Thu Jan 24 22:27:37 2008 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7521916A418; Thu, 24 Jan 2008 22:27:37 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 5F91A13C45D; Thu, 24 Jan 2008 22:27:37 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id EFCBF1A4D82; Thu, 24 Jan 2008 14:23:39 -0800 (PST) Date: Thu, 24 Jan 2008 14:23:39 -0800 From: Alfred Perlstein To: Julian Elischer Message-ID: <20080124222339.GT99258@elvis.mu.org> References: <200801240850.m0O8o2JQ023500@freefall.freebsd.org> <4798564B.7070500@elischer.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="L2Brqb15TUChFOBK" Content-Disposition: inline In-Reply-To: <4798564B.7070500@elischer.org> User-Agent: Mutt/1.4.2.3i Cc: Daniel Eischen , Gary Stanley , freebsd-threads@FreeBSD.org Subject: Re: threads/119920: fork broken in libpthread X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2008 22:27:37 -0000 --L2Brqb15TUChFOBK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Julian Elischer [080124 01:17] wrote: > Gary Stanley wrote: > >The following reply was made to PR threads/119920; it has been noted by > >GNATS. > > > >From: Gary Stanley > >To: bug-followup@FreeBSD.org > >Cc: > >Subject: Re: threads/119920: fork broken in libpthread > >Date: Thu, 24 Jan 2008 03:24:47 -0500 > > > > I also have this problem, see threads/118715 > > > > I was able to grab some ktrace info, but most of the time the process > > is stuck, and ktrace doesn't display any data. > > > >_______________________________________________ > >freebsd-threads@freebsd.org mailing list > >http://lists.freebsd.org/mailman/listinfo/freebsd-threads > >To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > > dan what IS the fix for this? I assume you must have fixed it in > -current/7 > > what was YOUR fix alfred? Attached. -- - Alfred Perlstein --L2Brqb15TUChFOBK Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="thr_fork.diff" Index: thr_fork.c =================================================================== RCS file: /home/ncvs/src/lib/libpthread/thread/Attic/thr_fork.c,v retrieving revision 1.35 diff -u -r1.35 thr_fork.c --- thr_fork.c 18 Dec 2004 18:07:37 -0000 1.35 +++ thr_fork.c 29 Oct 2007 05:25:32 -0000 @@ -93,7 +93,10 @@ if (_kse_isthreaded() != 0) { _spinlock(__malloc_lock); } - if ((ret = __sys_fork()) == 0) { + THR_SCHED_LOCK(curthread, curthread); + ret = __sys_fork(); + THR_SCHED_UNLOCK(curthread, curthread); + if (ret == 0) { /* Child process */ errsave = errno; --L2Brqb15TUChFOBK--