From owner-freebsd-hackers@FreeBSD.ORG Fri Jan 9 03:58:40 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF345106564A; Fri, 9 Jan 2009 03:58:40 +0000 (UTC) (envelope-from eischen@vigrid.com) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6B4878FC1C; Fri, 9 Jan 2009 03:58:40 +0000 (UTC) (envelope-from eischen@vigrid.com) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.3/8.14.3/NETPLEX) with ESMTP id n093iKDP001057; Thu, 8 Jan 2009 22:44:20 -0500 (EST) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.0 (mail.netplex.net [204.213.176.10]); Thu, 08 Jan 2009 22:44:20 -0500 (EST) Date: Thu, 8 Jan 2009 22:44:20 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Brian Fundakowski Feldman In-Reply-To: <20090109031942.GA2825@green.homeunix.org> Message-ID: References: <20090109031942.GA2825@green.homeunix.org> MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; boundary=VbJkn9YxBvnuCH5J Content-ID: Content-Disposition: inline Cc: hackers@freebsd.org, jasone@freebsd.org Subject: Re: threaded, forked, rethreaded processes will deadlock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2009 03:58:40 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --VbJkn9YxBvnuCH5J Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Content-ID: Content-Disposition: inline On Thu, 8 Jan 2009, Brian Fundakowski Feldman wrote: > It appears that the post-fork hooks for malloc(3) are somewhat broken such that > when a threaded program forks, and then its child attempts to go threaded, it > deadlocks because it already appears to have locks held. I am not familiar > enough with the current libthr/libc/rtld-elf interaction that I've been able > to fix it myself, unfortunately. There's really nothing to fix - according to POSIX you are only allowed to call async-signal-safe functions in the child forked from a threaded process. If you are trying to do anything other than that, it may or may not work on FreeBSD, but it is not guaranteed and is not portable. The rationale is that what is the point of forking and creating more threads, when you can just as easily create more threads in the parent without forking? The only reason to fork from a threaded process is to call one of the exec() functions. -- DE --VbJkn9YxBvnuCH5J Content-Type: TEXT/PLAIN; charset=us-ascii Content-ID: Content-Description: Content-Disposition: inline _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" --VbJkn9YxBvnuCH5J--