我正在尝试使用CentOS上的valgrind来调试内存泄漏。但是,valgrind失败了。
当我运行时:
my_binary my_arguments
程序运行得很好,除了内存泄漏。
当我运行时:
valgrind --tool=memcheck --verbose --log-file=valgrind.log --leak-check=full my_binary my_arguments
valgrind立刻退出。当我这样跑的时候同上:
valgrind my_binary my_arguments
日志文件包含以下行:
--8594-- Reading syms from /usr/lib64/tls/libnvidia-tls.so.331.67 (0x3276200000)
--8594-- object doesn't have a symbol table
--8594-- Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode 0x2a
valgrind: m_debuginfo/readdwarf.c:2391 (copy_convert_CfiExpr_tree): Assertion 'srcix >= 0 && srcix < VG_(sizeXA)(srcxa)' failed.
==8594== at 0x3802D247: report_and_quit (m_libcassert.c:210)
==8594== by 0x3802D480: vgPlain_assert_fail (m_libcassert.c:284)
==8594== by 0x3809E8AF: copy_convert_CfiExpr_tree (readdwarf.c:2391)
==8594== by 0x3809EBF5: summarise_context (readdwarf.c:2134)
==8594== by 0x380A127D: run_CF_instructions (readdwarf.c:3654)
==8594== by 0x380A2E94: vgModuleLocal_read_callframe_info_dwarf3 (readdwarf.c:4192)
==8594== by 0x3805B09B: vgModuleLocal_read_elf_debug_info (readelf.c:2181)
==8594== by 0x38056461: vgPlain_di_notify_mmap (debuginfo.c:835)
==8594== by 0x38073C19: vgModuleLocal_generic_PRE_sys_mmap (syswrap-generic.c:2071)
==8594== by 0x38094D79: vgSysWrap_amd64_linux_sys_mmap_before (syswrap-amd64-linux.c:996)
==8594== by 0x3806A4D7: vgPlain_client_syscall (syswrap-main.c:1492)
==8594== by 0x38066F9D: handle_syscall (scheduler.c:900)
==8594== by 0x38067DF9: vgPlain_scheduler (scheduler.c:1096)
==8594== by 0x380913F4: run_a_thread_NORETURN (syswrap-linux.c:95)
这看起来像是valgrind中的一个错误。 Valgrind版本:valgrind-3.6.0。 你能否说一下可能引发这个错误的原因?我怎么能纠正这个问题并运行valgrind?