Skip to content

[rmw_zenoh_cpp] get_entities_info_by_topic crashes with gcc vector accessor assertions enabled #666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
oysstu opened this issue Jun 10, 2025 · 0 comments · Fixed by #667
Closed
Labels
bug Something isn't working

Comments

@oysstu
Copy link
Contributor

oysstu commented Jun 10, 2025

Generated by Generative AI

No response

Operating System:

Archlinux

ROS version or commit hash:

Kilted release 2025.05.23

RMW implementation (if applicable):

No response

RMW Configuration (if applicable):

No response

Client library (if applicable):

No response

'ros2 doctor --report' output

No response

Steps to reproduce issue

  1. Compile with -Wp,-D_GLIBCXX_ASSERTIONS
  2. Start rmw_zenohd
  3. Run ros2 bag record --all
  4. Publish on any topic, e.g. ros2 topic pub /chatter std_msgs/Empty
  5. Cancel publisher (ctrl+c)

Expected behavior

No crash

Actual behavior

The ros2 recorder crashes with the following

[INFO] [1749567784.616642096] [rosbag2_recorder]: Subscribed to topic '/chatter'
/usr/include/c++/15.1.1/bits/stl_vector.h:1263: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = rmw_topic_endpoint_info_s; _Alloc = std::allocator<rmw_topic_endpoint_info_s>; reference = rmw_topic_endpoint_info_s&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

With the following backtrace from gdb

(gdb) bt
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff76a7813 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
#2  0x00007ffff764ddc0 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff763557a in __GI_abort () at abort.c:73
#4  0x00007ffff649a421 in std::__glibcxx_assert_fail (file=<optimized out>, line=<optimized out>, function=<optimized out>, 
    condition=<optimized out>) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/assert_fail.cc:41
#5  0x00007ffff52387a9 in rmw_zenoh_cpp::GraphCache::get_entities_info_by_topic(rmw_zenoh_cpp::liveliness::EntityType, rcutils_allocator_s*, char const*, bool, rmw_topic_endpoint_info_array_s*) const [clone .isra.0] [clone .cold] () from /opt/ros/kilted/lib/librmw_zenoh_cpp.so
#6  0x00007ffff52608b3 in rmw_get_publishers_info_by_topic () from /opt/ros/kilted/lib/librmw_zenoh_cpp.so
#7  0x00007ffff685a1f1 in __rcl_get_info_by_topic.part.0 () from /opt/ros/kilted/lib/librcl.so
#8  0x00007fffedf719c1 in std::vector<rclcpp::TopicEndpointInfo, std::allocator<rclcpp::TopicEndpointInfo> > get_info_by_topic<&kPublisherEndpointTypeName, int (*)(rcl_node_s const*, rcutils_allocator_s*, char const*, bool, rmw_topic_endpoint_info_array_s*)>(rclcpp::node_interfaces::NodeBaseInterface*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, int (*)(rcl_node_s const*, rcutils_allocator_s*, char const*, bool, rmw_topic_endpoint_info_array_s*)) [clone .constprop.0] () from /opt/ros/kilted/lib/librclcpp.so
#9  0x00007fffedf72109 in rclcpp::node_interfaces::NodeGraph::get_publishers_info_by_topic(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) const () from /opt/ros/kilted/lib/librclcpp.so
#10 0x00007fffedd3de5c in rosbag2_transport::TopicFilter::take_topic(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) () from /opt/ros/kilted/lib/librosbag2_transport.so
#11 0x00007fffedd3f309 in rosbag2_transport::TopicFilter::filter_topics(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, 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, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > > const&) () from /opt/ros/kilted/lib/librosbag2_transport.so
#12 0x00007fffedd113ff in rosbag2_transport::RecorderImpl::get_requested_or_available_topics[abi:cxx11]() ()
   from /opt/ros/kilted/lib/librosbag2_transport.so
#13 0x00007fffedd132bc in rosbag2_transport::RecorderImpl::topics_discovery() () from /opt/ros/kilted/lib/librosbag2_transport.so
#14 0x00007fffedd28531 in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<std::_Bind<void (rosbag2_transport::RecorderImpl::*(rosbag2_transport::RecorderImpl*))()> > >, void> >::_M_invoke(std::_Any_data const&) ()
   from /opt/ros/kilted/lib/librosbag2_transport.so
#15 0x00007fffedc67cf6 in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) () from /opt/ros/kilted/lib/librosbag2_transport.so
#16 0x00007ffff76aacb4 in __pthread_once_slow (once_control=0x555555d1b578, init_routine=0x7ffff64e3850 <std::__once_proxy()>) at pthread_once.c:116
#17 0x00007ffff76aad29 in ___pthread_once (once_control=<optimized out>, init_routine=<optimized out>) at pthread_once.c:143
#18 0x00007fffedd2caf2 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (rosbag2_transport::RecorderImpl::*(rosbag2_transport::RecorderImpl*))()> > >, void>::_M_run() () from /opt/ros/kilted/lib/librosbag2_transport.so
#19 0x00007ffff64e51a4 in std::execute_native_thread_routine (__p=0x555555d1a1e0) at /usr/src/debug/gcc/gcc/libstdc++-v3/src/c++11/thread.cc:104
#20 0x00007ffff76a57eb in start_thread (arg=<optimized out>) at pthread_create.c:448
#21 0x00007ffff772918c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant