Subject: Re: memleak in printf?
To: Piotr Meyer <email@example.com>
From: Aleksey Cheusov <firstname.lastname@example.org>
Date: 04/20/2006 00:51:08
> Recently I played with DUMA library - fork of well known Electric Fence
> lib (http://duma.sourceforge.net/). Now, I'm siuprised by small test:
> DUMA: ptr=0xbd715000 size=65536 alloced from UNKNOWN (use #include "duma.h")(0) not freed
> DUMA Aborting: DUMA_delFrame(): Found non free'd pointers.
> I tested longer program - simple cgetfirst/cgetnext parser and, without
> printf function, DUMA works well... Any ideas?
> PS. I made test on Linux (Ubuntu 5.10 with kernel 2.6.12) without any
1) You run your test under glibc-based Linux and therefore your
question relates to GNU libc.
2) Some libc functions may, for example, allocate memory once
at the time of first call (and realloc this pointer when necessary)
and do not explicitely free allocated memory.
There is nothing curious here. One of the reason for this is
that many standard functions are not reentrant.
Best regards, Aleksey Cheusov.