我有一个巨大的二进制文件,文本部分大约需要876MB。我想检查内存泄漏。当我使用valgrind命令
valgrind --leak-check=yes /path/to/binary args
它给了我以下输出和退出。我是新手,不知道如何进一步解释这一点。有没有办法让valgrind使用我的二进制文件。
==45051== Warning: set address range perms: large range [0x400000, 0x34853000) (defined)
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
==45051== Warning: DWARF2 reader: Badly formed extended line op encountered
valgrind: m_debuginfo/storage.c:407 (vgModuleLocal_addLineInfo): Assertion 'lineno >= 0' failed.
==45051== at 0x38031DA7: report_and_quit (m_libcassert.c:235)
==45051== by 0x38031FE0: vgPlain_assert_fail (m_libcassert.c:309)
==45051== by 0x3806AAAF: vgModuleLocal_addLineInfo (storage.c:407)
==45051== by 0x380B67DE: vgModuleLocal_read_debuginfo_dwarf3 (readdwarf.c:770)
==45051== by 0x38063E17: vgModuleLocal_read_elf_debug_info (readelf.c:2696)
==45051== by 0x3805F0A1: vgPlain_di_notify_mmap (debuginfo.c:628)
==45051== by 0x3808533D: vgModuleLocal_generic_PRE_sys_mmap (syswrap-generic.c:2066)
==45051== by 0x380AA343: vgSysWrap_amd64_linux_sys_mmap_before (syswrap-amd64-linux.c:1012)
==45051== by 0x3807C0B4: vgPlain_client_syscall (syswrap-main.c:1464)
==45051== by 0x38078A4F: handle_syscall (scheduler.c:1057)
==45051== by 0x38079BE6: vgPlain_scheduler (scheduler.c:1335)
==45051== by 0x380A6419: run_a_thread_NORETURN (syswrap-linux.c:103)
sched status:
running_tid=1
Thread 1: status = VgTs_Runnable
==45051== at 0x3663097A: mmap (syscall-template.S:82)
==45051== by 0x36620939: _dl_map_object_from_fd (dl-load.c:1264)
==45051== by 0x36621661: _dl_map_object (dl-load.c:2290)
==45051== by 0x36625701: openaux (dl-deps.c:65)
==45051== by 0x366275E5: _dl_catch_error (dl-error.c:178)
==45051== by 0x36625DE4: _dl_map_object_deps (dl-deps.c:247)
==45051== by 0x3661C4C7: dl_main (rtld.c:1934)
==45051== by 0x3662F40D: _dl_sysdep_start (dl-sysdep.c:244)
==45051== by 0x3661A4D3: _dl_start (rtld.c:429)
==45051== by 0x36619B37: ??? (in /lib64/ld-2.12.so)
==45051== by 0x2: ???
==45051== by 0x7FF000386: ???
==45051== by 0x7FF0003C4: ???
==45051== by 0x7FF0003C7: ???
Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.
If that doesn't help, please report this bug to: www.valgrind.org
In the bug report, send all the above text, the valgrind
version, and what OS and version you are using. Thanks.
答案 0 :(得分:1)
您尚未指出正在使用的valgrind版本。 但是最近的valgrind版本已经改变了这样一个失败的断言 a'抱怨一次'警告。
因此,您应该升级到最新版本并重试。