This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with __malloc_hooks :-(


>>>>> Wolfram Gloger writes:

 > Hello,
>> gromit:/tmp:[0]$ ./malloc 
>> (nil)
>> gromit:/tmp:[0]$ ./malloc 1
>> 0x8049670

 > I can't reproduce this with libc-2.1.2 (as you probably expected);
 > anyway:

Try it with the current CVS version of 2.1.3.

>> [1]  XEmacs set __malloc_hook as one of its first instructions.

 > Ah, I think I see, __malloc_hook is now set too _early_ ?  Not a
 > single malloc() call has happened before main() (quite surprising) ?

That seems to be the problem.

 > Maybe I'm still missing something, but if the problem is that
 > __malloc_hook is assigned to at the wrong time, then maybe XEmacs
 > should use __malloc_initialize_hook() (rather than main()) to assign
 > the hooks just like GNU Emacs does now ?

I've got a patch for XEmacs already (not setting __malloc_hook at
all).  Nevertheless the simple program I sent shows IMO a bug in
glibc.

We really need a way to initialize malloc at the beginning but using
__malloc_hook is IMHO the wrong approach.

Andreas
-- 
 Andreas Jaeger   
  SuSE Labs aj@suse.de	
   private aj@arthur.rhein-neckar.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]