From owner-freebsd-threads@FreeBSD.ORG Thu Jan 31 01:02:03 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 E14D016A46E for ; Thu, 31 Jan 2008 01:02:03 +0000 (UTC) (envelope-from landonf@bikemonkey.org) Received: from secure.bikemonkey.org (bluefish.bikemonkey.org [69.80.211.101]) by mx1.freebsd.org (Postfix) with ESMTP id BE48E13C442 for ; Thu, 31 Jan 2008 01:02:03 +0000 (UTC) (envelope-from landonf@bikemonkey.org) Received: from [192.168.54.11] (unknown [192.168.54.11]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by secure.bikemonkey.org (Postfix) with ESMTP id 17AA51703C; Wed, 30 Jan 2008 17:02:02 -0800 (PST) In-Reply-To: References: <200801240850.m0O8o2JQ023500@freefall.freebsd.org> <4798564B.7070500@elischer.org> <488DBC6A-CF33-4E50-B1BB-C396C8957F92@bikemonkey.org> <892A73B3-0114-4718-ABC0-CADD45D9D0FA@bikemonkey.org> <47A0D2DE.9060005@elischer.org> Mime-Version: 1.0 (Apple Message framework v753) Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-18-95820135" Message-Id: <35535E7A-0804-4DAD-B0A0-CCF9EE7060B0@bikemonkey.org> Content-Transfer-Encoding: 7bit From: Landon Fuller Date: Wed, 30 Jan 2008 17:01:59 -0800 To: Daniel Eischen X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.753) Cc: Julian Elischer , 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, 31 Jan 2008 01:02:04 -0000 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--