Skip to content

ROS Topic Re-Publisher segfaults if multiple bags are loaded #48

Description

@snwu1996

Environment:
OS: Ubuntu 20.04
Kernel: 5.13.0-39-generic
ROS: Noetic

Steps to reproduce error:

  • roslaunch plotjuggler_ros plotjuggler.launch
  • Chuckle at meme in loading screen.
  • Load in multiple bag files.
  • Select all topics to be published.
  • Click the checkbox for ROS Topic Re-Publisher.
  • Hit the play button

Stack trace:

Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://localhost:33351/

SUMMARY
========

PARAMETERS
 * /rosdistro: noetic
 * /rosversion: 1.15.14

NODES
  /
    PlotJuggler (plotjuggler/plotjuggler)

auto-starting new master
process[master]: started with pid [623305]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 82f37e14-bcec-11ec-a350-21fe67c50afd
process[rosout-1]: started with pid [623330]
started core service [/rosout]
process[PlotJuggler-2]: started with pid [623333]
Loading compatible plugins from directory:  "/home/snwu/catkin_workspaces/playground_catkin_ws/devel/.private/plotjuggler/lib/plotjuggler"
"libDataLoadCSV.so is a DataLoader plugin"
"libDataLoadULog.so is a DataLoader plugin"
"libDataStreamSample.so is a DataStreamer plugin"  ...disabled, unless option -t is used
"libDataStreamUDP.so is a DataStreamer plugin"
"libDataStreamWebSocket.so is a DataStreamer plugin"
Type conversion already registered from type QString to type QwtText
"libProtobufParser.so is a MessageParser plugin"
"libPublisherCSV.so is a StatePublisher plugin"
Type conversion already registered from type QString to type QwtText
"libToolboxFFT.so is a Toolbox plugin"
Type conversion already registered from type QString to type QwtText
"libToolboxLuaEditor.so is a Toolbox plugin"
Type conversion already registered from type QString to type QwtText
"libToolboxQuaternion.so is a Toolbox plugin"
Number of plugins loaded:  9 

Loading compatible plugins from directory:  "/home/snwu/catkin_workspaces/playground_catkin_ws/devel/.private/plotjuggler/lib/plotjuggler_ros"
Number of plugins loaded:  0 

Loading compatible plugins from directory:  "/home/snwu/catkin_workspaces/playground_catkin_ws/devel/lib/plotjuggler_ros"
"libDataLoadROS.so is a DataLoader plugin"
"libDataStreamROS.so is a DataStreamer plugin"
"libRosoutPublisher.so is a StatePublisher plugin"
"libRosTopicPublisher.so is a StatePublisher plugin"
Number of plugins loaded:  4 

Loading compatible plugins from directory:  "/opt/ros/noetic/lib/plotjuggler_ros"
"libDataLoadROS.so is a DataLoader plugin"  ...skipping, because already loaded
"libDataStreamROS.so is a DataStreamer plugin"  ...skipping, because already loaded
"libRosoutPublisher.so is a StatePublisher plugin"  ...skipping, because already loaded
"libRosTopicPublisher.so is a StatePublisher plugin"  ...skipping, because already loaded
Number of plugins loaded:  0 

Loading compatible plugins from directory:  "/home/snwu/.local/share/PlotJuggler"
Number of plugins loaded:  0 

The loading operation took 715 milliseconds
The loading operation took 6156 milliseconds
The loading operation took 1908 milliseconds
Stack trace (most recent call last):
#22   Object "", at 0xffffffffffffffff, in 
#21   Object "/home/snwu/catkin_workspaces/playground_catkin_ws/devel/.private/plotjuggler/lib/plotjuggler/plotjuggler", at 0x5574f25b2fdd, in _start
#20   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f41a30500b2, in __libc_start_main
#19   Source "/home/snwu/catkin_workspaces/playground_catkin_ws/src/PlotJuggler/plotjuggler_app/main.cpp", line 390, in main [0x5574f25b1da3]
        387:     w->on_buttonStreamingStart_clicked();
        388:   }
        389: 
      > 390:   return app.exec();
        391: }
#18   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a37f9115, in QCoreApplication::exec()
#17   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a37f13aa, in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
#16   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a384a434, in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
#15   Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f41a27c14a2, in g_main_context_iteration
#14   Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f41a27c13ff, in g_main_context_dispatch
#13   Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f41a27c117c, in g_main_context_dispatch
#12   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a384a06b, in QEventDispatcherGlib::flush()
#11   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a384977f, in QTimerInfoList::activateTimers()
#10   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a37f2809, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#9    Object "/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f41a42140ef, in QApplication::notify(QObject*, QEvent*)
#8    Object "/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f41a420aa65, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#7    Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a381ebc4, in QObject::event(QEvent*)
#6    Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a382b3ed, in QTimer::timeout(QTimer::QPrivateSignal)
#5    Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f41a381e327, in QMetaObject::activate(QObject*, int, int, void**)
#4    Source "/home/snwu/catkin_workspaces/playground_catkin_ws/src/PlotJuggler/plotjuggler_app/mainwindow.cpp", line 2639, in MainWindow::onPlaybackLoop() [0x5574f25db04e]
       2637:   for (auto& it : _state_publisher)
       2638:   {
      >2639:     it.second->play(_tracker_time);
       2640:   }
       2641: 
       2642:   forEachWidget([&](PlotWidget* plot) {
#3    Source "/home/snwu/catkin_workspaces/playground_catkin_ws/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS/statepublisher_rostopic.cpp", line 433, in TopicPublisherROS::play(double) [0x7f41854c7a6c]
        430:   if (_previous_play_index > current_index)
        431:   {
        432:     _previous_play_index = current_index;
      > 433:     updateState(current_time);
        434:     return;
        435:   }
        436:   else
#2    Source "/home/snwu/catkin_workspaces/playground_catkin_ws/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS/statepublisher_rostopic.cpp", line 389, in TopicPublisherROS::updateState(double) [0x7f41854c712c]
        386:     if (any_value.type() == typeid(rosbag::MessageInstance))
        387:     {
        388:       const auto& msg_instance = std::any_cast<rosbag::MessageInstance>(any_value);
      > 389:       publishAnyMsg(msg_instance);
        390:     }
        391:   }
#1  | Source "/home/snwu/catkin_workspaces/playground_catkin_ws/src/plotjuggler-ros-plugins/plugins/TopicPublisherROS/statepublisher_rostopic.cpp", line 292, in TopicPublisherROS::publishAnyMsg(rosbag::MessageInstance const&)
    |   291:   const auto& topic_name = msg_instance.getTopic();
    | > 292:   RosIntrospection::ShapeShifter* shapeshifted = RosIntrospectionFactory::get().getShapeShifter(topic_name);
    |   293: 
    |   294:   if (!shapeshifted)
    | Source "/home/snwu/catkin_workspaces/playground_catkin_ws/src/plotjuggler-ros-plugins/plugins/shape_shifter_factory.hpp", line 63, in RosIntrospectionFactory::getShapeShifter(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    |    61: {
    |    62:     auto& instance = get();
    | >  63:     auto it = instance._ss_map.find( topic_name );
    |    64:     return ( it == instance._ss_map.end()) ? nullptr :  &(it->second);
    |    65: }
    | Source "/usr/include/c++/9/bits/stl_map.h", line 1169, in std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, RosIntrospection::ShapeShifter, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RosIntrospection::ShapeShifter> > >::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    |  1167:       iterator
    |  1168:       find(const key_type& __x)
    | >1169:       { return _M_t.find(__x); }
    |  1170: 
    |  1171: #if __cplusplus > 201103L
    | Source "/usr/include/c++/9/bits/stl_tree.h", line 2562, in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RosIntrospection::ShapeShifter>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RosIntrospection::ShapeShifter> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RosIntrospection::ShapeShifter> > >::find(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    |  2560:     find(const _Key& __k)
    |  2561:     {
    | >2562:       iterator __j = _M_lower_bound(_M_begin(), _M_end(), __k);
    |  2563:       return (__j == end()
    |  2564: 	      || _M_impl._M_key_compare(__k,
    | Source "/usr/include/c++/9/bits/stl_tree.h", line 1934, in std::_Rb_tree<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RosIntrospection::ShapeShifter>, std::_Select1st<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RosIntrospection::ShapeShifter> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RosIntrospection::ShapeShifter> > >::_M_lower_bound(std::_Rb_tree_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, RosIntrospection::ShapeShifter> >*, std::_Rb_tree_node_base*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    |  1932:     {
    |  1933:       while (__x != 0)
    | >1934: 	if (!_M_impl._M_key_compare(_S_key(__x), __k))
    |  1935: 	  __y = __x, __x = _S_left(__x);
    |  1936: 	else
    | Source "/usr/include/c++/9/bits/stl_function.h", line 386, in std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
    |   384:       bool
    |   385:       operator()(const _Tp& __x, const _Tp& __y) const
    | > 386:       { return __x < __y; }
    |   387:     };
    | Source "/usr/include/c++/9/bits/basic_string.h", line 6232, in bool std::operator< <char, std::char_traits<char>, std::allocator<char> >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    |  6230: 	      const basic_string<_CharT, _Traits, _Alloc>& __rhs)
    |  6231:     _GLIBCXX_NOEXCEPT
    | >6232:     { return __lhs.compare(__rhs) < 0; }
    |  6233: 
    |  6234:   /**
    | Source "/usr/include/c++/9/bits/basic_string.h", line 2863, in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
    |  2861: 	const size_type __len = std::min(__size, __osize);
    |  2862: 
    | >2863: 	int __r = traits_type::compare(_M_data(), __str.data(), __len);
    |  2864: 	if (!__r)
    |  2865: 	  __r = _S_compare(__size, __osize);
      Source "/usr/include/c++/9/bits/char_traits.h", line 332, in std::char_traits<char>::compare(char const*, char const*, unsigned long) [0x7f41854c5e44]
        329: 	    return 0;
        330: 	  }
        331: #endif
      > 332: 	return __builtin_memcmp(__s1, __s2, __n);
        333:       }
        334: 
        335:       static _GLIBCXX17_CONSTEXPR size_t
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f41a31b0bde, in __nss_database_lookup
Segmentation fault (Signal sent by the kernel [(nil)])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions