How to start gazebo using roscore & rosrun gazebo_ros gazebo?

asked 2014-09-11 04:20:30 -0600

Orso gravatar image

updated 2014-09-17 07:25:29 -0600

I am unable to start gazebo with the following command:

roscore & rosrun gazebo_ros gazebo

this produces the following:

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc

Yet, I am able to start gazebo using roscore, gzserver and gzclient in separate terminals. Running ROS hydro, ubuntu 12.04. P.S. Also posted this on ROS forum here: link text

edit 1

roslaunch gazebo_ros empty_world.launch

produces the following:

PARAMETERS
* /rosdistro
* /rosversion
* /use_sim_time
NODES
 /
gazebo (gazebo_ros/gzserver)
gazebo_gui (gazebo_ros/gzclient)
auto-starting new master
process[master]: started with pid [2049]
ROS_MASTER_URI=http://localhost:11311
setting /run_id to c42a8666-375c-11e4-8516-08002748e08d
process[rosout-1]: started with pid [2062]
started core service [/rosout]
process[gazebo-2]: started with pid [2065]
process[gazebo_gui-3]: started with pid [2079]
terminate called after throwing an instance of 'std::bad_alloc'
what():  std::bad_alloc
Aborted (core dumped)
[gazebo-2] process has died [pid 2065, exit code 134, cmd /opt/ros/hydro/lib/gazebo_ros/gzserver /opt/ros/hydro/share/hector_gazebo_worlds/worlds/rolling_landscape_120m.world __name:=gazebo __log:=/home/usr/.ros/log/c42a8666-375c-11e4-8516-08002748e08d/gazebo-2.log].
log file: /home/usr/.ros/log/c42a8666-375c-11e4-8516-08002748e08d/gazebo-2*.log

edit 2

For backtrace I type:

gdb gzserver empty_world.launch

Then the following appears:


GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http: gnu.org="" licenses="" gpl.html="">
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http: bugs.launchpad.net="" gdb-linaro=""/>...
Reading symbols from /usr/local/bin/gzserver...done.
/home/daniel/empty_world.launch: No such file or directory.
(gdb)

Then I type: run The following appears:


Starting program: /usr/local/bin/gzserver 
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe200f700 (LWP 2754)]
[New Thread 0x7fffe180e700 (LWP 2755)]
[New Thread 0x7fffe100d700 (LWP 2756)]
[New Thread 0x7fffd3fff700 (LWP 2757)]
[New Thread 0x7fffd1064700 (LWP 2758)]
[New Thread 0x7fffd0863700 (LWP 2759)]
[New Thread 0x7fffc9d55700 (LWP 2760)]
[New Thread 0x7fffc9554700 (LWP 2761)]
[New Thread 0x7fffc8731700 (LWP 2762)]
[New Thread 0x7fffbbfff700 (LWP 2763)]
[New Thread 0x7fffbb7fe700 (LWP 2764)]
[New Thread 0x7fffbaffd700 (LWP 2765)]
[New Thread 0x7fffba7fc700 (LWP 2766)]

And never goes to segfault.

edit 3

I run the following:

rosrun gazebo_ros debug

This produces:


GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http: gnu.org="" licenses="" gpl.html="">
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http: bugs.launchpad.net="" gdb-linaro=""/>...
Reading symbols from /usr/local/bin/gzserver...done.
warning: no loadable ...
(more)
edit retag flag offensive close merge delete

Comments

Have you tried roslaunch gazebo_ros empty_world.launch?

scpeters gravatar imagescpeters ( 2014-09-12 01:45:45 -0600 )edit

It looks like a similar error for rosrun gazebo_ros gazebo and roslaunch gazebo_ros empty_world.launch

Orso gravatar imageOrso ( 2014-09-12 16:45:21 -0600 )edit
scpeters gravatar imagescpeters ( 2014-09-12 22:12:44 -0600 )edit

This will be a useful tutorial for generating the core file: http://wiki.ros.org/roslaunch/Tutorials/Roslaunch%20Nodes%20in%20Valgrind%20or%20GDB then try gdb gzserver corefile then run command thread apply all bt and paste the output here or in a gist so we can look at it

scpeters gravatar imagescpeters ( 2014-09-14 19:31:26 -0600 )edit

Nevermind, looks like you posted it...

scpeters gravatar imagescpeters ( 2014-09-14 19:33:32 -0600 )edit

The main thing I'm trying to find is which code statement triggered the problem. It looks like it came from gazebo::event::Events::ConnectWorldCreated (#11) called by gazebo::GazeboRosApiPlugin::Load (#12). I am investigating further...

scpeters gravatar imagescpeters ( 2014-09-14 19:45:50 -0600 )edit

Thanks for investigating scpeters. Do you suggest I try a reinstall? Though, this will not be so helpful for the next lad that confronts this same problem, which could be me again.

Orso gravatar imageOrso ( 2014-09-15 10:55:56 -0600 )edit

I've looked into the problem, but I'm not sure what caused it. Did you say that reinstalling fixed the problem? If that's the case, then it would be very difficult to reproduce, which makes it hard for me to debug.

scpeters gravatar imagescpeters ( 2014-09-22 12:02:04 -0600 )edit

Yes, re-install fixed the problem. It must be my own error as others have not experienced this. I will keep an eye out for any similar problems. thanks for your investigation. Do I need to credit you or close the question?

Orso gravatar imageOrso ( 2014-09-22 13:36:41 -0600 )edit
1

Why don't you post an answer saying that a re-build and re-install fixed the problem? I'll upvote it.

scpeters gravatar imagescpeters ( 2014-09-22 13:42:16 -0600 )edit