ros-visualization/rviz

rviz crashes when visualizing PointCloud.

Closed this issue · 2 comments

Your environment

  • OS Version: Manjaro 21.2.4 Qonos
  • ROS Distro: Noetic
  • RViz, Qt, OGRE, OpenGl version as printed by rviz:
    [ INFO] [1646228430.081242918]: rviz version 1.14.11
    [ INFO] [1646228430.081291429]: compiled against Qt version 5.15.2
    [ INFO] [1646228430.081299042]: compiled against OGRE version 1.9.0 (Ghadamon)
    [ INFO] [1646228430.084452658]: Forcing OpenGl version 0.
    [ INFO] [1646228430.289108788]: Stereo is NOT SUPPORTED
    [ INFO] [1646228430.289140408]: OpenGL device: Mesa Intel(R) Graphics (RKL GT1)
    [ INFO] [1646228430.289148757]: OpenGl version: 4.6 (GLSL 4.6) limited to GLSL 1.4 on Mesa system.
    
  • build against tag 1.14.11
  • System locale: zh_CN.UTF-8 zh_CN.UTF-8;

Hi, I am running rviz with VINS-Fusion. The rviz always crashes when VINS starts running.
And screen output shows that:

/usr/include/c++/11.2.0/bits/stl_vector.h:1134: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::front() const [with _Tp = unsigned char; _Alloc = std::allocator<unsigned char>; std::vector<_Tp, _Alloc>::const_reference = const unsigned char&]: Assertion '!this->empty()' failed.

Then I tries to use gdb to debug it, and it shows:

Thread 1 "rviz" received signal SIGABRT, Aborted.
0x00007ffff6d7734c in __pthread_kill_implementation () from /usr/lib/libc.so.6

and the backtrace shows that:

#0  0x00007ffff6d7734c in __pthread_kill_implementation () at /usr/lib/libc.so.6
#1  0x00007ffff6d2a4b8 in raise () at /usr/lib/libc.so.6
#2  0x00007ffff6d14534 in abort () at /usr/lib/libc.so.6
#3  0x000055555555843a in std::__replacement_assert(char const*, int, char const*, char const*)
    (__file=<optimized out>, __line=<optimized out>, __function=<optimized out>, __condition=<optimized out>) at /usr/include/c++/11.2.0/x86_64-pc-linux-gnu/bits/c++config.h:514
#4  0x00007fff5470fbc4 in std::vector<unsigned char, std::allocator<unsigned char> >::front() const
    (this=<optimized out>) at /usr/include/c++/11.2.0/bits/stl_vector.h:1134
#5  std::vector<unsigned char, std::allocator<unsigned char> >::front() const (this=<optimized out>)
    at /usr/include/c++/11.2.0/bits/stl_vector.h:1132
#6  rviz::XYZPCTransformer::transform(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&, unsigned int, Ogre::Matrix4 const&, std::vector<rviz::PointCloud::Point, std::allocator<rviz::PointCloud::Point> >&)
    (this=<optimized out>, cloud=<optimized out>, mask=<optimized out>, points_out=<optimized out>)
    at /usr/src/debug/rviz-1.14.11/src/rviz/default_plugin/point_cloud_transformers.cpp:327
#7  0x00007fff546ecd5b in rviz::PointCloudCommon::transformCloud(boost::shared_ptr<rviz::PointCloudCommon::CloudInfo> const&, bool)
    (this=this@entry=0x555556a6a460, cloud_info=..., update_transformers=update_transformers@entry=true)
    at /usr/src/debug/rviz-1.14.11/src/rviz/default_plugin/point_cloud_common.cpp:867
#8  0x00007fff546ed4bd in rviz::PointCloudCommon::processMessage(boost::shared_ptr<sensor_msgs::PointClou--Type <RET> for more, q to quit, c to continue without paging--<RET>
d2_<std::allocator<void> > const> const&) (this=this@entry=0x555556a6a460, cloud=...)
    at /usr/src/debug/rviz-1.14.11/src/rviz/default_plugin/point_cloud_common.cpp:734
#9  0x00007fff546ed60a in rviz::PointCloudCommon::addMessage(boost::shared_ptr<sensor_msgs::PointCloud2_<std::allocator<void> > const> const&) (this=this@entry=0x555556a6a460, cloud=...)
    at /usr/src/debug/rviz-1.14.11/src/rviz/default_plugin/point_cloud_common.cpp:944
#10 0x00007fff546ee52a in rviz::PointCloudCommon::addMessage(boost::shared_ptr<sensor_msgs::PointCloud_<std::allocator<void> > const> const&) (this=0x555556a6a460, cloud=...)
    at /usr/include/boost/smart_ptr/shared_ptr.hpp:259
#11 0x00007fff54541467 in rviz::MessageFilterDisplay<sensor_msgs::PointCloud_<std::allocator<void> > >::processTypeErasedMessage(boost::shared_ptr<void const>) (this=0x555556b4a0c0, type_erased_msg=...)
    at /usr/src/debug/rviz-1.14.11/src/rviz/message_filter_display.h:220
#12 0x00007ffff7e80a8d in rviz::_RosTopicDisplay::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /usr/src/debug/build/src/rviz/rviz_autogen/EWIEGA46WW/moc_message_filter_display.cpp:85
#13 0x00007ffff73e3dc6 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#14 0x00007ffff77cd1a6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
    at /usr/lib/libQt5Widgets.so.5
#15 0x00007ffff73bfb9a in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
    at /usr/lib/libQt5Core.so.5
#16 0x00007ffff73c0699 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
    at /usr/lib/libQt5Core.so.5
#17 0x00007ffff7407bd8 in  () at /usr/lib/libQt5Core.so.5
#18 0x00007ffff47bdf13 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#19 0x00007ffff48140d9 in  () at /usr/lib/libglib-2.0.so.0
#20 0x00007ffff47bb485 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#21 0x00007ffff740bada in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/libQt5Core.so.5
#22 0x00007ffff73b7e6b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /usr/lib/libQt5Core.so.5
#23 0x00007ffff73c35c7 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#24 0x0000555555559044 in main(int, char**) (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/rviz-1.14.11/src/rviz/main.cpp:42

I find that this is a bug related to PointCloud visualization, however I don't know how to debug it. Besides, I have another PC equipped with Ubuntu 20.04, running the same program won't crash the rviz.

Describe your issue here and explain how to reproduce it.

If the problem is only occurring on your Manjaro machine, I'm afraid it is related to library incompatibilities between Ubuntu and Manjaro. This assumption is supported by the fact that the crash (actually an assertion failure) occurs in the standard c++ library.
However, in that case, I cannot help.

@rhaschke Thank you! I will try to figure it out myself.😊