RViz, Qt, OGRE, OpenGl version as printed by rviz:
[ INFO] [1700431099.636949210]: rviz version 1.14.20
[ INFO] [1700431099.636989770]: compiled against Qt version 5.12.8
[ INFO] [1700431099.636997793]: compiled against OGRE version 1.9.0 (Ghadamon)
[ INFO] [1700431099.642555444]: Forcing OpenGl version 0.
[ INFO] [1700431100.112139910, 187.999000000]: Stereo is NOT SUPPORTED
[ INFO] [1700431100.112191213, 188.000000000]: OpenGL device: NVIDIA GeForce RTX 3080/PCIe/SSE2
[ INFO] [1700431100.112203835, 188.000000000]: OpenGl version: 4.6 (GLSL 4.6).
gdb log
Thread 1 "rviz" received signal SIGSEGV, Segmentation fault.
0x00007ffff7ea3ae4 in rviz::buildMesh(aiScene const*, aiNode const*, Ogre::SharedPtr<Ogre::Mesh> const&, Ogre::AxisAlignedBox&, float&, std::vector<Ogre::SharedPtr<Ogre::Material>, std::allocator<Ogre::SharedPtr<Ogre::Material> > >&, aiMatrix4x4t<float>) () from /opt/ros/noetic/lib/librviz.so
(gdb) bt
#0 0x00007ffff7ea3ae4 in rviz::buildMesh(aiScene const*, aiNode const*, Ogre::SharedPtr<Ogre::Mesh> const&, Ogre::AxisAlignedBox&, float&, std::vector<Ogre::SharedPtr<Ogre::Material>, std::allocator<Ogre::SharedPtr<Ogre::Material> > >&, aiMatrix4x4t<float>) () at /opt/ros/noetic/lib/librviz.so
#1 0x00007ffff7ea3fb0 in rviz::buildMesh(aiScene const*, aiNode const*, Ogre::SharedPtr<Ogre::Mesh> const&, Ogre::AxisAlignedBox&, float&, std::vector<Ogre::SharedPtr<Ogre::Material>, std::allocator<Ogre::SharedPtr<Ogre::Material> > >&, aiMatrix4x4t<float>) () at /opt/ros/noetic/lib/librviz.so
#2 0x00007ffff7ea6d03 in rviz::meshFromAssimpScene(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, aiScene const*) () at /opt/ros/noetic/lib/librviz.so
#3 0x00007ffff7ea76f1 in rviz::loadMeshFromResource(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
at /opt/ros/noetic/lib/librviz.so
#4 0x00007ffff7ef052d in rviz::RobotLink::createEntityForGeometryElement(std::shared_ptr<urdf::Link const> const&, urdf::Geometry const&, std::shared_ptr<urdf::Material> const&, urdf::Pose const&, Ogre::SceneNode*, Ogre::Entity*&) () at /opt/ros/noetic/lib/librviz.so
#5 0x00007ffff7ef0de7 in rviz::RobotLink::createVisual(std::shared_ptr<urdf::Link const> const&) () at /opt/ros/noetic/lib/librviz.so
#6 0x00007ffff7ef236f in rviz::RobotLink::RobotLink(rviz::Robot*, std::shared_ptr<urdf::Link const> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) () at /opt/ros/noetic/lib/librviz.so
#7 0x00007ffff7ef62c7 in rviz::Robot::LinkFactory::createLink(rviz::Robot*, std::shared_ptr<urdf::Link const> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool) () at /opt/ros/noetic/lib/librviz.so
#8 0x00007ffff7ef864b in rviz::Robot::load(urdf::ModelInterface const&, bool, bool) () at /opt/ros/noetic/lib/librviz.so
#9 0x00007fffa86b3c60 in rviz::RobotModelDisplay::load() () at /opt/ros/noetic/lib/librviz_default_plugin.so
#10 0x00007fffa86b3311 in rviz::RobotModelDisplay::onEnable() () at /opt/ros/noetic/lib/librviz_default_plugin.so
#11 0x00007ffff7e5c5f3 in rviz::Display::onEnableChanged() () at /opt/ros/noetic/lib/librviz.so
#12 0x00007ffff7e478a0 in () at /opt/ros/noetic/lib/librviz.so
#13 0x00007ffff73cf1d0 in QMetaObject::activate(QObject*, int, int, void**) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff7edf17b in rviz::Property::setValue(QVariant const&) () at /opt/ros/noetic/lib/librviz.so
#15 0x00007ffff7e5c4ab in rviz::Display::setEnabled(bool) () at /opt/ros/noetic/lib/librviz.so
#16 0x00007ffff7f3d158 in rviz::VisualizationManager::createDisplay(QString const&, QString const&, bool) () at /opt/ros/noetic/lib/librviz.so
#17 0x00007ffff7e765c8 in rviz::DisplaysPanel::onNewDisplay() () at /opt/ros/noetic/lib/librviz.so
#18 0x00007ffff73cf1d0 in QMetaObject::activate(QObject*, int, int, void**) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007ffff78c5806 in QAbstractButton::clicked(bool) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#20 0x00007ffff78c5a2e in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#21 0x00007ffff78c6e73 in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#22 0x00007ffff78c7035 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#23 0x00007ffff78132b6 in QWidget::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#24 0x00007ffff77d0a66 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#25 0x00007ffff77da343 in QApplication::notify(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#26 0x00007ffff73a380a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#27 0x00007ffff77d9457 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) ()
at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#28 0x00007ffff782f35d in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#29 0x00007ffff78321ec in () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#30 0x00007ffff77d0a66 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#31 0x00007ffff77da0f0 in QApplication::notify(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#32 0x00007ffff73a380a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#33 0x00007ffff4a657d3 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
at /lib/x86_64-linux-gnu/libQt5Gui.so.5
--Type <RET> for more, q to quit, c to continue without paging--
#34 0x00007ffff4a6710b in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()
at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#35 0x00007ffff4a4135b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /lib/x86_64-linux-gnu/libQt5Gui.so.5
#36 0x00007fffeeb1632e in () at /lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#37 0x00007ffff417517d in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#38 0x00007ffff4175400 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#39 0x00007ffff41754a3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#40 0x00007ffff73fb435 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#41 0x00007ffff73a23ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#42 0x00007ffff73aa116 in QCoreApplication::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#43 0x00005555555585e2 in main ()
Solution
On my computer, the problem is that I had a libassimp.so in /usr/local/lib hiding the system libassimp.so that rviz should actually be using:
Removing it from /usr/local/lib fixed the issue, so now it is loading the right one on runtime and there is no crash when adding RobotModel display (tested with turtlebot3 simulation):
Your environment
gdb log
Solution
On my computer, the problem is that I had a
libassimp.so
in/usr/local/lib
hiding the systemlibassimp.so
that rviz should actually be using:Removing it from
/usr/local/lib
fixed the issue, so now it is loading the right one on runtime and there is no crash when adding RobotModel display (tested with turtlebot3 simulation):I created an issue here with the solution to keep it somewhere searchable on internet :)