bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glibc bug with malloc_stats


From: Ulrich Drepper
Subject: Re: glibc bug with malloc_stats
Date: Thu, 01 May 2003 00:37:58 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030430

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

GOTO Masanori wrote:

> This is caused because malloc_arena->next is NULL.  The below patch
> fixes the problem (Another fix is to initialize next as &main_arena).
> Is it OK, Wolfram?

Neither is correct.  We have to call ptmalloc_init if it hasn't happened
yet.  The reason is that all kinds of other objects also have to be
initialized.  Most prominently the locks.  Incorrectly (or not at all)
initialized locks lead to hangs.  I guess that with nptl on x86 you'd
see the call hang with your patch.

I've added the code to optionally initialize the malloc code.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+sM7W2ijCOnn/RHQRAon8AKDD2nRPVPjoO/CPSAEXUhubBWUv9QCeLWqe
uzrI5jCaOWYDHHLFNNLMNxo=
=xXEt
-----END PGP SIGNATURE-----





reply via email to

[Prev in Thread] Current Thread [Next in Thread]