Ask Your Question
2

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

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

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
5

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

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 -0500

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

Follow
1 follower

Stats

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

Seen: 1,563 times

Last updated: Mar 14 '12