Date: Thu, 8 Jan 2009 22:10:38 -0600 From: Dan Nelson <dnelson@allantgroup.com> To: Daniel Eischen <eischen@vigrid.com> Cc: hackers@freebsd.org, jasone@freebsd.org Subject: Re: threaded, forked, rethreaded processes will deadlock Message-ID: <20090109041038.GA52729@dan.emsphone.com> In-Reply-To: <Pine.GSO.4.64.0901082237001.28531@sea.ntplx.net> References: <20090109031942.GA2825@green.homeunix.org> <Pine.GSO.4.64.0901082237001.28531@sea.ntplx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jan 08), Daniel Eischen said: > 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 section of the pthread_atfork() page is a good read here, too. -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090109041038.GA52729>