Date: Thu, 08 Jan 2009 22:24:10 -0800 From: Tim Kientzle <kientzle@freebsd.org> To: Brian Fundakowski Feldman <green@freebsd.org> Cc: hackers@freebsd.org, jasone@freebsd.org Subject: Re: threaded, forked, rethreaded processes will deadlock Message-ID: <4966ED8A.4080307@freebsd.org> In-Reply-To: <20090109053117.GB2825@green.homeunix.org> References: <20090109031942.GA2825@green.homeunix.org> <Pine.GSO.4.64.0901082237001.28531@sea.ntplx.net> <20090109053117.GB2825@green.homeunix.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Brian Fundakowski Feldman wrote: > On Thu, Jan 08, 2009 at 10:44:20PM -0500, Daniel Eischen wrote: >>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. What version of FreeBSD? I've only glanced through the relevant code, but the malloc() implementation in -CURRENT certainly tries to claim all malloc locks before the fork and releases them all (in both child and parent) just after the fork, so the scenario you describe shouldn't happen. Of course, there may be other locks getting in the way. Tim
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4966ED8A.4080307>