当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 1 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : 留下一个pthread_cancel内存泄露的问题。
帖子发表于 : 2007-05-18 16:08 
头像

注册: 2006-08-13 16:06
帖子: 76
送出感谢: 0 次
接收感谢: 0 次
使用pthread_cancel取消线程后会有一块内存没有释放,正在想办法解决。

如果有人知道怎么解决欢迎跟帖。

这是用valgrind监测后的报告:
代码:
==15293== Memcheck, a memory error detector.
==15293== Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
==15293== Using LibVEX rev 1658, a library for dynamic binary translation.
==15293== Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
==15293== Using valgrind-3.2.1-Debian, a dynamic binary instrumentation framework.
==15293== Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
==15293== For more details, rerun with: -v
==15293==
==15293== My PID = 15293, parent PID = 7435.  Prog and args are:
==15293==    ./wocsd
==15293==
==15293==
==15293== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 19 from 1)
==15293== malloc/free: in use at exit: 28 bytes in 1 blocks.
==15293== malloc/free: 15 allocs, 14 frees, 888 bytes allocated.
==15293== For counts of detected errors, rerun with: -v
==15293== searching for pointers to 1 not-freed blocks.
==15293== checked 127,544 bytes.
==15293==
==15293== 28 bytes in 1 blocks are still reachable in loss record 1 of 1
==15293==    at 0x4021620: malloc (vg_replace_malloc.c:149)
==15293==    by 0x400BE46: (within /lib/ld-2.5.so)
==15293==    by 0x4010DF4: (within /lib/ld-2.5.so)
==15293==    by 0x400CFA5: (within /lib/ld-2.5.so)
==15293==    by 0x40108ED: (within /lib/ld-2.5.so)
==15293==    by 0x42710A1: (within /lib/tls/i686/cmov/libc-2.5.so)
==15293==    by 0x400CFA5: (within /lib/ld-2.5.so)
==15293==    by 0x4271254: __libc_dlopen_mode (in /lib/tls/i686/cmov/libc-2.5.so)
==15293==    by 0x4044E66: pthread_cancel_init (in /lib/tls/i686/cmov/libpthread-2.5.so)
==15293==    by 0x404140B: pthread_cancel (in /lib/tls/i686/cmov/libpthread-2.5.so)
==15293==    by 0x80494E1: WOCS_TcpServer::stop() (tcpserver.cc:134)
==15293==    by 0x8049801: WOCS_TcpServer::~WOCS_TcpServer() (tcpserver.cc:36)
==15293==
==15293== LEAK SUMMARY:
==15293==    definitely lost: 0 bytes in 0 blocks.
==15293==      possibly lost: 0 bytes in 0 blocks.
==15293==    still reachable: 28 bytes in 1 blocks.
==15293==         suppressed: 0 bytes in 0 blocks.


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 1 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译