From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 21 14:50:30 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87D6416A41C for ; Tue, 21 Jun 2005 14:50:30 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3144543D1F for ; Tue, 21 Jun 2005 14:50:30 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by zproxy.gmail.com with SMTP id 12so1005260nzp for ; Tue, 21 Jun 2005 07:50:29 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=q5RNsbXVeRu1Dy78k9sGjJaQwuQcTsoyyIirUi1AEEjIEjIr+/CgmWkjfnKMhP0vVvPDej2XRw4EqsPOhYo5iFKb/S5WcbTz9K8ftKyIuBAVPZBIKMcgSgCUsU9YO6yEk/9zJ1t+hWAM7PK9L/99uLd7NNHoa/hlvKh1OndZAHc= Received: by 10.36.59.12 with SMTP id h12mr1924246nza; Tue, 21 Jun 2005 07:50:29 -0700 (PDT) Received: by 10.36.68.15 with HTTP; Tue, 21 Jun 2005 07:50:29 -0700 (PDT) Message-ID: <34cb7c840506210750f7458cf@mail.gmail.com> Date: Tue, 21 Jun 2005 15:50:29 +0100 From: Peter Edwards To: Charles Sprickman In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Mailman-Approved-At: Wed, 22 Jun 2005 11:46:38 +0000 Cc: hackers@freebsd.org Subject: Re: Nagios and threads X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Edwards List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2005 14:50:30 -0000 On 6/20/05, Charles Sprickman wrote: > Hello, >=20 > Just curious if there's any regulars here who would like to help Ethan > out: >=20 [snip] >=20 > ... It happens when the main thread forks to execute an active > check. On the second fork to create the grandchild, the grandchild is > created by fork, but never returns from liblthread's fork wrapper, becaus= e > it's stuck in __pthread_acquire(). Maybe some FreeBSD users can help out > with this problem." >=20 IIRC, doing any significant work in a forked child of a multithreaded process is somewhat ill defined. From SusV3's description of "fork()" > ... Consequently, to avoid errors, the child process may only execute=20 > async-signal-safe operations until such time as one of the exec > functions is called. (This behaviour would extend to a grandchild.) A comment in libpthread/thr_kern.c refers to this, so I think there's at least some assumptions that the child won't be doing much before execing or exiting. (But Im sure one of the implementors will pipe up if I'm wrong :-))