Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jan 2008 17:42:58 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Landon Fuller <landonf@threerings.net>
Cc:        nate@yogotech.com, ivo@scito.com, Alfred Perlstein <alfred@freebsd.org>, Daniel Eischen <deischen@freebsd.org>, davidxu@freebsd.org, java@freebsd.org, julian@freebsd.org
Subject:   Re: cvs commit: src/lib/libkse/thread thr_kern.c
Message-ID:  <47900422.9050905@elischer.org>
In-Reply-To: <478FFF09.7020207@elischer.org>
References:  <200711301716.lAUHGEV1064334@repoman.freebsd.org> <wpprxrto0s.fsf@heho.snv.jussieu.fr> <Pine.GSO.4.64.0711301659060.5465@sea.ntplx.net> <wpwsrz9uyr.fsf@heho.snv.jussieu.fr> <Pine.GSO.4.64.0711301849310.6581@sea.ntplx.net> <wphcj2plsx.fsf@heho.snv.jussieu.fr> <Pine.GSO.4.64.0712011824130.11446@sea.ntplx.net> <wphcj1dmvz.fsf@heho.snv.jussieu.fr> <90584F61-91FE-446E-978E-FD234553E8FC@threerings.net> <478FFC91.4050508@elischer.org> <4E316E30-3A6B-4E58-A701-E85389BEC6EE@threerings.net> <478FFF09.7020207@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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?





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