免费注册 查看新帖 |

Chinaunix

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

GDB调试 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-23 16:04 |只看该作者 |倒序浏览
20可用积分
我的程序在在GDB调试下,出现了如下问题:    老大们帮忙看看,谢谢了!!!

GNU gdb Red Hat Linux (6.3.0.0-1.132.EL4rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-asianux-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".

(gdb) r
Starting program: /home/fanzhijie/******
[Thread debugging using libthread_db enabled]
[New Thread 182900005888 (LWP 8634)]
thread 95b09c00 2009-12-23 16:02:19 -- main.cpp(29):main before new ***
thread 95b09c00 2009-12-23 16:02:19 -- main.cpp(31):main after new ***
***load from: /usr/local/***
Warning: **************************************************
Warning: ***  The *** database is older than 7 days!  ***
Warning: ***   Please update it as soon as possible.    ***
Warning: **************************************************
Loaded 572031 signatures.
thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(234):Init ***module init OK
thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(10:******ip is ***
thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(114):***net ***(null)
thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(257):Init ***addr *** port ***local ***port ***
thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(272):Init ******port ***
Connection refused
thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(281):Init init *** ***module OK ******
thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(286):Init init before ***and ***module, for testing.....
[New Thread 1084229984 (LWP 8637)]
thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(141):***OK
***thread created ok

thread 95b09c00 2009-12-23 16:02:21 -- ***.cpp(631):***before new ***module, for testing.....
terminate called after throwing an instance of 'std::bad_alloc'
  what():  St9bad_alloc

Program received signal SIGABRT, Aborted.
[Switching to Thread 182900005888 (LWP 8634)]
0x0000003f2a02e21d in raise () from /lib64/tls/libc.so.6
(gdb) bt
#0  0x0000003f2a02e21d in raise () from /lib64/tls/libc.so.6
#1  0x0000003f2a02fa1e in abort () from /lib64/tls/libc.so.6
#2  0x0000003f2b7b10a8 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib64/libstdc++.so.6
#3  0x0000003f2b7af0d6 in __cxa_call_unexpected () from /usr/lib64/libstdc++.so.6
#4  0x0000003f2b7af103 in std::terminate () from /usr/lib64/libstdc++.so.6
#5  0x0000003f2b7af203 in __cxa_throw () from /usr/lib64/libstdc++.so.6
#6  0x0000003f2b7af58d in operator new () from /usr/lib64/libstdc++.so.6
#7  0x0000000000407341 in aaaaa::bbbbb(this=0x512090) at ccccc.cpp:632
#8  0x0000000000407717 in aaaaa::Init (this=0x512090) at ddddde.cpp:288
#9  0x0000000000405876 in main (argc=Variable "argc" is not available.
) at main.cpp:32


各位同胞们帮忙分析下这个错误是什么原因造成的,如何处理呢,谢谢了!!!!

[ 本帖最后由 fanzhijie875151 于 2009-12-23 16:16 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-12-23 16:18 |只看该作者
抛异常了,bad_alloc,看信息是new操作符失败了。

论坛徽章:
0
3 [报告]
发表于 2009-12-23 16:22 |只看该作者
谢谢2楼的兄弟,我的程序在32位系统上可以运行,new时也是正确的,只是偶尔掉线.
现在64位上,new通不过,为什么会出现这种原因呢?该怎么解决呢?

论坛徽章:
0
4 [报告]
发表于 2009-12-23 16:34 |只看该作者
贴代码,new了什么东西,如果是类,类声明也要贴出来看看。对new进行调用的上下五行代码都贴上来吧。

论坛徽章:
0
5 [报告]
发表于 2009-12-23 21:15 |只看该作者
试试先frame 7然后info locals看看再list一下

论坛徽章:
0
6 [报告]
发表于 2009-12-23 22:41 |只看该作者
valgrind

论坛徽章:
0
7 [报告]
发表于 2014-08-15 14:55 |只看该作者
我遇到了同样的问题,我的是调用了c++11的thread库,结果在mutex.lock时候,出现了termination错误,下面是堆栈信息

stack.JPG (219.34 KB, 下载次数: 46)

linuxstack

linuxstack

论坛徽章:
0
8 [报告]
发表于 2014-08-15 14:57 |只看该作者
下面是code,

code.JPG (37.69 KB, 下载次数: 44)

出现错误的行

出现错误的行
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP