gdb调试ros node崩溃地址

  • 编译Debug版本
catkin_make -DCMAKE_BUILD_TYPE=Debug
  • gdb启动ros node
rosrun --prefix 'gdb -ex run --args'  package   node

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000000000460d30 in boost::detail::atomic_increment (pw=0x555ed0 <__libc_csu_init+8>) at /usr/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp:43
43	    __sync_fetch_and_add( pw, 1 );

 此时看到 'Segmentation fault'崩溃了,使用'bt'命令列出崩溃call stack

(gdb) bt
#0  0x0000000000460d30 in boost::detail::atomic_increment (pw=0x555ed0 <__libc_csu_init+8>) at /usr/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp:43
#1  0x0000000000460e40 in boost::detail::sp_counted_base::add_ref_copy (this=0x555ec8 <__libc_csu_init>) at /usr/include/boost/smart_ptr/detail/sp_counted_base_sync.hpp:116
#2  0x0000000000460ea4 in boost::detail::shared_count::shared_count (this=0x7fffffeb90, r=...) at /usr/include/boost/smart_ptr/detail/shared_count.hpp:454
#3  0x000000000046173c in boost::shared_ptr<autoware::Line>::shared_ptr (this=0x7fffffeb88, r=...) at /usr/include/boost/smart_ptr/shared_ptr.hpp:392
#4  0x00000000004618dc in boost::shared_ptr<autoware::Line>::operator= (this=0x7fffffec28, r=...) at /usr/include/boost/smart_ptr/shared_ptr.hpp:502
#5  0x0000000000460638 in autoware::WhiteLine::fromHADLane (pHADLane=0x6b1ab0) at /home/nvidia/catkin_ws/src/baidu_had/src/autoware.cpp:140
#6  0x000000000045c568 in autoware_vector_map (pDB=0x677c00, links=std::vector of length 1127, capacity 2048 = {...}, pg_path="/home/nvidia/catkin_ws/src/baidu_had")
    at /home/nvidia/catkin_ws/src/baidu_had/src/db_console.cc:192
#7  0x000000000045ca78 in main (argc=1, argv=0x7ffffff1c0) at /home/nvidia/catkin_ws/src/baidu_had/src/db_console.cc:247

这里已经可以都看到frame 6调用shared_ptr引起崩溃,还有代码文件名和行数。接下来可以 frame 6 和 frame info来看详细的寄存器信息.

其它的调试命令如: info locals , info args 等可以打印frame的参数等

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值