ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

What is an ideal way of debugging a segmentation fault in ROS?

asked 2012-03-14 01:32:27 -0600

karthik gravatar image

Hi, I generally use gdb to debug my run time errors in my C++ programs. But in ros as it spins n waits for the msgs in topics, the gdb doesn't really work well. So I want to know if there is another method to debug the ros codes when they run into segmentation faults.

Thanks, Karthik

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2012-03-14 04:00:50 -0600

You can launch nodes directly in gdb, here is some more info:

http://www.ros.org/wiki/roslaunch/Tutorials/Roslaunch%20Nodes%20in%20Valgrind%20or%20GDB

edit flag offensive delete link more
2

answered 2012-03-14 02:40:39 -0600

dornhege gravatar image

For debugging ROS nodes I use the same way as for any other C++ program: gdb/ddd/kdbg.

The spinning shouldn't be a problem, just start of with the message handler in the backtrace. This is under the assumption that you want to debug your ROS code and not the ROS core functionality, which I would consider mostly bug-free.

edit flag offensive delete link more

Comments

I am not very experienced with using gdb and ddd. How would I go about debugging nodes launched with roslaunch using ddd? Thanks!

vkee gravatar image vkee  ( 2017-08-22 05:53:26 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2012-03-14 01:32:27 -0600

Seen: 6,472 times

Last updated: Mar 14 '12