Skip to content
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

Crash after calling /model/elevator/door_0/lidar topic with empty gz.msgs.LaserScan message #2531

Closed
gzfuzz opened this issue Aug 21, 2024 · 0 comments · Fixed by #2540
Closed
Labels
bug Something isn't working

Comments

@gzfuzz
Copy link

gzfuzz commented Aug 21, 2024

Environment

  • OS Version: Ubuntu 22.04
  • Source or binary build?
    source build
    gz-sim version: 24a37be
    built with
    gcc version: 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
    build options: -DCMAKE_BUILD_TYPE=Coverage

Description

  • Expected behavior: Gazebo doesn't crash
  • Actual behavior: Gazebo crashes

Steps to reproduce

  1. gz sim a.txt -r # which is actually gz-sim/examples/worlds/elevator.sdf
  2. call /model/elevator/door_X with empty LaserScan message, e.g.,
gz topic -t /model/elevator/door_0/lidar -m gz.msgs.LaserScan -p ''

Output

[libprotobuf FATAL ./google/protobuf/repeated_field.h:1297] CHECK failed: (index) < (current_size_): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: (index) < (current_size_): 
Stack trace (most recent call last) in thread 27569:
#31   Object "/home/ren/play/robot/workspace/install/lib/libgz-transport13.so.13", at 0x732ff8feb232, in void std::thread::_Invoker<std::tuple<void (gz::transport::v13::NodeShared::*)(), gz::transport::v13::NodeShared*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>)
#30   Object "/home/ren/play/robot/workspace/install/lib/libgz-transport13.so.13", at 0x732ff8feb7d2, in std::__invoke_result<void (gz::transport::v13::NodeShared::*)(), gz::transport::v13::NodeShared*>::type std::__invoke<void (gz::transport::v13::NodeShared::*)(), gz::transport::v13::NodeShared*>(void (gz::transport::v13::NodeShared::*&&)(), gz::transport::v13::NodeShared*&&)
#29   Object "/home/ren/play/robot/workspace/install/lib/libgz-transport13.so.13", at 0x732ff8febcc2, in void std::__invoke_impl<void, void (gz::transport::v13::NodeShared::*)(), gz::transport::v13::NodeShared*>(std::__invoke_memfun_deref, void (gz::transport::v13::NodeShared::*&&)(), gz::transport::v13::NodeShared*&&)
#28   Object "/home/ren/play/robot/workspace/install/lib/libgz-transport13.so.13", at 0x732ff8f80e20, in gz::transport::v13::NodeShared::RunReceptionTask()
#27   Object "/home/ren/play/robot/workspace/install/lib/libgz-transport13.so.13", at 0x732ff8f8294a, in gz::transport::v13::NodeShared::RecvMsgUpdate()
#26   Object "/home/ren/play/robot/workspace/install/lib/libgz-transport13.so.13", at 0x732ff8f83fe6, in gz::transport::v13::NodeShared::TriggerCallbacks(gz::transport::v13::MessageInfo const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, gz::transport::v13::NodeShared::HandlerInfo const&)
#25   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbda812e9, in gz::transport::v13::SubscriptionHandler<gz::msgs::LaserScan>::RunLocalCallback(google::protobuf::Message const&, gz::transport::v13::MessageInfo const&)
#24   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbda84636, in std::function<void (gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)>::operator()(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&) const
#23   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd98a5d7, in std::_Function_handler<void (gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&), gz::transport::v13::Node::Subscribe<gz::msgs::LaserScan>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (gz::msgs::LaserScan const&)>, gz::transport::v13::SubscribeOptions const&)::{lambda(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)#1}>::_M_invoke(std::_Any_data const&, gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)
#22   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd99cbdc, in std::enable_if<is_invocable_r_v<void, gz::transport::v13::Node::Subscribe<gz::msgs::LaserScan>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (gz::msgs::LaserScan const&)>, gz::transport::v13::SubscribeOptions const&)::{lambda(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)#1}&, gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&>, void>::type std::__invoke_r<void, gz::transport::v13::Node::Subscribe<gz::msgs::LaserScan>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (gz::msgs::LaserScan const&)>, gz::transport::v13::SubscribeOptions const&)::{lambda(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)#1}&, gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&>(gz::transport::v13::Node::Subscribe<gz::msgs::LaserScan>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (gz::msgs::LaserScan const&)>, gz::transport::v13::SubscribeOptions const&)::{lambda(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)#1}&, gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)
#21   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd9b9435, in void std::__invoke_impl<void, gz::transport::v13::Node::Subscribe<gz::msgs::LaserScan>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (gz::msgs::LaserScan const&)>, gz::transport::v13::SubscribeOptions const&)::{lambda(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)#1}&, gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&>(std::__invoke_other, gz::transport::v13::Node::Subscribe<gz::msgs::LaserScan>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (gz::msgs::LaserScan const&)>, gz::transport::v13::SubscribeOptions const&)::{lambda(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)#1}&, gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)
#20   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd9682a0, in gz::transport::v13::Node::Subscribe<gz::msgs::LaserScan>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void (gz::msgs::LaserScan const&)>, gz::transport::v13::SubscribeOptions const&)::{lambda(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&)#1}::operator()(gz::msgs::LaserScan const&, gz::transport::v13::MessageInfo const&) const
#19   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd977266, in std::function<void (gz::msgs::LaserScan const&)>::operator()(gz::msgs::LaserScan const&) const
#18   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd97704c, in std::_Function_handler<void (gz::msgs::LaserScan const&), std::_Bind<void (gz::sim::v8::systems::ElevatorPrivate::*(gz::sim::v8::systems::ElevatorPrivate*, unsigned long, std::_Placeholder<1>))(unsigned long, gz::msgs::LaserScan const&)> >::_M_invoke(std::_Any_data const&, gz::msgs::LaserScan const&)
#17   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd98a2a3, in std::enable_if<is_invocable_r_v<void, std::_Bind<void (gz::sim::v8::systems::ElevatorPrivate::*(gz::sim::v8::systems::ElevatorPrivate*, unsigned long, std::_Placeholder<1>))(unsigned long, gz::msgs::LaserScan const&)>&, gz::msgs::LaserScan const&>, void>::type std::__invoke_r<void, std::_Bind<void (gz::sim::v8::systems::ElevatorPrivate::*(gz::sim::v8::systems::ElevatorPrivate*, unsigned long, std::_Placeholder<1>))(unsigned long, gz::msgs::LaserScan const&)>&, gz::msgs::LaserScan const&>(std::_Bind<void (gz::sim::v8::systems::ElevatorPrivate::*(gz::sim::v8::systems::ElevatorPrivate*, unsigned long, std::_Placeholder<1>))(unsigned long, gz::msgs::LaserScan const&)>&, gz::msgs::LaserScan const&)
#16   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd99c8fd, in void std::__invoke_impl<void, std::_Bind<void (gz::sim::v8::systems::ElevatorPrivate::*(gz::sim::v8::systems::ElevatorPrivate*, unsigned long, std::_Placeholder<1>))(unsigned long, gz::msgs::LaserScan const&)>&, gz::msgs::LaserScan const&>(std::__invoke_other, std::_Bind<void (gz::sim::v8::systems::ElevatorPrivate::*(gz::sim::v8::systems::ElevatorPrivate*, unsigned long, std::_Placeholder<1>))(unsigned long, gz::msgs::LaserScan const&)>&, gz::msgs::LaserScan const&)
#15   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd9b91c9, in void std::_Bind<void (gz::sim::v8::systems::ElevatorPrivate::*(gz::sim::v8::systems::ElevatorPrivate*, unsigned long, std::_Placeholder<1>))(unsigned long, gz::msgs::LaserScan const&)>::operator()<gz::msgs::LaserScan const&, void>(gz::msgs::LaserScan const&)
#14   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd9cdea6, in void std::_Bind<void (gz::sim::v8::systems::ElevatorPrivate::*(gz::sim::v8::systems::ElevatorPrivate*, unsigned long, std::_Placeholder<1>))(unsigned long, gz::msgs::LaserScan const&)>::__call<void, gz::msgs::LaserScan const&, 0ul, 1ul, 2ul>(std::tuple<gz::msgs::LaserScan const&>&&, std::_Index_tuple<0ul, 1ul, 2ul>)
#13   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd9e22db, in std::__invoke_result<void (gz::sim::v8::systems::ElevatorPrivate::*&)(unsigned long, gz::msgs::LaserScan const&), gz::sim::v8::systems::ElevatorPrivate*&, unsigned long&, gz::msgs::LaserScan const&>::type std::__invoke<void (gz::sim::v8::systems::ElevatorPrivate::*&)(unsigned long, gz::msgs::LaserScan const&), gz::sim::v8::systems::ElevatorPrivate*&, unsigned long&, gz::msgs::LaserScan const&>(void (gz::sim::v8::systems::ElevatorPrivate::*&)(unsigned long, gz::msgs::LaserScan const&), gz::sim::v8::systems::ElevatorPrivate*&, unsigned long&, gz::msgs::LaserScan const&)
#12   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd9f4ed9, in void std::__invoke_impl<void, void (gz::sim::v8::systems::ElevatorPrivate::*&)(unsigned long, gz::msgs::LaserScan const&), gz::sim::v8::systems::ElevatorPrivate*&, unsigned long&, gz::msgs::LaserScan const&>(std::__invoke_memfun_deref, void (gz::sim::v8::systems::ElevatorPrivate::*&)(unsigned long, gz::msgs::LaserScan const&), gz::sim::v8::systems::ElevatorPrivate*&, unsigned long&, gz::msgs::LaserScan const&)
#11   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd94e002, in gz::sim::v8::systems::ElevatorPrivate::OnLidarMsg(unsigned long, gz::msgs::LaserScan const&)
#10   Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd954163, in gz::msgs::LaserScan::ranges(int) const
#9    Object "/home/ren/play/robot/workspace/install/lib/gz-sim-8/plugins/libgz-sim-elevator-system.so", at 0x732fbd95410b, in gz::msgs::LaserScan::_internal_ranges(int) const
#8    Object "/lib/x86_64-linux-gnu/libprotobuf.so.23", at 0x732ff6ef06d9, in google::protobuf::RepeatedField<double>::Get(int) const
#7    Object "/lib/x86_64-linux-gnu/libprotobuf.so.23", at 0x732ff6e8d01c, in 
#6    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x732ffecae4d7, in __cxa_throw
#5    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x732ffecae276, in std::terminate()
#4    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x732ffecae20b, in 
#3    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x732ffeca2b9d, in 
#2    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x733002e287f2, in abort
#1    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x733002e42475, in raise
#0    Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x733002e969fc, in pthread_kill
Aborted (Signal sent by tkill() 27565 1000)
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
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant