Closed francocipollone closed 3 years ago
Related to crash in description of PR https://github.com/ToyotaResearchInstitute/delphyne_gui/pull/433
I've been trying to solve this crash and I might have found the way.
EDITED: See https://github.com/ToyotaResearchInstitute/delphyne_gui/issues/466#issuecomment-934879760
Old comment:
Syncing with the `QuickWindow` that emits a signal called `Qt::BeforeRendering` seems to be the way to go.
For example, [the `Grid3D` built-in plugin](https://github.com/ignitionrobotics/ign-gui/blob/242dd40ca0181e5a156225b5d4b1599ed9694b6d/src/plugins/grid_3d/Grid3D.cc#L199-L200) uses that technique also.
I've tried it locally, grouping the mesh rendering all synced with the `BeforeRendering` signal, and that solved the issue.
https://github.com/ToyotaResearchInstitute/delphyne_gui/commit/cf721fe4feef6374533431c0964eb0832e3b4e1b
We have to fix this for:
- MaliputViewerPlugin: In this particular plugin, entities in the scene are modified from different methods.
- For Road Meshes.
- For Label mesehs.
- For Lane selector.
- For the Arrow.
- For the TrafficLightManager.
- OriginDisplay
- AgentInfoDisplay
This https://github.com/ToyotaResearchInstitute/delphyne_gui/issues/466#issuecomment-932286396 isn't accurate. The way we are hooking to the Render event is ok and that's the recommended way.
This crashes seems to be related to the way we initialize the plugin. Plugins that needs to be fixed:
Errors message:
Fails when:
Platforms I tried:
Note: Always same error.
Bionic + Citadel
See backtrace
``` Thread 21 "ignition::gui::" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fff7ffff700 (LWP 614)] 0x00007fffae8827f0 in Ogre::Math::calculateBasicFaceNormalWithoutNormalize(Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 (gdb) backtrace #0 0x00007fffae8827f0 in Ogre::Math::calculateBasicFaceNormalWithoutNormalize(Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 #1 0x00007fffae8828c1 in Ogre::Math::intersects(Ogre::Ray const&, Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&, bool, bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 #2 0x00007fffaef1aa18 in ignition::rendering::v3::OgreRayQuery::ClosestPoint() () from /usr/lib/x86_64-linux-gnu/ign-rendering-3/engine-plugins/libignition-rendering-ogre.so #3 0x00007fffd3dcba54 in ignition::gui::plugins::IgnRenderer::ScreenToScene(ignition::math::v6::Vector2Bionic + Fortress
See backtrace
``` Thread 25 "ignition::gui::" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fff6aaab700 (LWP 21615)] 0x00007fffad0157f0 in Ogre::Math::calculateBasicFaceNormalWithoutNormalize(Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 (gdb) backtrace #0 0x00007fffad0157f0 in Ogre::Math::calculateBasicFaceNormalWithoutNormalize(Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 #1 0x00007fffad0158c1 in Ogre::Math::intersects(Ogre::Ray const&, Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&, bool, bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 #2 0x00007fffad742e08 in ignition::rendering::v6::OgreRayQuery::ClosestPoint() () from /usr/lib/x86_64-linux-gnu/ign-rendering-6/engine-plugins/libignition-rendering-ogre.so #3 0x00007fffd32f4e64 in ignition::gui::plugins::IgnRenderer::ScreenToScene(ignition::math::v6::Vector2Focal + Citadel
See backtrace
``` Thread 21 "ignition::gui::" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffa09c4700 (LWP 8448)] 0x00007fffc56f7f54 in Ogre::Math::calculateBasicFaceNormalWithoutNormalize(Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 c--TypeFocal + Fortress
See backtrace
``` Thread 25 "ignition::gui::" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fff82bfe700 (LWP 5221)] 0x00007fffb74faf54 in Ogre::Math::calculateBasicFaceNormalWithoutNormalize(Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 (gdb) backtrace #0 0x00007fffb74faf54 in Ogre::Math::calculateBasicFaceNormalWithoutNormalize(Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 #1 0x00007fffb74fb0a5 in Ogre::Math::intersects(Ogre::Ray const&, Ogre::Vector3 const&, Ogre::Vector3 const&, Ogre::Vector3 const&, bool, bool) () from /usr/lib/x86_64-linux-gnu/libOgreMain.so.1.9.0 #2 0x00007fffc433a7bf in ignition::rendering::v6::OgreRayQuery::ClosestPoint() () from /usr/lib/x86_64-linux-gnu/ign-rendering-6/engine-plugins/libignition-rendering-ogre.so #3 0x00007fffe80b1295 in ignition::gui::plugins::IgnRenderer::ScreenToScene(ignition::math::v6::Vector2