- 论坛徽章:
- 0
|
我用
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![](static/image/smiley/default/icon_cool.gif)
==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![](static/image/smiley/default/icon_cool.gif)
==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怎么下面又报这不多问题啊。
大家看看这的提示,程序存才什么问题 |
|