From: Alex I. <ale...@in...> - 2003-05-29 21:57:06
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> Hi all, <p>I hope someone could give me a hand here - Valgrind is reporting mismatched free/delete operation in one of my classes, however I am doing plain new and matching delete. Here is a snippet of the log: <p>==15083== Thread 24: <br>==15083== Mismatched free() / delete / delete [] <br>==15083== at 0x4015E62D: __builtin_delete (vg_clientfuncs.c:199) <br>==15083== by 0x4029059B: BTNode::~BTNode(void) (../src/BinTree.cpp:71) <br>==15083== by 0x459D3F69: SymTableEntry::~SymTableEntry(void) (../src/SymTable.cc:168) <br>... <br>==15083== Address 0x4480F42C is 0 bytes inside a block of size 120 alloc'd <br>==15083== at 0x4015E310: malloc (vg_clientfuncs.c:103) <br>==15083== by 0x459D9CAB: __builtin_new (../../gcc-2.95.3/gcc/cp/new1.cc:77) <br>==15083== by 0x459D3D8B: SymTable::Insert(char const *, int, int, int) (../src/SymTable.cc:96) <p>Now, as you can see the allocation is done by __builtin_new, and deallocation by __builtin_delete - no mismatch here. What is strange though is that __builtin_delete is intercepted by valgrind, whereas __builtin_new goes into compiler and valgrind sees only malloc from there. Quite naturally, it reports a mismatch in this case. Does anyone know a reason why this is happening and how to fix it ? <p>Thanks! <br>Alex <pre>-- Alex G. Ivershen Inet Technologies, Inc. Network Products Dept. 1500 N. Greenville Ave. Inet Technologies Inc. Richardson, TX 75081 Phone: +1-469-330-4295 USA "Black Holes are where God divided by zero"</pre> </html> |