|
From: Stephane H. <sho...@ni...> - 2007-06-12 23:39:50
|
I dont know if this is a known issue, a problem with our code, or an (up to now) unknown bug in valgrind. on a few projects we're working on that are using both threads and fibers, valgrind starts to spew tons of error of invalid access in the middle of allocated objects that has definitely not been freed, such as: ==22128== 6 errors in context 51 of 185: ==22128== Thread 1: ==22128== Invalid read of size 4 ==22128== at 0x4047C80: pthread_cond_signal@@GLIBC_2.3.2 (in /lib/libpthread-2.4.so) ==22128== by 0x8053D74: DriverProcess(LDI_PATCHER*, unsigned, unsigned) (patcher.cpp:820) ==22128== by 0x804C4EC: Main_Loop() (main_loop.cpp:59) ==22128== by 0x804C967: main (base_kernel.cpp:154) ==22128== Address 0x6F68D08 is 736 bytes inside a block of size 788 alloc'd ==22128== at 0x402192C: operator new[](unsigned) (vg_replace_malloc.c:195) ==22128== 7 errors in context 54 of 185: ==22128== Invalid read of size 4 ==22128== at 0x4498DF5: swapcontext (in /lib/libc-2.4.so) ==22128== Address 0x6F68F7C is 108 bytes inside a block of size 408 alloc'd ==22128== at 0x402192C: operator new[](unsigned) (vg_replace_malloc.c:195) ==22128== 7 errors in context 57 of 185: ==22128== Invalid read of size 4 ==22128== at 0x4498DEC: swapcontext (in /lib/libc-2.4.so) ==22128== Address 0x6F68F6C is 92 bytes inside a block of size 408 alloc'd ==22128== at 0x402192C: operator new[](unsigned) (vg_replace_malloc.c:195) ==22128== 33053 errors in context 184 of 185: ==22128== Invalid read of size 4 ==22128== at 0x804F289: ReadAnswerPacket(XML_Node&, Fiber*) (resource_relay.cpp:87) ==22128== Address 0x6F68F2C is 28 bytes inside a block of size 408 alloc'd ==22128== at 0x402192C: operator new[](unsigned) (vg_replace_malloc.c:195) etc... ==22128== IN SUMMARY: 171777 errors from 185 contexts (suppressed: 11 from 1) could it be that valgrind chokes on fibers implemented with swapcontext ? I tried with the latest version (valgrind-3.2.3) and an older one (valgrind-3.1.1) gcc (GCC) 4.1.0 Linux shockenhull 2.6.16.13-4-smp #1 SMP Wed May 3 04:53:23 UTC 2006 i686 athlon i386 GNU/Linux -- Stephane Hockenhull SSC-Studios.com |