【发布时间】:2012-06-12 12:51:10
【问题描述】:
我收到了关于 valgrind 的最后“完成”消息,并获得了这份退出报告:
==3434== HEAP SUMMARY:
==3434== in use at exit: 8,432 bytes in 4 blocks
==3434== total heap usage: 4,369 allocs, 8,037 frees, 377,356 bytes allocated
==3434==
==3434== LEAK SUMMARY:
==3434== definitely lost: 152 bytes in 1 blocks
==3434== indirectly lost: 0 bytes in 0 blocks
==3434== possibly lost: 0 bytes in 0 blocks
==3434== still reachable: 8,192 bytes in 2 blocks
==3434== suppressed: 88 bytes in 1 blocks
==3434== Rerun with --leak-check=full to see details of leaked memory
==3434==
==3434== For counts of detected and suppressed errors, rerun with: -v
==3434== ERROR SUMMARY: 100190 errors from 140 contexts (suppressed: 0 from 0)
但是当我在没有 valgrind 的情况下运行它时,它会立即出现段错误。 valgrind 是否抑制了我应该寻找的某种错误?我在网上找不到任何有关此的信息
【问题讨论】:
-
valgrind 输出中是否存在“无效读取”或“无效写入”?
-
大量。那些肯定是坏的。
-
是的。他们的意思是你正在读或写不属于你的记忆。得把他们都修好。
-
我同意@DanielFischer。先修复所有的警告,很可能也能消除段错误。
标签: c segmentation-fault valgrind