【问题标题】:Why valgrind is killed during memory leak detection? [closed]为什么 valgrind 在内存泄漏检测期间被杀死? [关闭]
【发布时间】:2012-05-08 18:24:29
【问题描述】:
==1581== 
==1581== HEAP SUMMARY:
==1581==     in use at exit: 49,152 bytes in 3 blocks
==1581==   total heap usage: 4 allocs, 1 frees, 50,176 bytes allocated
==1581== 
==1581== LEAK SUMMARY:
==1581==    definitely lost: 0 bytes in 0 blocks
==1581==    indirectly lost: 0 bytes in 0 blocks
==1581==      possibly lost: 0 bytes in 0 blocks
==1581==    still reachable: 49,152 bytes in 3 blocks
==1581==         suppressed: 0 bytes in 0 blocks
==1581== Reachable blocks (those to which a pointer was found) are not shown.
==1581== To see them, rerun with: --leak-check=full --show-reachable=yes
==1581== 
==1581== For counts of detected and suppressed errors, rerun with: -v
==1581== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)
Killed

【问题讨论】:

  • 那么您希望我们如何知道为什么会发生这种情况?给我们看一些代码什么的。

标签: c++ memory memory-management memory-leaks valgrind


【解决方案1】:

在执行检查时,理论上某些分配的块仍然有效。也许稍后会处理静态或全局数据。或者 C++ 标准流比应用程序代码更长寿(永不销毁)。

这里有一个提示:

==1581== 未显示可到达的块(找到指向的块)。
==1581== 要查看它们,请重新运行:--leak-check=full --show-reachable=yes

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-28
    • 1970-01-01
    • 1970-01-01
    • 2021-06-27
    • 1970-01-01
    • 2015-01-30
    • 2015-08-12
    • 1970-01-01
    相关资源
    最近更新 更多