c ++发现内存泄漏

时间:2012-07-08 21:36:08

标签: c++ valgrind waf

我正试图用waf运行valgrind。命令是./waf --command-template =“valgrind%s” - 运行程序名。

我收到valgrind的内部错误。即使valgrind失败,我还能尝试什么?

--6446-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV) - exiting
--6446-- si_code=80;  Faulting address: 0x0;  sp: 0x40b3c9df0

valgrind: the 'impossible' happened:
   Killed by fatal signal
==6446==    at 0x38058236: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==6446==    by 0x38021ADC: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==6446==    by 0x38021CCD: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==6446==    by 0x380902A7: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==6446==    by 0x3809F7D5: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==6446==    by 0x3809FA5A: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==6446==    by 0x380BBEAD: ??? (in /usr/lib/valgrind/memcheck-amd64-linux)
==6446==    by 0xDEADBEEFDEADBEEE: ???
==6446==    by 0xDEADBEEFDEADBEEE: ???
==6446==    by 0xDEADBEEFDEADBEEE: ???

1 个答案:

答案 0 :(得分:-1)

我没有尝试过很长时间但你可以使用Boehm GC来检测C / C ++代码中的泄漏。

http://www.hboehm.info/gc/leak.html