【发布时间】:2015-11-08 12:03:37
【问题描述】:
我正在尝试在 linux(ARM 架构)上运行应用程序时调试段错误。我复制了核心转储文件并尝试在 x86_64 主机上使用 arm-gdb 获取回溯。这是o/p:
$ arm-arago-linux-gnueabi-gdb test_slave6_slave core
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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=i686-oesdk-linux --target=arm-oe-linux-gnueabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dvdk/test_slave6_slave...done.
warning: exec file is newer than core file.
[New LWP 6411]
[New LWP 6410]
warning: Could not load shared library symbols for 12 libraries, e.g. /lib/libjson-c.so.2.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/usr/bin/test_slave6_slave 5 111.111.111.111 1 2 1 2'.
Program terminated with signal 11, Segmentation fault.
#0 0x47b61dd4 in ?? ()
(gdb) bt
#0 0x47b61dd4 in ?? ()
#1 0x47b2e0fc in ?? ()
#2 0x47b2e0fc in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
(时间戳警告可能是因为我先复制了核心文件)
我不认为this 问题,我的问题与我获得有效地址相同。我认为这仍然是一个堆栈损坏问题。但我不确定如何进一步调试。我应该使用 GDB 还是 valgrind?有人可以指出我使用这些工具进行调试的正确步骤。例如,我应该将 memecheck 与 valgrind 与 leak_check 一起使用吗?
更新 1: 我将 libcurl 用于 https 请求。我注意到当使用不支持 ssl 的另一个版本的 libcurl 时不会发生崩溃。 (查询当然会失败)。启用 ssl 的 libcurl 是我自定义编译的。
【问题讨论】:
-
gdb 给你一个建议去看看
info sharedlibrary,这个命令的输出是什么?但是,我更关心警告exec file is newer than core file,您是否针对正确的共享库进行构建?
标签: linux gdb arm valgrind stack-corruption