I've noticed that dmalloc will be able to report mallocs made by
internal glibc functions. (In particular, calls like setprotoent()).
glibc does free them, as I can see in their source code, they make
use of some sort of text segment __libc_subfreeres. However, I get
the impression that this happens all of dmalloc's exit calls. So
dmalloc thinks it's unfree'd memory.
Does anyone know how I can get around this? Perhaps a call to glibc
that will force it to run all it's deallocate functions? I tried
calling __libc_freeres() right before program exit, but that had no
effect. It makes it somewhat difficult to be sure that you write
programs that are free of memory leaks when you see this
misrepresented not-free pointers.
Thanks.
I'm using glibc-2.2.5 on linux 2.4.18, btw.