什么的SUP pressed泄漏Valgrind的是什么意思? [英] What do the suppressed leaks mean in Valgrind?

查看:218
本文介绍了什么的SUP pressed泄漏Valgrind的是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我公司开发的纯C语言实现的FIFO文件列表(队列)的 fifo.h fifo.c 和采写测试程序 testfifo.c 我编译 ./斌/ testfifo 。节点结构在 list.h

I have developed a pure-C implementation of FIFO lists (queues) in files fifo.h and fifo.c, and have written a test programme testfifo.c which I compile to ./bin/testfifo. The node structure is defined in list.h.

我在OS X 10.6贯穿Valgrind的我的计划是这样

I run my programme through Valgrind on OS X 10.6 like this

valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./bin/testfifo

和得到下面的输出

==54688== Memcheck, a memory error detector
==54688== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==54688== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==54688== Command: bin/testfifo
==54688== 
--54688-- bin/testfifo:
--54688-- dSYM directory is missing; consider using --dsymutil=yes
==54688== 
==54688== HEAP SUMMARY:
==54688==     in use at exit: 88 bytes in 1 blocks
==54688==   total heap usage: 11 allocs, 10 frees, 248 bytes allocated
==54688== 
==54688== LEAK SUMMARY:
==54688==    definitely lost: 0 bytes in 0 blocks
==54688==    indirectly lost: 0 bytes in 0 blocks
==54688==      possibly lost: 0 bytes in 0 blocks
==54688==    still reachable: 0 bytes in 0 blocks
==54688==         suppressed: 88 bytes in 1 blocks
==54688== 
==54688== For counts of detected and suppressed errors, rerun with: -v
==54688== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

据泄漏总结,没有泄漏,但我仍然不知道的SUP pressed泄漏是什么。此外,分配的和自由的数量不匹配,因此我是否有泄漏或不不确定

According to the leak summary, there are no leaks, but I am still wondering what the "suppressed" leaks are. Besides, the number of alloc's and free's do not match, and hence I am unsure if there are leaks or not.

---- ----编辑

运行

valgrind --tool=memcheck --leak-check=full --show-reachable=yes -v ./bin/testfifo

在OS X 10.6产生很长,混乱的输出,但我已经运行

on OS X 10.6 produces a quite long and confusing output, but I have run

valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./bin/testfifo

在Linux机器上一个得到这个输出:

==32688== Memcheck, a memory error detector
==32688== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==32688== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==32688== Command: bin/testfifo
==32688== 
==32688== 
==32688== HEAP SUMMARY:
==32688==     in use at exit: 0 bytes in 0 blocks
==32688==   total heap usage: 10 allocs, 10 frees, 160 bytes allocated
==32688== 
==32688== All heap blocks were freed -- no leaks are possible
==32688== 
==32688== For counts of detected and suppressed errors, rerun with: -v
==32688== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 4 from 4)

页头的和免费的现配,所以在OS X上多余的页头似乎是由于某些系统库,已建议。

alloc's and free's now match, so the extra alloc on OS X seems to be due to some system library, as has been suggested.

我已经运行的 -v 选项非常相同的命令,以揭示pssed错误4燮$ P $,但我没有有任何容易理解新的信息。

I have run the very same command with the -v option, in order to reveal the 4 suppressed errors, but I have not got any easily understandable new information.

推荐答案

这些都是你的code,在(可能是共享)库或已知误报外泄漏。与 -v 运行的valgrind应告知您所使用的SUP pressions。

Those are leaks outside of your code, in (probably shared) libraries or known false positives. Running valgrind with -v should inform you about the suppressions used.

这篇关于什么的SUP pressed泄漏Valgrind的是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆