This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: glibc 2.3 fork() on i386-gnu crashes if malloc is overridden
- From: Marcus Brinkmann <Marcus dot Brinkmann at ruhr-uni-bochum dot de>
- To: Wolfram Gloger <Wolfram dot Gloger at dent dot med dot uni-muenchen dot de>
- Cc: roland at gnu dot org, libc-alpha at sources dot redhat dot com
- Date: Mon, 18 Nov 2002 14:35:51 +0100
- Subject: Re: glibc 2.3 fork() on i386-gnu crashes if malloc is overridden
- References: <20021118112236.GI1369@212.23.136.22> <200211181241.NAA07373@max.zk-i.med.uni-muenchen.de>
On Mon, Nov 18, 2002 at 01:41:49PM +0100, Wolfram Gloger wrote:
> > So, either ptmalloc_init must always be called for us, or the fork hook
> > code needs to be made robust not to fail if malloc wasn't initialized,
>
> I opted for this solution, see below.
I tried your patch, and it works, thanks a lot!
> > the hook functions shouldn't be registered if ptmalloc_init wasn't called,
> > or another solution I can't think of.
>
> It would be best if the atfork hooks wouldn't be registered at all if
> a non-glibc malloc was in use, just like it is on anything but Hurd.
> But I suspect this is impossible.
Roland should know. I don't know if it is feasible, it seems to me that currently
the hooks are defined at link time, rather than run time.
I originally thought that a program using linuxthreads and overriding malloc
would show the same problem, but I didn't bother to try hard. A simple test
with preloading libpthread when running bash didn't provoke it.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' GNU http://www.gnu.org marcus@gnu.org
Marcus Brinkmann The Hurd http://www.gnu.org/software/hurd/
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de/