From owner-freebsd-current@FreeBSD.ORG Thu Sep 18 19:22:48 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7383106566B for ; Thu, 18 Sep 2008 19:22:48 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.freebsd.org (Postfix) with ESMTP id 5F55A8FC08 for ; Thu, 18 Sep 2008 19:22:42 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: by nf-out-0910.google.com with SMTP id h3so29002nfh.33 for ; Thu, 18 Sep 2008 12:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:organization:to:subject :date:user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=flGV7RpOwR1wig3gFZYC4dki4tSW17Rwmto6Lj5YWM0=; b=xCQMo6Gs8HyT6rIdk0tWt6sIjiVyRZul8h04Tnjb7c4Tkq0XLJOfLbUHz372bmkN+o +S1tWNylAYg0XV5T7bQM1nHnY/NLBkCSV5I5sYOIpqiYiK7EGXCX5afs8b7cIrc9DGpg lIJWdiEbcrRVyCwRwgHM4aTB+uDrL5oOALF3I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; b=ZclW3phXmTDIjjNkLQWaYu3/0XQ0Heo0bKoVj/zsE7nhyf8cbl+IwDQCMVfprMbxOZ mrLfljdF5nqzR3aJ0kCmCu/0ZXs5c4sOKd4FFTCJQVYlVzeLVeNHI6BvnDReRLcsDqsz I7Fy7x3q7HZvF/OpEIg8nuS80H25gk1rpRWTk= Received: by 10.210.119.16 with SMTP id r16mr5431075ebc.24.1221765761802; Thu, 18 Sep 2008 12:22:41 -0700 (PDT) Received: from ?0.0.0.0? ( [196.34.241.123]) by mx.google.com with ESMTPS id j8sm8563832gvb.1.2008.09.18.12.22.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 18 Sep 2008 12:22:39 -0700 (PDT) From: David Naylor Organization: Private To: Julian Elischer Date: Thu, 18 Sep 2008 21:22:04 +0200 User-Agent: KMail/1.9.7 References: <200809180631.47071.naylor.b.david@gmail.com> <48D2807A.1050106@elischer.org> In-Reply-To: <48D2807A.1050106@elischer.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7296846.maSOvWPULo"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200809182122.08221.naylor.b.david@gmail.com> X-Mailman-Approved-At: Thu, 18 Sep 2008 19:45:09 +0000 Cc: freebsd-current@freebsd.org Subject: Re: FreeBSD deadlock (with fork?) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 19:22:49 -0000 --nextPart7296846.maSOvWPULo Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 18 September 2008 18:23:22 you wrote: > David Naylor wrote: > > Hi, > > > > I have a program that spawns a lot of subprocesses (with pipes open) fr= om > > multiple threads. The problem is the program often deadlocks, but not > > consistently. Sometimes the program can run over 5 times to competition > > without incidence and yet othertimes it locks within a few seconds. > > you sent this to -current. Is it in -current? (we fixed something like > this some months back in current and 7) =2Dcurrent cvsuped about Tuesday. =20 > do your post-fork processes do an exec? according to the spec they > should. Yes, they do. See the other replies... > if any of your threads other than the one that did the fork ho;ds any > mutex at teh time of fork then your process will hang. If they hold a > umtx (between processes) then everything will hang. Yes, the system does make use of mutexes. The forking thread never holds a= =20 mutex but other threads could hold a mutex. This would explain the problem= =2E =20 Is there any way to get around it (i.e. make sure no mutexes are held when = a=20 fork is called?) --nextPart7296846.maSOvWPULo Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBI0qpgUaaFgP9pFrIRAljRAJ4yB8YgGU5m4DcNCr0mt5GVX1mmuACfTPPo phWECfLkfwuS8eaW/LqLsP8= =1pKp -----END PGP SIGNATURE----- --nextPart7296846.maSOvWPULo--