occasional gazebo crash while spawning models
I am running a multi robot setup in simulation. Most of the times gazebo runs fine, but occasionally it will crash out (about 1 in 3 times). The relevant output of the launch script looks like this:
Gazebo multi-robot simulator, version 1.0.2
Copyright (C) 2011 Nate Koenig, John Hsu, Andrew Howard, and contributors.
Released under the Apache 2 License.
http://gazebosim.org
Msg Waiting for master
Msg Connected to gazebo master @ http://localhost:11345
Msg Waiting for master[ INFO] [1346872005.741139817]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
Msg Connected to gazebo master @ http://localhost:11345
gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr<T>::operator->() const [with T = gazebo::transport::Publisher]: Assertion `px != 0' failed.
Service call failed: transport error completing service call: unable to receive data from sender, check sender's logs for details
Service call failed: transport error completing service call: unable to receive data from sender, check sender's logs for details
Aborted (core dumped)
[ens32_world-2] process has died [pid 6080, exit code 134, cmd optirun /opt/ros/fuerte/stacks/simulator_gazebo/gazebo/scripts/gazebo /home/piyushk/ros/experimental/stacks/bwi/bwi_gazebo/worlds/ens32.world __name:=ens32_world __log:=/home/piyushk/.ros/log/ce555632-f78c-11e1-888f-848f69a9524e/ens32_world-2.log].
log file: /home/piyushk/.ros/log/ce555632-f78c-11e1-888f-848f69a9524e/ens32_world-2*.log
[person1/spawn_robot-23] process has finished cleanly
log file: /home/piyushk/.ros/log/ce555632-f78c-11e1-888f-848f69a9524e/person1-spawn_robot-23*.log
[segbot1/spawn_robot-6] process has finished cleanly
log file: /home/piyushk/.ros/log/ce555632-f78c-11e1-888f-848f69a9524e/segbot1-spawn_robot-6*.log
Error [Transport.cc:102] Unable to get topic namespaces in [50] tries.
Error [Node.cc:68] No namespace found
terminate called after throwing an instance of 'std::length_error'
what(): basic_string::_S_create
/opt/ros/fuerte/stacks/simulator_gazebo/gazebo/scripts/gui: line 2: 6892 Aborted (core dumped) `rospack find gazebo`/gazebo/bin/gzclient -g `rospack find gazebo`/lib/libgazebo_ros_paths_plugin.so
[gazebo_gui-3] process has died [pid 6082, exit code 134, cmd optirun /opt/ros/fuerte/stacks/simulator_gazebo/gazebo/scripts/gui __name:=gazebo_gui __log:=/home/piyushk/.ros/log/ce555632-f78c-11e1-888f-848f69a9524e/gazebo_gui-3.log].
log file: /home/piyushk/.ros/log/ce555632-f78c-11e1-888f-848f69a9524e/gazebo_gui-3*.log
^C[segbot2/move_base-22] killing on exit
[segbot2/fake_localization-21] killing on exit
[segbot2/map_tf_provider-20] killing on exit
[segbot2/kinect_laser_narrow-19] killing on exit
[segbot2/kinect_laser-18] killing on exit
[segbot2/pointcloud_throttle-17] killing on exit
[segbot2/openni_manager-16] killing on exit
[segbot2/spawn_robot-15] killing on exit
[segbot2/robot_state_publisher-14] killing on exit
[segbot1/move_base-13] killing on exit
[segbot1/fake_localization-12] killing on exit
[segbot1/map_tf_provider-11] killing on exit
[segbot1/kinect_laser_narrow-10] killing on exit
[segbot1/kinect_laser-9] killing on exit
[segbot1/pointcloud_throttle-8] killing on exit
[segbot1/openni_manager-7] killing on exit
[segbot1/robot_state_publisher-5] killing on exit
[bwi_map_server-4] killing on exit
Traceback (most recent call last):
File "/home/piyushk/ros/experimental/stacks/bwi/bwi_apps/scripts/bwi_map_server", line 216, in <module>
MapServer()
File "/home/piyushk/ros/experimental/stacks/bwi/bwi_apps/scripts/bwi_map_server", line 151, in __init__
rate.sleep();
File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/timer.py", line 78, in sleep
sleep(self.sleep_dur - elapsed)
File "/opt/ros/fuerte/lib/python2.7/dist-packages/rospy/timer.py", line 133, in sleep ...
one way to begin the debugging process is to start gazebo with gdb attached (i.e. roslaunch gazebo_worlds debug.launch) and look at the backtrace of gzserver when it segfaults.
@hsu: see end of updated question.