From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 16:41:03 2005 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC5B516A41F; Mon, 24 Oct 2005 16:41:03 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AD2743D45; Mon, 24 Oct 2005 16:41:03 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id j9OGf1FZ019676; Mon, 24 Oct 2005 12:41:02 -0400 (EDT) Date: Mon, 24 Oct 2005 12:41:01 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Sven Berkvens-Matthijsse In-Reply-To: <20051024144529.GP22568@ilse.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: Marc Olzheim , Marc Olzheim , David Xu , freebsd-threads@freebsd.org Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2005 16:41:04 -0000 On Mon, 24 Oct 2005, Sven Berkvens-Matthijsse wrote: > > It may even be enough just to set __isthreaded to 0 in the child > > after the fork() before calling any malloc()'s and free()'s so they > > don't try to use the lock. > > But then the free() in the child process may be using an unstable > state of the malloc system (because if you don't acquire the lock > before the fork(), malloc() may be busy in the middle of the fork()). I don't think that can happen because libc_r will not switch out a thread that is in a critical region (and libc locks are critical regions) until it leaves the region. -- DE