gazebosim / gazebosim/gz-rendering

Sporadic GUI crash when removing model from scene

Open
#997 0 comments 0 reactions 1 assignee Claimed by @iche033 View on GitHub
bug
Dominant language
C++
Stars
81
Forks
90
Avg merge
1d 13h
Merged PRs (30d)
10

Description

Running gazebo harmonic compiled from source on Ubuntu 22.04. Occasionally, when removing a model from the scene using the /world/empty/remove service call , the GUI crashes with the following backtrace:

```
...
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::JointPositionController] for entity [61]
[Dbg] [UserCommands.cc:1311] Created entity [61] named [rotobox]
[Dbg] [SimulationRunner.cc:574] Exiting postupdate worker thread (0)
[Dbg] [SimulationRunner.cc:574] Exiting postupdate worker thread (1)
[Dbg] [SimulationRunner.cc:547] Creating PostUpdate worker threads: 3
[Dbg] [SimulationRunner.cc:558] Creating postupdate worker thread (0)
[Dbg] [SimulationRunner.cc:558] Creating postupdate worker thread (1)
[Dbg] [JointPositionController.cc:376] Identified joint [tobox] as Entity [69]
[Dbg] [UserCommands.cc:1361] Requesting removal of entity [61]
[Wrn] [JointPositionController.cc:332] JointPositionController model no longer valid. Disabling plugin.
gz sim gui: ./OgreMain/src/Vao/OgreVaoManager.cpp:583: void Ogre::VaoManager::destroyDelayedBuffers(Ogre::uint8): Assertion `mFrameCount - itor->frame == mDynamicBufferMultiplier && "Delayed buffer must be destroyed in the last buffered frame!"' failed.
Stack trace (most recent call last) in thread 621346:
#28 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in
#27 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x735ee632684f, in
#26 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x735ee6294ac2, in
#25 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x735edf2ccca0, in
#24 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x735edf2cbaf1, in QThread::exec()
#23 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x735edf4b875a, in QEventLoop::exec(QFlags)
#22 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x735edf5130b7, in QEventDispatcherGlib::processEvents(QFlags)
#21 Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x735edc91e3e2, in g_main_context_iteration
#20 Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x735edc976257, in
#19 Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x735edc920d3a, in g_main_context_dispatch
#18 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x735edf513a66, in
#17 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x735edf4bcf26, in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
#16 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x735edf4b9e39, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#15 Object "/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x735edeb6c712, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#14 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x735edf4e741d, in QObject::event(QEvent*)
#13 Object "/home/and502/cvmiam/ws/gz/install/lib/gz-gui-8/plugins/libMinimalScene.so", at 0x735ea02b0438, in gz::gui::plugins::RenderThread::RenderNext(gz::gui::plugins::RenderSync*)
#12 Object "/home/and502/cvmiam/ws/gz/install/lib/gz-gui-8/plugins/libMinimalScene.so", at 0x735ea02c22d8, in gz::gui::plugins::RenderThreadRhiOpenGL::RenderNext(gz::gui::plugins::RenderSync*)
#11 Object "/home/and502/cvmiam/ws/gz/install/lib/gz-gui-8/plugins/libMinimalScene.so", at 0x735ea02ba2f3, in gz::gui::plugins::GzRenderer::Render(gz::gui::plugins::RenderSync*, gz::gui::plugins::RenderThreadRhi&)
#10 Object "/home/and502/cvmiam/ws/gz/install/lib/gz-rendering-8/engine-plugins/libgz-rendering-ogre2.so", at 0x735defbf6634, in gz::rendering::v8::BaseCamera::Update()
#9 Object "/home/and502/cvmiam/ws/gz/install/lib/gz-rendering-8/engine-plugins/libgz-rendering-ogre2.so", at 0x735defcab807, in gz::rendering::v8::Ogre2Scene::FlushGpuCommandsAndStartNewFrame(unsigned char, bool)
#8 Object "/home/and502/cvmiam/ws/gz/install/lib/gz-rendering-8/engine-plugins/libgz-rendering-ogre2.so", at 0x735defcab5e4, in gz::rendering::v8::Ogre2Scene::FlushGpuCommandsOnly()
#7 Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x735def7e7602, in Ogre::CompositorManager2::_updateImplementation()
#6 Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/OGRE/RenderSystem_GL3Plus.so", at 0x735e04449d3d, in Ogre::GL3PlusVaoManager::_update()
#5 Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x735def8167ad, in Ogre::VaoManager::destroyDelayedBuffers(unsigned char)
#4 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x735ee6239e95, in __assert_fail
#3 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x735ee622871a, in
#2 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x735ee62287f2, in abort
#1 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x735ee6242475, in raise
#0 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x735ee62969fc, in pthread_kill
Aborted (Signal sent by tkill() 621182 567601)
```

I'm guessing there is a race condition somewhere resulting in the renderer (or gui) trying to access resources from the recently removed object that are no longer valid. This only happens about once in 20-30 removals or so and I haven't found a way to consistently reproduce it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.