rviz: Adding Image, Camera or DepthCloud as a display type causes rviz to core dump

When I attempt to add an Image, Camera or DepthCloud as a display type, rviz core dumps immediately.

Steps to Recreate

32 bit Ubuntu 12.04 LTS ROS Groovy

:~$ rosrun rviz rviz
[ INFO] [1383586452.114450054]: rviz version 1.9.32
[ INFO] [1383586452.114758172]: compiled against OGRE version 1.7.4 (Cthugha)
[ INFO] [1383586452.342339193]: OpenGl version: 3 (GLSL 1.3).

RVIZ opens Click Add to add a new Display Type. Select Camera and click OK Results in the following output

:~$ rosrun rviz rviz
[ INFO] [1383586452.114450054]: rviz version 1.9.32
[ INFO] [1383586452.114758172]: compiled against OGRE version 1.7.4 (Cthugha)
[ INFO] [1383586452.342339193]: OpenGl version: 3 (GLSL 1.3).
Segmentation fault (core dumped)

Same happens if I select Image or DepthCloud as well.

Here is the output from the debugger:

:~$ gdb /opt/ros/groovy/lib/rviz/rviz core
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /opt/ros/groovy/lib/rviz/rviz...(no debugging symbols found)...done.
[New LWP 6387]
[New LWP 6395]
[New LWP 6397]
[New LWP 6413]
[New LWP 6402]
[New LWP 6414]
[New LWP 6401]
[New LWP 6428]
[New LWP 6415]
[New LWP 6407]
[New LWP 6396]
[New LWP 6412]
[New LWP 6400]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Core was generated by `/opt/ros/groovy/lib/rviz/rviz'.
Program terminated with signal 11, Segmentation fault.
#0  0xb761fce7 in pluginlib::ClassLoader<image_transport::SubscriberPlugin>::processSingleXMLPluginFile(std::string const&, std::map<std::string, pluginlib::ClassDesc, std::less<std::string>, std::allocator<std::pair<std::string const, pluginlib::ClassDesc> > >&) () from /opt/ros/groovy/lib/librviz.so
(gdb) bt
#0  0xb761fce7 in pluginlib::ClassLoader<image_transport::SubscriberPlugin>::processSingleXMLPluginFile(std::string const&, std::map<std::string, pluginlib::ClassDesc, std::less<std::string>, std::allocator<std::pair<std::string const, pluginlib::ClassDesc> > >&) () from /opt/ros/groovy/lib/librviz.so
#1  0xb6693727 in pluginlib::ClassLoader<image_transport::SubscriberPlugin>::determineAvailableClasses() () from /opt/ros/groovy/lib/libimage_transport.so
#2  0xb6693c68 in pluginlib::ClassLoader<image_transport::SubscriberPlugin>::ClassLoader(std::string, std::string, std::string) ()
   from /opt/ros/groovy/lib/libimage_transport.so
#3  0xb669416e in boost::shared_ptr<pluginlib::ClassLoader<image_transport::SubscriberPlugin> > boost::make_shared<pluginlib::ClassLoader<image_transport::SubscriberPlugin>, char [16], char [34]>(char const (&) [16], char const (&) [34])
    () from /opt/ros/groovy/lib/libimage_transport.so
#4  0xb668a89b in image_transport::ImageTransport::ImageTransport(ros::NodeHandle const&) () from /opt/ros/groovy/lib/libimage_transport.so
#5  0xb76158ec in rviz::ImageDisplayBase::ImageDisplayBase() ()
   from /opt/ros/groovy/lib/librviz.so
#6  0xa0d899e4 in rviz::CameraDisplay::CameraDisplay() ()
   from /opt/ros/groovy/lib/libdefault_plugin.so
#7  0xa0d91dbc in class_loader::class_loader_private::MetaObject<rviz::CameraDisplay, rviz::Display>::create() const ()
---Type <return> to continue, or q <return> to quit---
   from /opt/ros/groovy/lib/libdefault_plugin.so
#8  0xb75f7c04 in rviz::Display* class_loader::class_loader_private::createInstance<rviz::Display>(std::string const&, class_loader::ClassLoader*) ()
   from /opt/ros/groovy/lib/librviz.so
#9  0xb75f7fb4 in rviz::Display* class_loader::MultiLibraryClassLoader::createUnmanagedInstance<rviz::Display>(std::string const&) ()
   from /opt/ros/groovy/lib/librviz.so
#10 0xb75f813e in pluginlib::ClassLoader<rviz::Display>::createUnmanagedInstance(std::string const&) () from /opt/ros/groovy/lib/librviz.so
#11 0xb75f8b65 in rviz::PluginlibFactory<rviz::Display>::makeRaw(QString const&, QString*) () from /opt/ros/groovy/lib/librviz.so
#12 0xb75ec10a in rviz::DisplayFactory::makeRaw(QString const&, QString*) ()
   from /opt/ros/groovy/lib/librviz.so
#13 0xb75ed46b in rviz::ClassIdRecordingFactory<rviz::Display>::make(QString const&, QString*) () from /opt/ros/groovy/lib/librviz.so
#14 0xb75fb8c5 in rviz::DisplayGroup::createDisplay(QString const&) ()
   from /opt/ros/groovy/lib/librviz.so
#15 0xb76af3f4 in rviz::VisualizationManager::createDisplay(QString const&, QString const&, bool) () from /opt/ros/groovy/lib/librviz.so
#16 0xb75fde6b in rviz::DisplaysPanel::onNewDisplay() ()
   from /opt/ros/groovy/lib/librviz.so
---Type <return> to continue, or q <return> to quit---
#17 0xb76bfe4c in ?? () from /opt/ros/groovy/lib/librviz.so
#18 0xb5bc26b1 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#19 0xb72ce97d in QAbstractButton::clicked(bool) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#20 0xb6fc262d in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#21 0xb6fc3c9b in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#22 0xb6fc3f56 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#23 0xb6bf11ac in QWidget::event(QEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#24 0xb6fc31f9 in QAbstractButton::event(QEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#25 0xb7066768 in QPushButton::event(QEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#26 0xb6b96ed4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#27 0xb6b9d024 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#28 0xb5bab97e in QCoreApplication::notifyInternal(QObject*, QEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtCore.so.4
---Type <return> to continue, or q <return> to quit---
#29 0xb6b97e95 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#30 0xb6c24074 in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#31 0xb6c22c0d in QApplication::x11ProcessEvent(_XEvent*) ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#32 0xb6c4feac in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#33 0xb55f2d86 in g_main_context_dispatch ()
   from /lib/i386-linux-gnu/libglib-2.0.so.0
#34 0xb55f3125 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#35 0xb55f3201 in g_main_context_iteration ()
   from /lib/i386-linux-gnu/libglib-2.0.so.0
#36 0xb5bde887 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#37 0xb6c4faaa in ?? () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#38 0xb5baa50d in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtCore.so.4
#39 0xb5baa7a9 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/i386-linux-gnu/libQtCore.so.4
#40 0xb5bafeba in QCoreApplication::exec() ()
   from /usr/lib/i386-linux-gnu/libQtCore.so.4
---Type <return> to continue, or q <return> to quit---
#41 0xb6b94a74 in QApplication::exec() ()
   from /usr/lib/i386-linux-gnu/libQtGui.so.4
#42 0x080488eb in main ()
(gdb) 

I did upgrade ros-groovy-class-loader and it still core dumps.

Any help would be much appreciated.

About this issue

  • Original URL
  • State: open
  • Created 11 years ago
  • Comments: 16 (6 by maintainers)

Most upvoted comments

I have solved the problem(at least on my machine). I am running Ubuntu 14.04 and ROS Indigo on a x64 machine. In my case, I had built Qt5.3.2 from source and OpenCV 2.4.9 from source with Qt support on AND the OpenCV libraries were built against Qt5. Here is what I did:

  1. Removed Qt5 I actually didn’t remove it. I did a sudo apt-get install qt4-default. Then checked qmake -v to make sure it used the Qt4 binaries that come with trusty.
  2. Re-built OpenCV from source with Qt4 support. I built OpenCV 2.4.8 this time as this is the same version that is available on the Trusty official repositories and Indigo is known to work with it for sure. I had to build it from source to install the non-free libraries (SIFT,SURF).

Then I tried adding views for camera, depthmap and pointcloud2 (with kinect) it all worked fine! No segfaults. ldd /opt/ros/indigo/lib//libcompressed_depth_image_transport.so | grep Qt did not have any result and ldd /opt/ros/indigo/bin/rviz | grep Qt gave libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007f649cc04000) libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007f6498b4a000)

I am not totally sure if rviz uses OpenCV libraries for the Camera interface. It could be possible to solve this problem by just uninstalling Qt5 (and building ROS again if it was built from source) as @wjwwood suggested. Hope this helps.

@lorenzoriano : Glad that you got your problem solved. But It’s strange why/how Cmake picks up Qt5’s qmake when qt4-default is installed. @wjwwood : I don’t think OpenCV pulls Qt5 incorrectly. It depends on the configuration of the system. Just to make sure, I built OpenCV a couple of times today on trusty systems with both Qt4 and Qt5 installed. So, I can confirm that OpenCV can be built against qt4 libraries alone even if Qt5 is installed. I can also confirm the observation that the rviz issue #696 gets solved if OpenCV is not built against Qt5. I am not sure about the dependency of rviz on OpenCV still.

For anybody who are facing the same issue and are unable to solve it using the information above, the following pointers might help: After installing qt4-default and making sure qmake -v points to qt4 binaries, cmake should be finding qt4’s binaries as it uses qmake -query PROPERTY to get the version and binary location. If not you can set QT_QMAKE_EXECUTABLE to the directory containing qmake before running cmake. Or if you use cmake-gui , after the first configure, you can select the qt4 qmake directory as the value corresponding to the name QT_QMAKE_EXECUTABLE. Cmake will also list out variables like Qt5Core_DIR, Qt5Gui_DIR etc which you can unset or leave it blank. To make sure Qt4 is being used for the GUI, you can do cmake -DWITH_QT=4 ../ (Assuming the OpenCV src is at …/) and then look at the output for something like:

-- GUI:
--      QT 4.x:                                 YES (ver 4.8.6 EDITION= OpenSource)
--      QT OpenGL support:            YES (/usr/lib/x86_64-linux-gnu/libQtOpenGL.so)

If none of the above works, you can try using a different Cmake version (2.x like 2.8). Hope this helps.