免费注册 查看新帖 |

Chinaunix

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

string拷贝构造函数出异常,求帮助? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-09-26 17:52 |只看该作者 |倒序浏览
gdb显示堆栈如下:


#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7d29a30 in raise () from /lib/libc.so.6
#2  0xb7d2b153 in abort () from /lib/libc.so.6
#3  0xb7f114b0 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/libstdc++.so.6
#4  0xb7f0eed5 in ?? () from /usr/lib/libstdc++.so.6
#5  0xb7f0ef12 in std::terminate() () from /usr/lib/libstdc++.so.6
#6  0xb7f0f04a in __cxa_throw () from /usr/lib/libstdc++.so.6
#7  0xb7ea6c6f in std::__throw_length_error(char const*) ()
   from /usr/lib/libstdc++.so.6
#8  0xb7eeaffa in std::string::_Rep::_S_create(unsigned int, unsigned int, std::allocator<char> const&) () from /usr/lib/libstdc++.so.6
#9  0xb7eebb98 in std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned int) () from /usr/lib/libstdc++.so.6
#10 0xb7eec577 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
   from /usr/lib/libstdc++.so.6
#11 0x08061c46 in string::string (this=0xbf8b5858, str=@0xbf8b45d4)
    at ../../h/xxx.h:123


系统环境:
# uname -a
Linux linux-t1vq 2.6.16.60-0.54.5-smp #1 SMP Fri Sep 4 01:28:03 UTC 2009 i686 i686 i386 GNU/Linux


其中 str值为 “/”,因为我使用gdb打印出来,显示如下;

(gdb) p  str
$12 = (
    const string&) @0xbf8b45d4: {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "/", <No data fields>}

论坛徽章:
0
2 [报告]
发表于 2011-09-27 09:18 |只看该作者
还不如给代码

论坛徽章:
0
3 [报告]
发表于 2011-09-27 09:45 |只看该作者
把代码贴出来看看

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:56:11
4 [报告]
发表于 2011-09-27 10:54 |只看该作者
代码呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP