Steps to core dump the call stack of crashed ROS node

在遇到ROS节点崩溃只显示有限信息的问题时,为了调试,我们需要核心转储来查看更详细的崩溃信息。步骤包括:检查并设置核心文件大小为无限制;激活带PID的核心文件生成;运行ROS节点并重现崩溃;使用gdb分析核心转储文件,通过bt命令查看调用堆栈。如果调用堆栈细节不足,可以检查/gdbinit文件设置。
摘要由CSDN通过智能技术生成

Recently met a ROS node crash issue which just shows below information
xxx_node-3] process has died [pid 32584, exit code -11, cmd/home/robert/Documents/test_ws/src/flight
-xxx_build/devel/lib/flight_xxx_xxx/solar_xxx_node
_name: =solar  node
_log:=/home/r
obert/.ros/log/0f839167-4411-11ed-92be-48b02d3d8078/solar_orchestrator_node-3.logl
log file: /home/robert/.ros/log/0f839167-4411-11ed-92be-48b02d3d8078/solar_xxx_node-3*.

To debug this issue, we need core dump to see more crash information, here is the steps:

1.  Check and set the core size to unlimited

$ ulimit -a
core file size          (blocks, -c) 0           #  <-- Prevents core dumps

Default corefile size is 0, it means it will not generate coredump file

Set the core size to unlimited:

ulimit -c unlimited

Then again ulimit -a

$ ulimit -a
core file size          (blocks, -c) unlimited

core file size is changed as unlimited
2. Check if coredump file generation with pid

$ cat /proc/sys/kernel/core_uses_pid
0

0 means core dump file pid is deactivated. let’s activate

echo 1 | sudo tee /proc/sys/kernel/core_uses_pid ...
$ cat /proc/sys/kernel/core_uses_pid
1

Now, it can generate coredump with pid
3. Run the ros node and reproduce the crash,such as below
 

(base) test@xavier-rd-x:~/bumbleTest_one$ roslaunch test test.launch 
~~~
[module-1] process has died [pid 10821, exit code -11, cmd 
~~~

The PID number is 8779

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值