Date: Wed, 30 Jan 2008 17:01:59 -0800 From: Landon Fuller <landonf@bikemonkey.org> To: Daniel Eischen <eischen@vigrid.com> Cc: Julian Elischer <julian@elischer.org>, freebsd-threads@freebsd.org Subject: Re: threads/119920: fork broken in libpthread Message-ID: <35535E7A-0804-4DAD-B0A0-CCF9EE7060B0@bikemonkey.org> In-Reply-To: <Pine.GSO.4.64.0801301706010.18132@sea.ntplx.net> References: <200801240850.m0O8o2JQ023500@freefall.freebsd.org> <4798564B.7070500@elischer.org> <Pine.GSO.4.64.0801240957550.16059@sea.ntplx.net> <488DBC6A-CF33-4E50-B1BB-C396C8957F92@bikemonkey.org> <Pine.GSO.4.64.0801291611130.12689@sea.ntplx.net> <892A73B3-0114-4718-ABC0-CADD45D9D0FA@bikemonkey.org> <Pine.GSO.4.64.0801292320260.15096@sea.ntplx.net> <D3DFD2DE-E6A3-4373-AC37-42C3CAB9B963@bikemonkey.org> <47A0D2DE.9060005@elischer.org> <Pine.GSO.4.64.0801301706010.18132@sea.ntplx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-18-95820135 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed 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 --Apple-Mail-18-95820135 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHoR4HlplZCE/15mMRAsNkAJsFHS3R4Ez3hjoIHe1XVjw3Cnv4FgCfV5uc wOp5FtITWAh/UVK/EED2zFg= =6xni -----END PGP SIGNATURE----- --Apple-Mail-18-95820135--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35535E7A-0804-4DAD-B0A0-CCF9EE7060B0>