免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1267 | 回复: 1
打印 上一主题 下一主题

valgrind的不解 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-17 10:39 |只看该作者 |倒序浏览
我用
valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./server 运行程序
输出
==26420== Memcheck, a memory error detector.
==26420== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==26420== Using LibVEX rev 1606, a library for dynamic binary translation.
==26420== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==26420== Using valgrind-3.2.0, a dynamic binary instrumentation framework.
==26420== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==26420== For more details, rerun with: -v
==26420==
Loading config file from confutil.conf ...
Loading config done.
sockfd = 6
==26420==
==26420== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 23 from 1)
==26420== malloc/free: in use at exit: 2,862 bytes in 10 blocks.
==26420== malloc/free: 19 allocs, 9 frees, 3,646 bytes allocated.
==26420== For counts of detected errors, rerun with: -v
==26420== searching for pointers to 10 not-freed blocks.
==26420== checked 25,385,260 bytes.
==26420==
==26420== 6 bytes in 1 blocks are still reachable in loss record 1 of 4
==26420==    at 0x401B6DE: malloc (vg_replace_malloc.c:149)
==26420==    by 0x4197D7F: strdup (in /lib/tls/libc.so.6)
==26420==    by 0x804B784: config_string (config.c:224)
==26420==    by 0x804BB83: config_main (config.c:40
==26420==    by 0x804B2E9: V2P2P::NetlibPort::init_netlib_ipv4_ipv6() (sockthreadpoolport.cpp:51)
==26420==    by 0x80499FF: main (test.cpp:206)
==26420==
==26420==
==26420== 204 bytes in 3 blocks are possibly lost in loss record 2 of 4
==26420==    at 0x401CB20: calloc (vg_replace_malloc.c:279)
==26420==    by 0x400F9E8: allocate_dtv (in /lib/ld-2.3.3.so)
==26420==    by 0x400FABB: _dl_allocate_tls (in /lib/ld-2.3.3.so)
==26420==    by 0x40334D5: pthread_create@@GLIBC_2.1 (in /lib/tls/libpthread.so.0)
==26420==    by 0x804DBC0: V2P2P::NetlibPort::init_threadpool_ipv4_ipv6() (sockthreadpool1.cpp:4055)
==26420==    by 0x804B314: V2P2P::NetlibPort::init_netlib_ipv4_ipv6() (sockthreadpoolport.cpp:55)
==26420==    by 0x80499FF: main (test.cpp:206)
==26420==
==26420==
==26420== 252 bytes in 3 blocks are still reachable in loss record 3 of 4
==26420==    at 0x401B6DE: malloc (vg_replace_malloc.c:149)
==26420==    by 0x804DB24: V2P2P::NetlibPort::init_threadpool_ipv4_ipv6() (sockthreadpool1.cpp:4012)
==26420==    by 0x804B314: V2P2P::NetlibPort::init_netlib_ipv4_ipv6() (sockthreadpoolport.cpp:55)
==26420==    by 0x80499FF: main (test.cpp:206)
==26420==
==26420==
==26420== 2,400 bytes in 3 blocks are still reachable in loss record 4 of 4
==26420==    at 0x401B6DE: malloc (vg_replace_malloc.c:149)
==26420==    by 0x804DB76: V2P2P::NetlibPort::init_threadpool_ipv4_ipv6() (sockthreadpool1.cpp:402
==26420==    by 0x804B314: V2P2P::NetlibPort::init_netlib_ipv4_ipv6() (sockthreadpoolport.cpp:55)
==26420==    by 0x80499FF: main (test.cpp:206)
==26420==
==26420== LEAK SUMMARY:
==26420==    definitely lost: 0 bytes in 0 blocks.
==26420==      possibly lost: 204 bytes in 3 blocks.
==26420==    still reachable: 2,658 bytes in 7 blocks.
==26420==         suppressed: 0 bytes in 0 blocks.


不是显示0 error怎么下面又报这不多问题啊。

大家看看这的提示,程序存才什么问题

论坛徽章:
0
2 [报告]
发表于 2007-01-09 17:11 |只看该作者
原帖由 ruchong 于 2006-11-17 10:39 发表
    possibly lost: 204 bytes in 3 blocks.



可能存在内存泄漏
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP