|
From: Pascal G. <pas...@ax...> - 2003-08-20 12:13:57
|
Hi, I'm trying to found out how to correct the following type of trace: ==11318== 1 errors in context 1 of 4: ==11318== Invalid free() / delete / delete[] ==11318== at 0x400281C2: __builtin_vec_delete (vg_replace_malloc.c:252) ==11318== by 0x4026D371: HashTable::~HashTable(void) (/home/pg2/sourceware/rtsim/../devkit/devkit/DvkHash.cc:130) ==11318== by 0x40269FA2: __static_initialization_and_destruction_0 (/home/pg2/sourceware/rtsim/../devkit/devkit/CTypeX.cc:47) ==11318== by 0x4026A029: global destructors keyed to CTypeX::testFd (/home/pg2/sourceware/rtsim/../devkit/devkit/CTypeX.cc:47) ==11318== by 0x402644D2: (within /home/pg2/platforms/i686-pc-linux-gnu/debug.ecusim/lib/libdevkit.so.1.0.4) ==11318== by 0x4000A575: (within /lib/ld-2.1.3.so) ==11318== Address 0x4045A024 is not stack'd, malloc'd or free'd ==11318== ==11318== 1 errors in context 2 of 4: ==11318== Invalid free() / delete / delete[] ==11318== at 0x4002807E: free (vg_replace_malloc.c:220) ==11318== by 0x40264D4B: CString::~CString(void) (/home/pg2/sourceware/rtsim/../devkit/devkit/CString.cc:239) ==11318== by 0x40268409: __static_initialization_and_destruction_0 (/home/pg2/sourceware/rtsim/../devkit/devkit/CString.cc:58) ==11318== by 0x40268499: global destructors keyed to CString::catenate(char const *, int) (/home/pg2/sourceware/rtsim/../devkit/devkit/CString.cc:58) ==11318== by 0x402644D2: (within /home/pg2/platforms/i686-pc-linux-gnu/debug.ecusim/lib/libdevkit.so.1.0.4) ==11318== by 0x4000A575: (within /lib/ld-2.1.3.so) ==11318== Address 0x4045A1A0 is not stack'd, malloc'd or free'd ==11318== ==11318== 83 errors in context 3 of 4: ==11318== Invalid write of size 4 ==11318== at 0x4026D51E: HashTable::clear(void) (/home/pg2/sourceware/rtsim/../devkit/devkit/DvkHash.cc:176) ==11318== by 0x4026D35C: HashTable::~HashTable(void) (/home/pg2/sourceware/rtsim/../devkit/devkit/DvkHash.cc:129) ==11318== by 0x40269FA2: __static_initialization_and_destruction_0 (/home/pg2/sourceware/rtsim/../devkit/devkit/CTypeX.cc:47) ==11318== by 0x4026A029: global destructors keyed to CTypeX::testFd (/home/pg2/sourceware/rtsim/../devkit/devkit/CTypeX.cc:47) ==11318== by 0x402644D2: (within /home/pg2/platforms/i686-pc-linux-gnu/debug.ecusim/lib/libdevkit.so.1.0.4) ==11318== by 0x4000A575: (within /lib/ld-2.1.3.so) ==11318== Address 0x4045A024 is not stack'd, malloc'd or free'd ==11318== ==11318== 83 errors in context 4 of 4: ==11318== Invalid read of size 4 ==11318== at 0x4026D4DD: HashTable::clear(void) (/home/pg2/sourceware/rtsim/../devkit/devkit/DvkHash.cc:170) ==11318== by 0x4026D35C: HashTable::~HashTable(void) (/home/pg2/sourceware/rtsim/../devkit/devkit/DvkHash.cc:129) ==11318== by 0x40269FA2: __static_initialization_and_destruction_0 (/home/pg2/sourceware/rtsim/../devkit/devkit/CTypeX.cc:47) ==11318== by 0x4026A029: global destructors keyed to CTypeX::testFd (/home/pg2/sourceware/rtsim/../devkit/devkit/CTypeX.cc:47) ==11318== by 0x402644D2: (within /home/pg2/platforms/i686-pc-linux-gnu/debug.ecusim/lib/libdevkit.so.1.0.4) ==11318== by 0x4000A575: (within /lib/ld-2.1.3.so) ==11318== Address 0x4045A024 is not stack'd, malloc'd or free'd It concerns global destructors which are keyed to strange reference... It doesn't make my program terminate abnormally but I'm curious why Valgrind check it. Thanks. Bye. -- ============================================= GULA Pascal Ingénieur d'études chez AXLOG Ingénierie 19-21 rue du 8 mai 1945 94110 ARCUEIL Tel : 01.41.24.31.38 ============================================= |
|
From: Josef W. <Jos...@gm...> - 2003-08-23 10:52:25
|
Hi, On Wednesday 20 August 2003 14:07, Pascal GULA wrote: > Hi, > > I'm trying to found out how to correct the following type of trace: > > ==11318== 1 errors in context 1 of 4: > ==11318== Invalid free() / delete / delete[] > ==11318== at 0x400281C2: __builtin_vec_delete (vg_replace_malloc.c:252) > ==11318== by 0x4026D371: HashTable::~HashTable(void) > (/home/pg2/sourceware/rtsim/../devkit/devkit/DvkHash.cc:130) > ==11318== by 0x40269FA2: __static_initialization_and_destruction_0 > (/home/pg2/sourceware/rtsim/../devkit/devkit/CTypeX.cc:47) > ==11318== by 0x4026A029: global destructors keyed to CTypeX::testFd > (/home/pg2/sourceware/rtsim/../devkit/devkit/CTypeX.cc:47) > ==11318== by 0x402644D2: (within > /home/pg2/platforms/i686-pc-linux-gnu/debug.ecusim/lib/libdevkit.so.1.0.4) > ==11318== by 0x4000A575: (within /lib/ld-2.1.3.so) > ==11318== Address 0x4045A024 is not stack'd, malloc'd or free'd > [...] > > It concerns global destructors which are keyed to strange reference... > > It doesn't make my program terminate abnormally but I'm curious why > Valgrind check it. These errors are triggered by calls to destructors of static C++ objects, so this seems to happen at program termination, and of course can't influence your program while it's running. The call to the destructors is triggered after you return from main, and the "...keyed to..." symbols are generated by the C++ compiler. Still, you should fix it. It could lead to spurious SEGFAULTS at program termination, and that's confusing. You seem to delete objects in the destructors which have never been allocated? Greetings, Josef > > Thanks. > > Bye. |