|
From: Leon M. <max...@ya...> - 2004-12-01 22:14:44
|
Hello all, I am recently starting debuggin with valgrind on my current C program. My program has some memory allocation problem in it, namely, the program hang on certain position. I used gdb to trace the problem, and found it is : #0 0xb751613a in malloc_consolidate () from /lib/tls/libc.so.6 where the progam could not go further. Then i tried with valgrind, to my surprise, my program could go around with this memory problem and offers the result which i expected !!! could someone tell me why could this happen ??? Thank you very much Maxim __________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail |
|
From: Paul P. <ppl...@gm...> - 2004-12-03 03:46:21
|
On Wed, 1 Dec 2004 14:14:35 -0800 (PST), Leon Maxim <max...@ya...> wrote: > > I am recently starting debuggin with valgrind on my > current C program. My program has some memory > allocation problem in it, namely, the program hang on > certain position. I used gdb to trace the problem, and > found it is : > #0 0xb751613a in malloc_consolidate () from > /lib/tls/libc.so.6 > where the progam could not go further. That indicates some kind of heap corruption. > Then i tried with valgrind, to my surprise, my program > could go around with this memory problem and offers > the result which i expected !!! Did VG report any heap problems? If it did, fix them. If it didn't (which is highly unlikely), try to produce a minimal test case, so your problem can be found and VG can be fixed to find it. > could someone tell me why could this happen ??? VG uses guard zones around heap blocks, and does not allow "bad double free" to actually corrupt the heap; thus "fixing" the bug in your program. Cheers, |