From owner-freebsd-java@FreeBSD.ORG Fri Jan 18 01:43:02 2008 Return-Path: Delivered-To: java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA7D216A4C9 for ; Fri, 18 Jan 2008 01:43:02 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outS.internet-mail-service.net (outS.internet-mail-service.net [216.240.47.242]) by mx1.freebsd.org (Postfix) with ESMTP id 5025113C474 for ; Fri, 18 Jan 2008 01:43:02 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Thu, 17 Jan 2008 17:43:01 -0800 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id AB786126F66; Thu, 17 Jan 2008 17:43:00 -0800 (PST) Message-ID: <47900422.9050905@elischer.org> Date: Thu, 17 Jan 2008 17:42:58 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Landon Fuller References: <200711301716.lAUHGEV1064334@repoman.freebsd.org> <90584F61-91FE-446E-978E-FD234553E8FC@threerings.net> <478FFC91.4050508@elischer.org> <4E316E30-3A6B-4E58-A701-E85389BEC6EE@threerings.net> <478FFF09.7020207@elischer.org> In-Reply-To: <478FFF09.7020207@elischer.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: nate@yogotech.com, ivo@scito.com, Alfred Perlstein , Daniel Eischen , davidxu@freebsd.org, java@freebsd.org, julian@freebsd.org Subject: Re: cvs commit: src/lib/libkse/thread thr_kern.c X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2008 01:43:02 -0000 Julian Elischer wrote: > Landon Fuller wrote: >> >> On Jan 17, 2008, at 17:10, Julian Elischer wrote: >> >>> I gather it is the PARENT that hangs here? >>> >> >> Parent continues, the child hangs in fork(). > > no the child hangs in mutex_lock_common() > > please do a ktrace of the program and send that to me > Here's my guess as to what is happening: thos is not based on code.. thread 1 calls the dummy fork(3) thread 2 calls the dummy fork(3) thread 1 calls fork(2), (the syscall, from within the dummy fork) thread2 calls fork(2) (the real one in the kernel) thread 1 proceeds thread 2 blocks on a VM lock until thread 1 completes kernel duplicates the memory space thread 1 returns from fork(2) thread 1 takes out mutex X inside dummy fork(3) thread 2 proceeeds in the kernel on forking. kernel duplicates the memory space (including mutex X) thread 2 returns from kernel and looks for mutex X thread 2 in client tries to take out mutex X inside dummy fork(3) and waits. thread 1 releases mutex X thread 2 proceeeds ================================ in child1 thread1 runs fine. in child2 thread2 waits for thread 1 to drop the mutex (there is no thread1) the question is: what is the mutex being acquired AFTER forking? Dan?