为什么在内存泄漏检测期间杀死 valgrind

Why valgrind is killed during memory leak detection?

本文关键字:valgrind 检测 内存 泄漏 为什么      更新时间:2023-10-16
==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++比应用程序代码更长久(永远不会销毁)的标准流。

这里有一个提示:

==1581== 不显示可访问的块(找到指针的块)。
==1581== 要查看它们,请重新运行:--泄漏检查=完整 --显示可到达=是