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

Stage segfaults at startup

asked 2011-03-10 07:52:39 -0500

Sagnik gravatar image

updated 2011-03-10 08:42:50 -0500

Eric Perko gravatar image

Hi Guys,

I wanted to modify stageros.cpp in a very minor way. I wanted the /odom topic to be published with a different name, so I went ahead and changed the string at the top of the file to "canbus". After rosmaking stage, it seg faults at startup. Even when I change the string "canbus" back to "odom" and rosmake it once again, it still seg faults.

I checked the seg fault issue of stage listed on the stage page on the ros site, but thats not the problem in my case.

Where am I going wrong ?

The backtrace is as follows,

Core was generated by `./stageros ../world/'.
Program terminated with signal 11, Segmentation fault.
#0  boost::shared_ptr<ros::Publisher::Impl>::operator! (this=0x0, message=...) at /usr/include/boost/smart_ptr/detail/operator_bool.hpp:55
55          return px == 0;
(gdb) bt
#0  boost::shared_ptr<ros::Publisher::Impl>::operator! (this=0x0, message=...) at /usr/include/boost/smart_ptr/detail/operator_bool.hpp:55
#1  ros::Publisher::publish<nav_msgs::Odometry_<std::allocator<void> > > (this=0x0, message=...) at /opt/ros/cturtle/ros/core/roscpp/include/ros/publisher.h:95
#2  0x000000000040e7f1 in StageNode::WorldCallback (this=0x7fff89629870) at /opt/ros/cturtle/stacks/simulator_stage/stage/src/stageros.cpp:355
#3  0x000000000041c2ac in StageNode::s_update (world=<value optimized out>, node=0x1fae778) at /opt/ros/cturtle/stacks/simulator_stage/stage/src/stageros.cpp:88
#4  0x00007f38f712322e in Stg::World::CallUpdateCallbacks (this=0x13ca4d0) at /opt/ros/cturtle/stacks/simulator_stage/stage/build/Stage-3.2.2-Source/libstage/
#5  0x00007f38f7123604 in Stg::World::Update (this=0x13ca4d0) at /opt/ros/cturtle/stacks/simulator_stage/stage/build/Stage-3.2.2-Source/libstage/
#6  0x00007f38f713c501 in Stg::WorldGui::Update (this=0x13ca4d0) at /opt/ros/cturtle/stacks/simulator_stage/stage/build/Stage-3.2.2-Source/libstage/
#7  0x00007f38f6a2f008 in Fl::wait(double) () from /usr/lib/
#8  0x0000000000414984 in main (argc=2, argv=<value optimized out>) at /opt/ros/cturtle/stacks/simulator_stage/stage/src/stageros.cpp:440

Thanks, Sagnik

edit retag flag offensive close merge delete


Can you post your modified version of the code (perhaps on pastebin or a gist on github or something)? And are you certain you didn't change anything but the topic name?
Eric Perko gravatar image Eric Perko  ( 2011-03-10 08:43:47 -0500 )edit
Ah, my bad.... I had modified another line unknowingly, and that was causing the seg fault. My apologies for asking the question without double-checking.
Sagnik gravatar image Sagnik  ( 2011-03-10 09:07:36 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2011-03-10 12:49:02 -0500

tfoote gravatar image

Closing as resolved by bad change in code. See comment above from @sagnik

For future reference if you want to change the topic on which something is published you should use topic remapping.

edit flag offensive delete link more

Question Tools


Asked: 2011-03-10 07:52:39 -0500

Seen: 428 times

Last updated: Mar 10 '11