嵌入式Linux gdb core dump快速定位程序crash问题

 

指定生成 core dump 文件:

echo "/tmp/core-%e-%p-%t" > /proc/sys/kernel/core_pattern
ulimit -c unlimited

复现问题之后,取出 /tmp 目录下面的 core dump文件

运行:

 

/opt/rk3308/bin/arm-rockchip-linux-gnueabihf-gdb uni_demo core-uni_demo-3072-1985

出现以下问题:
/opt/rk3308/bin/arm-rockchip-linux-gnueabihf-gdb: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory

发现所依赖的库在交叉编译工具包里面,指定所依赖的交叉编译工具包路径;

export LD_LIBRARY_PATH=/opt/rk3308/lib

可以发现:

 

GNU gdb (GDB) 7.11.1
Copyright (C) 2016 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=x86_64-pc-linux-gnu --target=arm-rockchip-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from uni_demo...done.
[New LWP 3078]
[New LWP 3082]
[New LWP 3081]
[New LWP 3086]
[New LWP 3073]
[New LWP 3108]
[New LWP 3087]
[New LWP 3088]
[New LWP 3085]
[New LWP 3107]
[New LWP 3102]
[New LWP 3094]
[New LWP 3074]
[New LWP 3101]
[New LWP 3093]
[New LWP 3100]
[New LWP 3089]
[New LWP 3084]
[New LWP 3072]
[New LWP 3083]
[New LWP 3092]
[New LWP 3090]
[New LWP 3077]
[New LWP 3106]
[New LWP 3091]

warning: Could not load shared library symbols for 37 libraries, e.g. linux-vdso.so.1.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `./uni_demo'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0xb595a940 in ?? ()
[Current thread is 1 (LWP 3078)]
(gdb) bt
#0 0xb595a940 in ?? ()
#1 0x7f5e27c0 in _parse_music_content (content=0xa9d00b70) at music_handler.c:380
#2 _action_start (event_info=<optimized out>) at music_handler.c:822
#3 0x7f5e16a0 in _start_handler (event_info=0xb3c0fdec) at music_handler.c:1191
#4 0x7f5c682e in _session_process (handler=0x813ed328, event_info=<optimized out>) at session_manage.c:263
#5 0x7f5c842a in _handle_event (args=0x813ecc88) at uni_event_list.c:42
#6 0xb6ba857c in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) q

 

转载于:https://www.cnblogs.com/hongzhunzhun/p/10755135.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值