How to debug Ros::NodeHandle's segfault?

asked 2021-09-24 22:44:18 -0600

achmad_fathoni gravatar image

This simple code

#include <ros/ros.h>      

int main(int argc, char **argv){    
    ros::init(argc,argv, "talker");      
    ros::NodeHandle n;      
    return 0;      


Produces segfault:

[1] 2495949 segmentation fault (core dumped) rosrun test test_node

what is the recommended way to debug ros program?

edit retag flag offensive close merge delete


Same as any other C++ program: using a debugger. GDB is a popular choice, but there are more.

If you're using roslaunch, see wiki/How to Roslaunch Nodes in Valgrind or GDB.

gvdhoorn gravatar image gvdhoorn  ( 2021-09-25 00:39:52 -0600 )edit