This is the mail archive of the libc-help@sourceware.org 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]
Other format: [Raw text]

Realloc returns NULL


Is there any reason that realloc() could return NULL without running
out of memory on the system? My system memory is at 0.5GB out of 4GB
when it crashes, so it doesn't appear to be an out-of-memory error.
The requested realloc call is for 320K on a pointer that currently is
allocated for 160K. I am running a multi-threaded application, where
the failure occurs in a "worker" thread (not the main thread).
Valgrind does not come up with any memory errors. If I replace the
realloc with a malloc, memcpy, and free, the error does not appear. I
am using libc version 2.7 on Ubuntu, gcc version 4.2.4.

Thanks,
Jeff


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