|
From: Sergey V. <vs...@al...> - 2004-05-10 19:01:03
|
On Mon, 10 May 2004 11:39:18 -0300, Salvador Eduardo Tropea wrote: > Valgrind version: 2.1.1 and 2.0.0 (can't test CVS because it needs newer > autotools) > > Brief description: Valgrind hooks __builtin_delete but fails to hook > __builtin_new resulting in tons of wrong reports about "Mismatched > free() / delete / delete []". > > System: Debian GNU/Linux Woody, gcc 2.95.4 *important*: libgcc is an > static library for Woody. GNU libc 2.2.5. > > More info: > I get things like it: > ==32691== Mismatched free() / delete / delete [] > > ==32691== at 0x3C01A8DB: __builtin_delete (vg_replace_malloc.c:128) > > ==32691== by 0x3C0A2319: TStringCollection::~TStringCollection(void) > (../classes/tstringc.cc:65) > ==32691== by 0x80BB591: LoadTVMenuAndStatus(char *) > (../../tvision/include/tv/object.h:45) ==32691== by 0x80BB650: > LoadMenuAndStatus(char *, int) (../setedit/menuload.cc:1059) > ==32691== Address 0x3C65C06C is 0 bytes inside a block of size 44 > alloc'd > ==32691== at 0x3C01A2F5: malloc > (vg_replace_malloc.c:105) > > ==32691== by 0x80FF8F8: __builtin_new (in > /usr/src/setedit/makes/editor.exe) This is the problem. In valgrind-2.1.1 vg_replace_malloc.c:init() hooks calls to functions only in libc.so.6 and libstdc++*. Current CVS uses a different mechanism for this, but it also replaces the functions only in these specific libraries. Is your program linked with shared libstdc++ library? This should happen automatically if g++ (not gcc) is called for linking. |