Valgrind:理解输出(堆摘要还可以,错误摘要令人困惑)

发布于 2024-12-08 20:27:49 字数 598 浏览 0 评论 0原文

我读了很多关于这个主题的消息,但这有点不同,因为我没有堆错误(我很好地清理了所有内容 - 是的)。但是,我仍然在错误摘要中看到 166 个错误。

我的问题是: 1. 这是我的代码中的问题还是库/系统中的问题 2. 我的程序是一项将持续运行多年(希望如此)的服务。这些 166 错误是否会导致我的程序最终导致内存泄漏?

==1758== 
==1758== HEAP SUMMARY:
==1758==     in use at exit: 0 bytes in 0 blocks
==1758==   total heap usage: 3,658 allocs, 3,658 frees, 4,561,685 bytes allocated
==1758== 
==1758== All heap blocks were freed -- no leaks are possible
==1758== 
==1758== For counts of detected and suppressed errors, rerun with: -v
==1758== ERROR SUMMARY: 166 errors from 13 contexts (suppressed: 6 from 6)

I read a number of messages on this topic but this is a little different because I have NO heap errors (I cleaned everything up nicely - yay). But, I still see 166 errors in the error summary.

My question is:
1. Is this a problem in MY CODE or in libraries/system stuff
2. My program is a service which will run for years (hopefully) nonstop. Are these 166 errors a concern that my program will cause an eventual memory leak?

==1758== 
==1758== HEAP SUMMARY:
==1758==     in use at exit: 0 bytes in 0 blocks
==1758==   total heap usage: 3,658 allocs, 3,658 frees, 4,561,685 bytes allocated
==1758== 
==1758== All heap blocks were freed -- no leaks are possible
==1758== 
==1758== For counts of detected and suppressed errors, rerun with: -v
==1758== ERROR SUMMARY: 166 errors from 13 contexts (suppressed: 6 from 6)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

转身泪倾城 2024-12-15 20:27:49
  1. 请显示您如何运行 valgrind,我的意思
  2. 是最后两行的参数:“对于检测到和抑制的错误的计数,使用:-v重新运行”
  3. 该错误通常意味着系统调用返回 -1 ,例如:“close a invalid fd”
  4. 如果你希望它是完美的,你最好修复所有错误
  1. pls show how you run valgrind, i mean the args
  2. as the last two lines says: "For counts of detected and suppressed errors, rerun with: -v"
  3. the error typically means a sys call return -1, eg: "close a invalid fd"
  4. you had better fix all the errors if you want it to be perfect
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文