GDB回溯怪异 [英] gdb weird backtrace

查看:362
本文介绍了GDB回溯怪异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的计划是用静态编译dietlibc。这是在Ubuntu的x64编译(编译使用-m32标志x86)的,并且是一个CentOS的x86上运行。

编译大小只有100KB左右。我-ggdb3没有优化标志进行编译。

我的程序使用signal.h中来处理SIGSEGV信号,然后调用abort()。

该程序没有运行数天,但有时段错误的问题。这是当我得到奇怪的回溯,我不明白:


用户名@ Ubuntu的:〜/桌面$ GDB -c core.28569程序名
GNU GDB(GDB)7.2
版权所有(C)2010自由软件基金会
许可GPLv3的+:GNU GPL版本3或更高版本
这是自由软件:您可以自由修改和重新发布。
没有担保,在法律允许的范围内。键入显示复​​制
和显示保修的说明。
这是GDB配置为主机= x86_64的Linux的GNU的--target = i386的Linux的GNU的。
对于错误报告的说明,请参阅:
...
阅读从程序名符号......完成。
[新主题28569]
核心是由'程序名'产生。
计划用信号6终止,中止。
#0 0x00914410在__kernel_vsyscall()
设置调试GDB的环境。
功能INTERNAL_ERROR没有定义。
就未来的共享库加载断点挂起? (y或[N])[回答N;从端子输入不]
功能info_command没有定义。
就未来的共享库加载断点挂起? (y或[N])[回答N;从端子输入不]
.gdbinit:8:错误了源代码的命令文件:
参数所需(一个或多个断点的数字)。
(GDB)BT
#0 0x00914410在__kernel_vsyscall()
在符号的阅读,不完整的CFI数据;未指定的寄存器(例如EAX)的0x914411。
#1 0x0804d7f4在__unified_syscall()
#2 0xbf8966c0的? ()
#3
#4 0x2054454e中? ()
#5 0x20524c43的? ()
#6 0x2e352e33的? ()
#7 0x32373033的? ()
#8 0x2e203b39的? ()
#9 0x2054454e的? ()
#10 0x20524c43的? ()
#11 0x2e302e33的? ()
#12 0x32373033的? ()
#13 0x4d203b39的? ()
#14 0x61696465的? ()
#15 0x6e654320的? ()
#16 0x20726574的? ()
#17 0x36204350的? ()
#18 0x203b302e的? ()
#19 0x54454e2e的? ()
#20 0x43302e34的? ()
#21 0x00000029的? ()
#22 0xbf8989a8的? ()
回溯停止:previous框架内与该帧(堆栈损坏?)
(GDB)BT全
#0 0x00914410在__kernel_vsyscall()
没有可用的符号表信息。
#1 0x0804d7f4在__unified_syscall()
没有可用的符号表信息。
#2 0xbf8966c0的? ()
没有可用的符号表信息。
#3
没有可用的符号表信息。
#4 0x2054454e中? ()
没有可用的符号表信息。
#5 0x20524c43的? ()
没有可用的符号表信息。
#6 0x2e352e33的? ()
没有可用的符号表信息。
#7 0x32373033的? ()
没有可用的符号表信息。
#8 0x2e203b39的? ()
没有可用的符号表信息。
#9 0x2054454e的? ()
没有可用的符号表信息。
#10 0x20524c43的? ()
没有可用的符号表信息。
#11 0x2e302e33的? ()
没有可用的符号表信息。
#12 0x32373033的? ()
没有可用的符号表信息。
#13 0x4d203b39的? ()
没有可用的符号表信息。
#14 0x61696465的? ()
没有可用的符号表信息。
#15 0x6e654320的? ()
没有可用的符号表信息。
#16 0x20726574的? ()
没有可用的符号表信息。
#17 0x36204350的? ()
没有可用的符号表信息。
#18 0x203b302e的? ()
没有可用的符号表信息。
#19 0x54454e2e的? ()
没有可用的符号表信息。
#20 0x43302e34的? ()
没有可用的符号表信息。
#21 0x00000029的? ()
没有可用的符号表信息。
#22 0xbf8989a8的? ()
没有可用的符号表信息。
回溯停止:previous框架内与该帧(堆栈损坏?)
(GDB)退出


解决方案

这是一个堆栈溢出。

 #4 0x2054454e中? ()

这看起来像文字,十或NET

 #5 0x20524c43的? ()

RLC或CLR

等。

对待地址,就好像它们是文本 - 看看你能不能找出该文本将覆盖你的筹码

My program is statically compiled with dietlibc. It is compiled on ubuntu x64 (compiled for x86 using the -m32 flag) and is run on a centos x86.

The compiled size is only about 100KB. I compile it with -ggdb3 and no optimization flags.

My program uses signal.h to handle a SIGSEGV signal and then calls abort().

The program runs without problems for days but sometimes segfaults. This is when I get weird backtraces that I do not understand:

username@ubuntu:~/Desktop$ gdb -c core.28569 program-name
GNU gdb (GDB) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=i386-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from program-name...done.
[New Thread 28569]
Core was generated by `program-name'.
Program terminated with signal 6, Aborted.
#0  0x00914410 in __kernel_vsyscall ()
Setting up the environment for debugging gdb.
Function "internal_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
Function "info_command" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
.gdbinit:8: Error in sourced command file:
Argument required (one or more breakpoint numbers).
(gdb) bt
#0  0x00914410 in __kernel_vsyscall ()
During symbol reading, incomplete CFI data; unspecified registers (e.g., eax) at 0x914411.
#1  0x0804d7f4 in __unified_syscall ()
#2  0xbf8966c0 in ?? ()
#3  
#4  0x2054454e in ?? ()
#5  0x20524c43 in ?? ()
#6  0x2e352e33 in ?? ()
#7  0x32373033 in ?? ()
#8  0x2e203b39 in ?? ()
#9  0x2054454e in ?? ()
#10 0x20524c43 in ?? ()
#11 0x2e302e33 in ?? ()
#12 0x32373033 in ?? ()
#13 0x4d203b39 in ?? ()
#14 0x61696465 in ?? ()
#15 0x6e654320 in ?? ()
#16 0x20726574 in ?? ()
#17 0x36204350 in ?? ()
#18 0x203b302e in ?? ()
#19 0x54454e2e in ?? ()
#20 0x43302e34 in ?? ()
#21 0x00000029 in ?? ()
#22 0xbf8989a8 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) bt full
#0  0x00914410 in __kernel_vsyscall ()
No symbol table info available.
#1  0x0804d7f4 in __unified_syscall ()
No symbol table info available.
#2  0xbf8966c0 in ?? ()
No symbol table info available.
#3  
No symbol table info available.
#4  0x2054454e in ?? ()
No symbol table info available.
#5  0x20524c43 in ?? ()
No symbol table info available.
#6  0x2e352e33 in ?? ()
No symbol table info available.
#7  0x32373033 in ?? ()
No symbol table info available.
#8  0x2e203b39 in ?? ()
No symbol table info available.
#9  0x2054454e in ?? ()
No symbol table info available.
#10 0x20524c43 in ?? ()
No symbol table info available.
#11 0x2e302e33 in ?? ()
No symbol table info available.
#12 0x32373033 in ?? ()
No symbol table info available.
#13 0x4d203b39 in ?? ()
No symbol table info available.
#14 0x61696465 in ?? ()
No symbol table info available.
#15 0x6e654320 in ?? ()
No symbol table info available.
#16 0x20726574 in ?? ()
No symbol table info available.
#17 0x36204350 in ?? ()
No symbol table info available.
#18 0x203b302e in ?? ()
No symbol table info available.
#19 0x54454e2e in ?? ()
No symbol table info available.
#20 0x43302e34 in ?? ()
No symbol table info available.
#21 0x00000029 in ?? ()
No symbol table info available.
#22 0xbf8989a8 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) quit

解决方案

It's a stack overrun.

#4  0x2054454e in ?? ()

That looks like text, " TEN" or "NET "

#5  0x20524c43 in ?? ()

" RLC" or "CLR "

And so on.

Treat the addresses as if they were text - see if you can identify where this text overwrites your stack.

这篇关于GDB回溯怪异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆