malloc: bug or feature ?

Georges-Andre Silber silber at cri.ensmp.fr
Wed Apr 7 06:06:23 PDT 2004


Marc Olzheim wrote:
> On Wed, Apr 07, 2004 at 02:39:53PM +0200, Georges-Andre Silber wrote:
> 
>>Is it a 'normal' behaviour of malloc()? Shouldn't malloc() return NULL?
> 
> 
> It should return NULL indeed. I can reproduce this on my -CURRENT
> machine, while 5.2.1-RELEASE is ok.
> 
> Marc

In my case, the bug was already there with 5.2.1-RELEASE. Strange...

I haven't figure out why malloc() calls ldexp(). I took a look at the 
code in /usr/src/lib/libc/stdlib/malloc.c but I don't think that the 
right place to look for malloc() code, it does not correspond to the 
backtrace given by gdb...

Georges.



More information about the freebsd-amd64 mailing list