免费注册 查看新帖 |

Chinaunix

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

关于stl list.clear()问题。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-07-04 12:48 |只看该作者 |倒序浏览
程序在list.clear()的有时候会core down,具体的信息如下:
(gdb) where
#0  0xc019698c in _sigfillset+0xb4c () from /lib/libc.2
#1  0xc0199530 in free+0x180 () from /lib/libc.2
#2  0xc0324594 in operator delete+0x30 () from /lib/libCsup.2
#3  0x15d04 in basic_string<char,string_char_traits<char>;,allocator>;::unLink+0xb0 ()
#4  0xa192c in CPrepay_2::~CPrepay_2 (this=0x40111c40, #free=2) at ../include/CBill.h:574
#5  0x45d58 in list<CPrepay_2,allocator>;::erase+0xdc ()
#6  0x79790 in UCIS21110 (rqst=0x40036c54) at ucis21110.cpp:3214
#7  0xc616a290 in _tmsvcdsp+0xcb8 () from /tuxedo/lib/libtux.sl
#8  0xc61887d8 in _tmrunserver+0x180 () from /tuxedo/lib/libtux.sl
#9  0xc6169008 in _tmstartserver+0x134 () from /tuxedo/lib/libtux.sl
#10 0x127bc in main (argc=16, argv=0x7f7f0a9c) at BS-5f57.c:76
不知道大家碰到过这个问题没有?谢谢指点。

论坛徽章:
0
2 [报告]
发表于 2005-07-05 08:26 |只看该作者

关于stl list.clear()问题。

关注

论坛徽章:
0
3 [报告]
发表于 2005-07-05 15:00 |只看该作者

关于stl list.clear()问题。

我猜测试你的list的元素的释放资源的时候出问题了吧,仅仅是猜测……

论坛徽章:
0
4 [报告]
发表于 2005-07-05 17:22 |只看该作者

关于stl list.clear()问题。

list.clear()中如果存放的是指针,那么也应该会清除指针指向的空间吧,如果指向的地址非法就有可能是以上信息所指示的了
你把整个程序贴出来啊!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP