threads/119920: fork broken in libpthread

Landon Fuller landonf at bikemonkey.org
Wed Jan 30 17:02:04 PST 2008


On Jan 30, 2008, at 14:09, Daniel Eischen wrote:

> On Wed, 30 Jan 2008, Julian Elischer wrote:
>
>> Landon Fuller wrote:
>>> Is my assumption that kse_critical_enter() prevents any other  
>>> code from being run during the critical section incorrect?
>>
>> My understanding (not being a userland expert) is that
>> critical-enter sets a flag in the thread's mailbox telling the
>> kernel that no matter what happens, it must not allow another
>> thread to pre-empt this one. This means that any system call
>> (or page fault or whatever) will be handled synchronously. if
>> it blocks, that schedulable entity will block and no upcall
>> will be made to schedule another thread.
>>
>> It does not in any way however ensure that any other thread  
>> changes its behaviour.
>> Dan, is my understanding correct?
>
> Right, it doesn't prevent another KSE from getting an upcall
> and doing things to threads.
>
> The problem seems to be in src/libpthread/sys/lock.c.
> See the patch here:
>
>   http://people.freebsd.org/~deischen/kse/libpthread.6.diffs
>
> It is an attempt to merge in all of HEAD to 6.x.  I can't
> test it, but it compiles.  You at least want the part of
> the patchset that patches sys/lock.c (along with the previous
> patch I posted which is also included in the patchset).

Thanks -- pulling in relevant change from sys/lock.c -- plus your  
previous patch -- solves my reproduction case:
	http://landonf.bikemonkey.org/static/code/freebsd/patch-libpthread63- 
fork

-landonf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-threads/attachments/20080131/06fb4709/PGP.pgp


More information about the freebsd-threads mailing list