srmainwaring / asv_wave_sim

This package contains plugins that support the simulation of waves and surface vessels in Gazebo.
GNU General Public License v3.0
114 stars 31 forks source link

Waves model segfault on exit #55

Open srmainwaring opened 2 years ago

srmainwaring commented 2 years ago

The waves model segfaults on exit. This occurs for both the client and server.

server

% gz sim -v4 -s -r waves.sdf 
...
[Msg] Publishing dynamic pose messages on [/world/waves/dynamic_pose/info]
^C[Dbg] [SignalHandler.cc:141] Received signal[2].
[Dbg] [ServerPrivate.cc:110] Server received signal[2]
[Dbg] [Sensors.cc:420] SensorsPrivate::Stop
[Dbg] [Sensors.cc:263] Rendering Thread initialized
[Dbg] [Sensors.cc:406] SensorsPrivate::RenderThread stopped
[Dbg] [gz.cc:356] Shutting down gz-sim-server
[Dbg] [SimulationRunner.cc:521] [Dbg] [SimulationRunner.cc:521] [Dbg] [SimulationRunner.cc:521] [Dbg] [SimulationRunner.cc:521] Exiting postupdate worker thread (Exiting postupdate worker thread (Exiting postupdate worker thread ()
20)
)
Stack trace (most recent call last):
#25   Object "ruby", at 0x108d82f09, in main + 99
#24   Object "libruby.3.0.dylib", at 0x108dfc573, in ruby_run_node + 86
#23   Object "libruby.3.0.dylib", at 0x108dfc6df, in rb_ec_exec_node + 288
#22   Object "libruby.3.0.dylib", at 0x108f3bcc0, in rb_vm_exec + 1907
#21   Object "libruby.3.0.dylib", at 0x108f2caa5, in vm_exec_core + 7454
#20   Object "libruby.3.0.dylib", at 0x108f3facd, in vm_sendish + 1292
#19   Object "libruby.3.0.dylib", at 0x108f457ff, in vm_call_cfunc_with_frame + 345
#18   Object "fiddle.bundle", at 0x10a5cc71a, in function_call + 1486
#17   Object "libruby.3.0.dylib", at 0x108f07da4, in rb_nogvl + 178
#16   Object "fiddle.bundle", at 0x10a5ccd0f, in nogvl_ffi_call + 26
#15   Object "libffi.dylib", at 0x7fff2d95c22c, in ffi_call_int + 698
#14   Object "libffi.dylib", at 0x7fff2d95c8f5, in ffi_call_unix64 + 85
#13   Object "libgz-sim7-gz.7.0.0~pre1.dylib", at 0x10a6143bc, in runServer + 4220
#12   Object "libgz-sim7.7.dylib", at 0x10aac3fad, in gz::sim::v7::Server::~Server() + 29
#11   Object "libgz-sim7.7.dylib", at 0x10aaccc10, in gz::sim::v7::ServerPrivate::~ServerPrivate() + 592
#10   Object "libgz-sim7.7.dylib", at 0x10aadcaae, in gz::sim::v7::SimulationRunner::~SimulationRunner() + 14
#9    Object "libgz-sim7.7.dylib", at 0x10aadc82c, in gz::sim::v7::SimulationRunner::~SimulationRunner() + 1196
#8    Object "libgz-sim7.7.dylib", at 0x10aae231f, in gz::sim::v7::SystemManager::~SystemManager() + 303
#7    Object "libgz-sim7.7.dylib", at 0x10aaf0492, in gz::plugin::detail::ComposePlugin<gz::plugin::SpecializedPlugin<gz::sim::v7::System>, gz::plugin::SpecializedPlugin<gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate> >::~ComposePlugin() + 18
#6    Object "libgz-plugin2.2.dylib", at 0x10b405fa2, in gz::plugin::Plugin::~Plugin() + 114
#5    Object "libgz-plugin2.2.dylib", at 0x10b40682e, in gz::plugin::PluginWithDlHandle::~PluginWithDlHandle() + 46
#4    Object "libgz-waves1-waves-visual-system.1.", at 0x12e98b203, in gz::sim::v7::systems::WavesVisual::~WavesVisual() + 67
#3    Object "libgz-waves1-waves-visual-system.1.", at 0x12e990b11, in gz::sim::v7::systems::WavesVisualPrivate::~WavesVisualPrivate() + 97
#2    Object "libsystem_platform.dylib", at 0x7fff203c0d7c, in _sigtramp + 28
#1    Object "libgz-tools2-backward.dylib", at 0x10a5ddfad, in backward::SignalHandling::sig_handler(int, __siginfo*, void*) + 13
#0    Object "libgz-tools2-backward.dylib", at 0x10a5de016, in backward::SignalHandling::handleSignal(int, __siginfo*, void*) + 70
zsh: segmentation fault  gz sim -v4 -s -r waves.sdf

client

% gz sim -v4 -g
...
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [EntityContextMenuPlugin.cc:79] Entity context menu plugin is using camera [scene::Camera(65527)]
^C[GUI] [Dbg] [SignalHandler.cc:141] Received signal[2].
[GUI] [Dbg] [Gui.cc:331] Shutting down gz-sim-gui
[GUI] [Dbg] [Application.cc:165] Terminating application.
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Dbg] [MinimalScene.cc:662] Destroy scene [scene]
Stack trace (most recent call last) in thread 123145401655296:
#24   Object "libsystem_pthread.dylib", at 0x7fff2037b8fc, in _pthread_start + 224
#23   Object "QtCore", at 0x10b5a7b3a, in QThread::qt_metacall(QMetaObject::Call, int, void**) + 1178
#22   Object "QtCore", at 0x10b5a6c2c, in QThread::exec() + 140
#21   Object "QtCore", at 0x10b7670c7, in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 471
#20   Object "QtCore", at 0x10b7c9dd9, in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 73
#19   Object "QtCore", at 0x10b76bbd8, in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 792
#18   Object "QtCore", at 0x10b76aac7, in QCoreApplication::notifyInternal2(QObject*, QEvent*) + 167
#17   Object "QtWidgets", at 0x10a9f6a00, in QApplication::notify(QObject*, QEvent*) + 480
#16   Object "QtWidgets", at 0x10a9f5646, in QApplicationPrivate::notify_helper(QObject*, QEvent*) + 262
#15   Object "QtCore", at 0x10b7936e9, in QObject::event(QEvent*) + 745
#14   Object "libMinimalScene.dylib", at 0x138515f36, in gz::gui::plugins::RenderThread::ShutDown() + 22
#13   Object "libMinimalScene.dylib", at 0x138520745, in gz::gui::plugins::RenderThreadRhiMetal::ShutDown() + 21
#12   Object "libMinimalScene.dylib", at 0x1385156c9, in gz::gui::plugins::GzRenderer::Destroy() + 665
#11   Object "libgz-rendering7.7.dylib", at 0x13857b189, in gz::rendering::v7::BaseRenderEngine::DestroyScene(std::__1::shared_ptr<gz::rendering::v7::Scene>) + 73
#10   Object "libgz-waves1-waves-visual-system.1.", at 0x143420b08, in gz::rendering::v7::BaseStore<gz::rendering::v7::Scene, gz::rendering::v7::Ogre2Scene>::Destroy(std::__1::shared_ptr<gz::rendering::v7::Scene>) + 120
#9    Object "libgz-waves1-waves-visual-system.1.", at 0x1434332ae, in gz::rendering::v7::BaseStore<gz::rendering::v7::Scene, gz::rendering::v7::Ogre2Scene>::DestroyImpl(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<gz::rendering::v7::Ogre2Scene> >, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<gz::rendering::v7::Ogre2Scene> >, void*>*, long> >) + 46
#8    Object "libgz-rendering7-ogre2.7.dylib", at 0x14358f412, in gz::rendering::v7::Ogre2Scene::Destroy() + 34
#7    Object "libOgreMain.2.2.6.dylib", at 0x143aabf23, in Ogre::SceneManager::destroyAllMovableObjectsByType(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 291
#6    Object "libOgreMain.2.2.6.dylib", at 0x1439b45ae, in Ogre::Item::~Item() + 14
#5    Object "libOgreMain.2.2.6.dylib", at 0x1439b4403, in Ogre::Item::~Item() + 99
#4    Object "libOgreMain.2.2.6.dylib", at 0x143a73dc8, in Ogre::Renderable::~Renderable() + 40
#3    Object "libOgreMain.2.2.6.dylib", at 0x143969467, in Ogre::HlmsDatablock::_unlinkRenderable(Ogre::Renderable*) + 39
#2    Object "libsystem_platform.dylib", at 0x7fff203c0d7c, in _sigtramp + 28
#1    Object "libgz-tools2-backward.dylib", at 0x1088d3fad, in backward::SignalHandling::sig_handler(int, __siginfo*, void*) + 13
#0    Object "libgz-tools2-backward.dylib", at 0x1088d4016, in backward::SignalHandling::handleSignal(int, __siginfo*, void*) + 70
zsh: segmentation fault  gz sim -v4 -g
srmainwaring commented 2 years ago

Notes

  1. How to trigger the segfault when debugging in vscode.

VSCode does not currently capture Ctrl-C in the debug window. An alternative method to trigger the fault when debugging is to send a kill signal from the terminal to the process.

  1. Possible cause of server fault.

The problem appears to be dangling pointers left in the plugin when the simulation shuts down. The immediate problem is the clean up code in ~WavesVisualPrivate, but a more general problem is understanding the correct procedure to close plugins that have acquired resources during their initialisation / lifetime.

gz::sim::v7::systems::WavesVisualPrivate::~WavesVisualPrivate() (/Volumes/MacPro2_DV1/Code/robotics/gz_waves_ws/src/asv_wave_sim/gz-waves/src/systems/waves/WavesVisual.cc:695)
gz::sim::v7::systems::WavesVisualPrivate::~WavesVisualPrivate() (/Volumes/MacPro2_DV1/Code/robotics/gz_waves_ws/src/asv_wave_sim/gz-waves/src/systems/waves/WavesVisual.cc:689)
std::__1::default_delete<gz::sim::v7::systems::WavesVisualPrivate>::operator()(gz::sim::v7::systems::WavesVisualPrivate*) const (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1428)
std::__1::unique_ptr<gz::sim::v7::systems::WavesVisualPrivate, std::__1::default_delete<gz::sim::v7::systems::WavesVisualPrivate> >::reset(gz::sim::v7::systems::WavesVisualPrivate*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1689)
std::__1::unique_ptr<gz::sim::v7::systems::WavesVisualPrivate, std::__1::default_delete<gz::sim::v7::systems::WavesVisualPrivate> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
std::__1::unique_ptr<gz::sim::v7::systems::WavesVisualPrivate, std::__1::default_delete<gz::sim::v7::systems::WavesVisualPrivate> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
gz::sim::v7::systems::WavesVisual::~WavesVisual() (/Volumes/MacPro2_DV1/Code/robotics/gz_waves_ws/src/asv_wave_sim/gz-waves/src/systems/waves/WavesVisual.cc:478)
gz::sim::v7::systems::WavesVisual::~WavesVisual() (/Volumes/MacPro2_DV1/Code/robotics/gz_waves_ws/src/asv_wave_sim/gz-waves/src/systems/waves/WavesVisual.cc:477)
gz::sim::v7::systems::WavesVisual::~WavesVisual() (/Volumes/MacPro2_DV1/Code/robotics/gz_waves_ws/src/asv_wave_sim/gz-waves/src/systems/waves/WavesVisual.cc:477)
std::__1::__function::__value_func<void (void*)>::operator()(void*&&) const (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/functional:1885)
std::__1::function<void (void*)>::operator()(void*) const (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/functional:2560)
gz::plugin::PluginWithDlHandle::~PluginWithDlHandle() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-plugin/core/src/Plugin.cc:64)
std::__1::__shared_count::__release_shared() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:2506)
std::__1::__shared_weak_count::__release_shared() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:2548)
std::__1::shared_ptr<void>::~shared_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:3238)
std::__1::shared_ptr<void>::~shared_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:3236)
gz::plugin::Plugin::Implementation::~Implementation() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-plugin/core/src/Plugin.cc:107)
gz::plugin::Plugin::Implementation::~Implementation() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-plugin/core/src/Plugin.cc:107)
std::__1::default_delete<gz::plugin::Plugin::Implementation>::operator()(gz::plugin::Plugin::Implementation*) const (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1428)
std::__1::unique_ptr<gz::plugin::Plugin::Implementation, std::__1::default_delete<gz::plugin::Plugin::Implementation> >::reset(gz::plugin::Plugin::Implementation*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1689)
std::__1::unique_ptr<gz::plugin::Plugin::Implementation, std::__1::default_delete<gz::plugin::Plugin::Implementation> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
std::__1::unique_ptr<gz::plugin::Plugin::Implementation, std::__1::default_delete<gz::plugin::Plugin::Implementation> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
gz::plugin::Plugin::~Plugin() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-plugin/core/src/Plugin.cc:389)
gz::plugin::detail::SelectSpecializers<gz::plugin::detail::ComposePlugin<gz::plugin::SpecializedPlugin<gz::sim::v7::System>, gz::plugin::SpecializedPlugin<gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate> > >::~SelectSpecializers() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/install/include/gz/plugin2/gz/plugin/detail/SpecializedPlugin.hh:205)
gz::plugin::detail::SelectSpecializers<gz::plugin::detail::ComposePlugin<gz::plugin::SpecializedPlugin<gz::sim::v7::System>, gz::plugin::SpecializedPlugin<gz::sim::v7::ISystemConfigure, gz::sim::v7::ISystemPreUpdate, gz::sim::v7::ISystemUpdate, gz::sim::v7::ISystemPostUpdate> > >::~SelectSpecializers() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/install/include/gz/plugin2/gz/plugin/detail/SpecializedPlugin.hh:205)
gz::sim::v7::SystemInternal::~SystemInternal() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/SystemInternal.hh:39)
std::__1::allocator<gz::sim::v7::SystemInternal>::destroy(gz::sim::v7::SystemInternal*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:921)
void std::__1::allocator_traits<std::__1::allocator<gz::sim::v7::SystemInternal> >::destroy<gz::sim::v7::SystemInternal, void>(std::__1::allocator<gz::sim::v7::SystemInternal>&, gz::sim::v7::SystemInternal*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/__memory/allocator_traits.h:307)
std::__1::__vector_base<gz::sim::v7::SystemInternal, std::__1::allocator<gz::sim::v7::SystemInternal> >::__destruct_at_end(gz::sim::v7::SystemInternal*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:428)
std::__1::__vector_base<gz::sim::v7::SystemInternal, std::__1::allocator<gz::sim::v7::SystemInternal> >::clear() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:371)
std::__1::__vector_base<gz::sim::v7::SystemInternal, std::__1::allocator<gz::sim::v7::SystemInternal> >::~__vector_base() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:465)
std::__1::vector<gz::sim::v7::SystemInternal, std::__1::allocator<gz::sim::v7::SystemInternal> >::~vector() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:557)
std::__1::vector<gz::sim::v7::SystemInternal, std::__1::allocator<gz::sim::v7::SystemInternal> >::~vector() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:552)
gz::sim::v7::SystemManager::~SystemManager() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/SystemManager.hh:40)
gz::sim::v7::SystemManager::~SystemManager() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/SystemManager.hh:40)
std::__1::default_delete<gz::sim::v7::SystemManager>::operator()(gz::sim::v7::SystemManager*) const (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1428)
std::__1::unique_ptr<gz::sim::v7::SystemManager, std::__1::default_delete<gz::sim::v7::SystemManager> >::reset(gz::sim::v7::SystemManager*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1689)
std::__1::unique_ptr<gz::sim::v7::SystemManager, std::__1::default_delete<gz::sim::v7::SystemManager> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
std::__1::unique_ptr<gz::sim::v7::SystemManager, std::__1::default_delete<gz::sim::v7::SystemManager> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
gz::sim::v7::SimulationRunner::~SimulationRunner() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/SimulationRunner.cc:249)
gz::sim::v7::SimulationRunner::~SimulationRunner() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/SimulationRunner.cc:247)
gz::sim::v7::SimulationRunner::~SimulationRunner() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/SimulationRunner.cc:247)
std::__1::default_delete<gz::sim::v7::SimulationRunner>::operator()(gz::sim::v7::SimulationRunner*) const (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1428)
std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >::reset(gz::sim::v7::SimulationRunner*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1689)
std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
std::__1::allocator<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> > >::destroy(std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:921)
void std::__1::allocator_traits<std::__1::allocator<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> > > >::destroy<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >, void>(std::__1::allocator<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> > >&, std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/__memory/allocator_traits.h:307)
std::__1::__vector_base<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >, std::__1::allocator<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> > > >::__destruct_at_end(std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:428)
std::__1::__vector_base<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >, std::__1::allocator<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> > > >::clear() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:371)
std::__1::__vector_base<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >, std::__1::allocator<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> > > >::~__vector_base() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:465)
std::__1::vector<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >, std::__1::allocator<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> > > >::~vector() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:557)
std::__1::vector<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> >, std::__1::allocator<std::__1::unique_ptr<gz::sim::v7::SimulationRunner, std::__1::default_delete<gz::sim::v7::SimulationRunner> > > >::~vector() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/vector:552)
gz::sim::v7::ServerPrivate::~ServerPrivate() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/ServerPrivate.cc:105)
std::__1::default_delete<gz::sim::v7::ServerPrivate>::operator()(gz::sim::v7::ServerPrivate*) const (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1428)
std::__1::unique_ptr<gz::sim::v7::ServerPrivate, std::__1::default_delete<gz::sim::v7::ServerPrivate> >::reset(gz::sim::v7::ServerPrivate*) (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1689)
std::__1::unique_ptr<gz::sim::v7::ServerPrivate, std::__1::default_delete<gz::sim::v7::ServerPrivate> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
std::__1::unique_ptr<gz::sim::v7::ServerPrivate, std::__1::default_delete<gz::sim::v7::ServerPrivate> >::~unique_ptr() (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk/usr/include/c++/v1/memory:1643)
gz::sim::v7::Server::~Server() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/Server.cc:163)
gz::sim::v7::Server::~Server() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/Server.cc:163)
::runServer(const char *, int, int, float, int, const char *, int, int, const char *, int, int, int, const char *, const char *, const char *, const char *, const char *, const char *, int) (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-sim/src/gz.cc:358)
ffi_call_unix64 (@ffi_call_unix64:25)
ffi_call_int (@ffi_call_int:182)
nogvl_ffi_call (@nogvl_ffi_call:11)
rb_nogvl (@rb_nogvl:56)
function_call (@function_call:377)
vm_call_cfunc_with_frame (@vm_call_cfunc_with_frame:88)
vm_sendish (@vm_sendish:357)
vm_exec_core (@vm_exec_core:2113)
rb_vm_exec (@rb_vm_exec:477)
rb_ec_exec_node (@rb_ec_exec_node:78)
ruby_run_node (@ruby_run_node:30)
main (@main:29)
start (@start:4)
  1. Possible cause of client fault.

Seeing the error referred to here:

https://github.com/gazebosim/gz-rendering/blob/7c5fbf18458229e728e1b5d7e3e9b52d5453008d/ogre2/src/Ogre2Scene.cc#L410-L428

//////////////////////////////////////////////////
void Ogre2Scene::Destroy()
{
  this->DestroyNodes();

  // cleanup any items that were not attached to nodes
  // make sure to do this before destroying materials done by BaseScene::Destroy
  // otherwise ogre throws an exception when unlinking a renderable from a
  // hlms datablock
  this->ogreSceneManager->destroyAllItems();

  BaseScene::Destroy();

  if (this->ogreSceneManager)
  {
    this->ogreSceneManager->removeRenderQueueListener(
        Ogre2RenderEngine::Instance()->OverlaySystem());
  }
}

The exception is thrown in the MinimalScene plugin gz::gui::plugins::RenderThread.

Ogre::HlmsDatablock::_unlinkRenderable(Ogre::Renderable*) (@Ogre::HlmsDatablock::_unlinkRenderable(Ogre::Renderable*):15)
Ogre::Renderable::~Renderable() (@Ogre::Renderable::~Renderable():17)
Ogre::Item::~Item() (@Ogre::Item::~Item():27)
Ogre::Item::~Item() (@Ogre::Item::~Item():9)
Ogre::SceneManager::destroyAllMovableObjectsByType(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (@Ogre::SceneManager::destroyAllMovableObjectsByType(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&):84)
gz::rendering::v7::Ogre2Scene::Destroy() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-rendering/ogre2/src/Ogre2Scene.cc:419)
gz::rendering::v7::BaseStore<gz::rendering::v7::Scene, gz::rendering::v7::Ogre2Scene>::DestroyImpl(std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<gz::rendering::v7::Ogre2Scene> >, std::__1::__tree_node<std::__1::__value_type<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<gz::rendering::v7::Ogre2Scene> >, void*>*, long> >) (/Users/rhys/Code/osrf/gz_garden_ws/install/include/gz/rendering7/gz/rendering/base/BaseStorage.hh:956)
gz::rendering::v7::BaseStore<gz::rendering::v7::Scene, gz::rendering::v7::Ogre2Scene>::Destroy(std::__1::shared_ptr<gz::rendering::v7::Scene>) (/Users/rhys/Code/osrf/gz_garden_ws/install/include/gz/rendering7/gz/rendering/base/BaseStorage.hh:699)
gz::rendering::v7::BaseRenderEngine::DestroyScene(std::__1::shared_ptr<gz::rendering::v7::Scene>) (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-rendering/src/base/BaseRenderEngine.cc:163)
gz::gui::plugins::GzRenderer::Destroy() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-gui/src/plugins/minimal_scene/MinimalScene.cc:663)
gz::gui::plugins::RenderThreadRhiMetal::ShutDown() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-gui/src/plugins/minimal_scene/MinimalSceneRhiMetal.mm:152)
gz::gui::plugins::RenderThread::ShutDown() (/Volumes/MacPro2_DV1/Code/osrf/gz_garden_ws/src/gz-gui/src/plugins/minimal_scene/MinimalScene.cc:730)
QObject::event(QEvent*) (@QObject::event(QEvent*):191)
QApplicationPrivate::notify_helper(QObject*, QEvent*) (@QApplicationPrivate::notify_helper(QObject*, QEvent*):85)
QApplication::notify(QObject*, QEvent*) (@QApplication::notify(QObject*, QEvent*):124)
QCoreApplication::notifyInternal2(QObject*, QEvent*) (@QCoreApplication::notifyInternal2(QObject*, QEvent*):54)
QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (@QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*):218)
QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (@QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>):24)
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (@QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>):136)
QThread::exec() (@QThread::exec():45)
___lldb_unnamed_symbol7131 (@___lldb_unnamed_symbol7131:91)
_pthread_start (@_pthread_start:54)
thread_start (@thread_start:8)