gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.17k stars 477 forks source link

SensorManager_TEST seg-fault: corrupted double-linked list #1136

Open osrf-migration opened 10 years ago

osrf-migration commented 10 years ago

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


I have been getting seg-faults in the UNIT_SensorManager_TEST about 30% of the time in my overnight testing. I just switched to saucy, using default ogre package 1.8.0. It happens on the gazebo_3.0 and default branches.

The SensorManager_TEST.InitRemove test fails during teardown (ie. after the [Dbg] [ServerFixture.cc:95] ServerFixture::Unload message has printed) with an error message about a corrupted double-linked list

119: [ RUN      ] SensorManager_TEST.InitRemove
119: [Msg] Waiting for master.
119: [Msg] Connected to gazebo master @ http://127.0.0.1:11345
119: [Msg] Publicized address: 192.168.1.191
119: [Dbg] [ServerFixture.cc:144] ServerFixture load in 2.5 seconds, timeout after 600 seconds
119: Done done
119: [Dbg] [ServerFixture.cc:95] ServerFixture::Unload
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::base_footprint::base_contact_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::base_footprint::base_laser] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::torso_lift_link::torso_lift_contact_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::head_tilt_link::head_mount_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::head_tilt_link::head_mount_prosilica_link_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::head_tilt_link::head_mount_prosilica_link_sim_pcd_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::head_tilt_link::narrow_stereo_gazebo_l_stereo_camera_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::head_tilt_link::narrow_stereo_gazebo_r_stereo_camera_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::head_tilt_link::wide_stereo_gazebo_l_stereo_camera_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::head_tilt_link::wide_stereo_gazebo_r_stereo_camera_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::head_tilt_link::high_def_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::l_forearm_roll_link::l_forearm_cam_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::l_gripper_l_finger_tip_link::l_gripper_l_finger_tip_contact_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::l_gripper_r_finger_tip_link::l_gripper_r_finger_tip_contact_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::laser_tilt_mount_link::laser_tilt] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::r_forearm_roll_link::r_forearm_cam_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::r_gripper_l_finger_tip_link::r_gripper_l_finger_tip_contact_sensor] because it does not exist.
119: [Err] [SensorManager.cc:354] Unable to remove sensor[default::pr2::r_gripper_r_finger_tip_link::r_gripper_r_finger_tip_contact_sensor] because it does not exist.
119: *** Error in `/tmp/gazebo_build/source/build/gazebo/sensors/UNIT_SensorManager_TEST':
 corrupted double-linked list: 0x00002b52ee5c8700 ***

A backtrace implicates the removal of projectors in Scene::RemoveVisual:

Thread 2 (Thread 0x7f6dc10c7700 (LWP 7035)):
#0  __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007f6dda400f1c in _L_lock_11850 () at malloc.c:5151
#2  0x00007f6dda3fe4c5 in __GI___libc_malloc (bytes=56) at malloc.c:2856
...
#14 0x00007f6dda3ef515 in __libc_message (do_abort=do_abort@entry=2, 
    fmt=fmt@entry=0x7f6dda503240 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/unix/sysv/linux/libc_fatal.c:178
#15 0x00007f6dda3fa4c6 in malloc_printerr (action=3, str=0x7f6dda4ff1e8 "corrupted double-linked list", ptr=<optimized out>)
    at malloc.c:4923
#16 0x00007f6dda3fbcb9 in _int_free (av=0x7f6db4000020, p=0x7f6d326242d0, have_lock=0) at malloc.c:3933
#17 0x00007f6ddcd9d1ff in gazebo::rendering::Scene::RemoveVisual (this=this@entry=0x7f6d3a469c10, _vis=...)
    at gazebo/rendering/Scene.cc:2689
#18 0x00007f6ddcda2e00 in gazebo::rendering::Scene::Clear (this=0x7f6d3a469c10)
    at gazebo/rendering/Scene.cc:189
#19 0x00007f6ddcd89467 in gazebo::rendering::RenderEngine::RemoveScene (
    this=this@entry=0x7f6ddd30c6a0 <SingletonT<gazebo::rendering::RenderEngine>::GetInstance()::t>, _name=...)
    at gazebo/rendering/RenderEngine.cc:218
#20 0x00007f6ddcd89617 in gazebo::rendering::RenderEngine::Fini (
    this=this@entry=0x7f6ddd30c6a0 <SingletonT<gazebo::rendering::RenderEngine>::GetInstance()::t>)
    at gazebo/rendering/RenderEngine.cc:326
#21 0x00007f6ddcd90121 in gazebo::rendering::fini ()
    at gazebo/rendering/RenderingIface.cc:66
#22 0x00007f6ddd0bc706 in gazebo::sensors::fini ()
    at gazebo/sensors/SensorsIface.cc:71
#23 0x0000000000462ed4 in gazebo::shutdown () at gazebo/gazebo.cc:247
#24 0x00000000004563f8 in gazebo::Server::Run (this=0x7f6d4085c0a0)
    at gazebo/Server.cc:479
#25 0x000000000043fcc3 in ServerFixture::RunServer (this=0xa6d220, _worldFilename=..., _paused=<optimized out>, _physics=...)
    at test/ServerFixture.cc:233
#26 0x00007f6ddb82894a in ?? () from /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0
#27 0x00007f6ddc4c1f6e in start_thread (arg=0x7f6dc10c7700) at pthread_create.c:311
#28 0x00007f6dda4759cd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

backtrace for all threads here

osrf-migration commented 10 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


Perhaps we should consider using shared pointers for the projectors instead of raw pointers?

See Scene.hh:

/// \brief All the projectors.
private: std::map<std::string, Projector *> projectors;
osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).