-1

我正在运行 valgrind/memcheck,试图识别导致无法解释的分段错误的潜在内存泄漏。

日志显示???而不是方法名,所以调用堆栈是没用的。所有代码(库和可执行文件)都使用调试信息进行编译。

例子:

==123100== Conditional jump or move depends on uninitialised value(s)
==123100==    at 0xA7DBD9E: ??? (in /proj/systemc/2.3.2/gcc9.1/lib64/libsystemc-2.3.2.so)
==123100==    by 0xE6E9BE: ??? (in /proj/users/ae/mxx/build/Debug/bin/mxx)
==123100==    by 0xE6DA8E: ??? (in /proj/users/ae/mxx/build/Debug/bin/mxx)
==123100==    by 0x187B22CF: ???
==123100==    by 0x7FEFD40CF: ???
==123100==    by 0xA802BBF: ??? (in /proj/systemc/2.3.2/gcc9.1/lib64/libsystemc-2.3.2.so)
==123100==    by 0xE6C649: ??? (in /proj/users/ae/mxx/build/Debug/bin/mxx)
==123100==    by 0x1893E1A7: ???
==123100==    by 0x187B1E5F: ???
==123100==    by 0x1101: ???
==123100==    by 0x2FBD: ???
==123100==    by 0x1E51001F: ???

valgrind 命令是:

valgrind/3.7.0/bin/valgrind --tool=memcheck -q --log-file=/proj/users/ae/valgrind.txt --trace-children=no --child-silent-after-fork=yes --run-libc-freeres=yes --demangle=yes --num-callers=12 --error-limit=no --show-below-main=no --max-stackframe=2000000 --fullpath-after= --leak-check=yes --show-reachable=no --leak-resolution=high --freelist-vol=10000000 --workaround-gcc296-bugs=no --partial-loads-ok=no --undef-值错误=是 /proj/users/ae/mxx/build/Debug/bin/mxx

谢谢

4

1 回答 1

0
  1. 获取更新版本的 Valgrind。3.7.0 已经很老了。
  2. 严格修剪您正在使用的选项。让工具正常工作,然后考虑添加选项。此外,对于以下
  • --tool=memcheck

  • --trace-children=否

  • --run-libc-freeres=是

  • --demangle=是

  • --show-below-main=no

  • --workaround-gcc296-bugs=否

  • --undef-value-errors=是

    您正在冗余地指定默认值。(或者至少是当前 [3.16.1 在撰写本文时] Valgrind 的默认值)。

于 2020-08-26T12:41:12.197 回答