PickNikRobotics / bio_ik

MoveIt kinematics_base plugin based on particle optimization & GA
BSD 3-Clause "New" or "Revised" License
12 stars 7 forks source link

Linking bio_ik to MoveIt tutorial causes RMW crash #7

Open wyattrees opened 2 years ago

wyattrees commented 2 years ago

Adding bio_ik as a dependency of any of the MoveIt tutorials and linking it via ament_target_dependencies will cause a crash when instantiating a rclcpp::Node::SharedPtr object. No bio_ik headers need to be included in the moveit tutorial code in order for this crash to happen.

Thread 1 "moveit_cpp_tuto" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, Reading in symbols for ../sysdeps/posix/raise.c...
signo=6, threadid=140737289368512) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) backtrace
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737289368512) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737289368512) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (Reading in symbols for abort.c...
threadid=140737289368512, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7381476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff73677f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff70f668e in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#6  0x00007ffff710c8db in __gcc_personality_v0 () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#7  0x00007ffff7727c7c in _Unwind_RaiseException_Phase2 () from /home/wyatt/workspaces/cart_interp/install/bio_ik/lib/libbio_ik.so
#8  0x00007ffff7728460 in _Unwind_RaiseException () from /home/wyatt/workspaces/cart_interp/install/bio_ik/lib/libbio_ik.so
Reading in symbols for <artificial>@0x327a80...
#9  0x00007ffff767dd0c in __cxa_throw () from /home/wyatt/workspaces/cart_interp/install/bio_ik/lib/libbio_ik.so
#10 0x00007ffff3266d6f in asio::detail::throw_exception<std::system_error> (Reading in symbols for <artificial>@0x6697f0...
e=...) at /usr/include/asio/detail/throw_exception.hpp:42
#11 0x00007ffff3266d90 in asio::detail::do_throw_error (Reading in symbols for <artificial>@0x6d3a71...
err=..., location=<optimized out>) at /usr/include/asio/detail/impl/throw_error.ipp:49
#12 0x00007ffff343433d in asio::detail::throw_error (location=<optimized out>, err=..., err=..., location=<optimized out>) at /usr/include/asio/detail/throw_error.hpp:41
#13 asio::basic_socket<asio::ip::udp, asio::execution::any_executor<asio::execution::context_as_t<asio::execution_context&>, asio::execution::detail::blocking::never_t<0>, asio::execution::prefer_only<asio::execution::detail::blocking::possibly_t<0> >, asio::execution::prefer_only<asio::execution::detail::outstanding_work::tracked_t<0> >, asio::execution::prefer_only<asio::execution::detail::outstanding_work::untracked_t<0> >, asio::execution::prefer_only<asio::execution::detail::relationship::fork_t<0> >, asio::execution::prefer_only<asio::execution::detail::relationship::continuation_t<0> > > >::bind (
    endpoint=..., this=0x7fffffff0690) at /usr/include/asio/basic_socket.hpp:787
#14 eprosima::fastdds::rtps::UDPv4Transport::OpenAndBindInputSocket (this=this@entry=0x555555661680, sIp="0.0.0.0", port=<optimized out>, is_multicast=is_multicast@entry=false) at ./src/cpp/rtps/transport/UDPv4Transport.cpp:308
#15 0x00007ffff3444e68 in eprosima::fastdds::rtps::UDPTransportInterface::CreateInputChannelResource (this=0x555555661680, sInterface="0.0.0.0", locator=..., is_multicast=<optimized out>, maxMsgSize=65500, receiver=0x555555655470) at ./src/cpp/rtps/transport/UDPTransportInterface.cpp:231
#16 0x00007ffff3445255 in eprosima::fastdds::rtps::UDPTransportInterface::OpenAndBindInputSockets (this=0x555555661680, locator=..., receiver=0x555555655470, is_multicast=false, maxMsgSize=65500) at ./src/cpp/rtps/transport/UDPTransportInterface.cpp:207
#17 0x00007ffff34325f4 in eprosima::fastdds::rtps::UDPv4Transport::OpenInputChannel (this=0x555555661680, locator=..., receiver=0x555555655470, maxMsgSize=65500) at ./src/cpp/rtps/transport/UDPv4Transport.cpp:327
#18 0x00007ffff339e9e0 in eprosima::fastrtps::rtps::ReceiverResource::ReceiverResource (this=<optimized out>, transport=..., locator=..., max_recv_buffer_size=<optimized out>, this=<optimized out>, transport=..., locator=..., max_recv_buffer_size=<optimized out>)
    at ./src/cpp/rtps/network/ReceiverResource.cpp:41
#19 0x00007ffff339ebfe in eprosima::fastrtps::rtps::NetworkFactory::BuildReceiverResources (this=<optimized out>, local=..., returned_resources_list=std::vector of length 0, capacity 0, receiver_max_message_size=4294967295) at /usr/include/c++/11/bits/unique_ptr.h:173
#20 0x00007ffff33a3cf7 in eprosima::fastrtps::rtps::RTPSParticipantImpl::createReceiverResources (this=0x55555563f6a0, Locator_list=..., ApplyMutation=true, RegisterReceiver=false) at ./src/cpp/rtps/participant/RTPSParticipantImpl.cpp:1582
#21 0x00007ffff33a4e03 in eprosima::fastrtps::rtps::RTPSParticipantImpl::RTPSParticipantImpl (this=<optimized out>, domain_id=<optimized out>, PParam=..., guidP=..., persistence_guid=..., par=<optimized out>, plisten=<optimized out>, this=<optimized out>, domain_id=<optimized out>, PParam=..., guidP=..., 
    persistence_guid=..., par=<optimized out>, plisten=<optimized out>) at ./src/cpp/rtps/participant/RTPSParticipantImpl.cpp:344
Reading in symbols for <artificial>@0x36d522...
#22 0x00007ffff33a5c89 in eprosima::fastrtps::rtps::RTPSParticipantImpl::RTPSParticipantImpl (this=<optimized out>, domain_id=<optimized out>, PParam=..., guidP=..., par=<optimized out>, plisten=<optimized out>, this=<optimized out>, domain_id=<optimized out>, PParam=..., guidP=..., par=<optimized out>, 
    plisten=<optimized out>) at ./src/cpp/rtps/participant/RTPSParticipantImpl.cpp:433
Reading in symbols for <artificial>@0x580219...
#23 0x00007ffff33b0270 in eprosima::fastrtps::rtps::RTPSDomain::createParticipant (Reading in symbols for <artificial>@0x53cf6d...
domain_id=0, enabled=<optimized out>, attrs=..., listen=0x5555556615d0) at ./src/cpp/rtps/RTPSDomain.cpp:182
#24 0x00007ffff3407d20 in eprosima::fastdds::dds::DomainParticipantImpl::enable (Reading in symbols for <artificial>@0x0...
this=0x555555660a50) at ./src/cpp/fastdds/domain/DomainParticipantImpl.cpp:303
#25 0x00007ffff3401f26 in eprosima::fastdds::dds::DomainParticipant::enable (this=0x5555556609f0) at ./src/cpp/fastdds/domain/DomainParticipant.cpp:95
#26 eprosima::fastdds::dds::DomainParticipant::enable (this=0x5555556609f0) at ./src/cpp/fastdds/domain/DomainParticipant.cpp:87
#27 eprosima::fastdds::dds::DomainParticipantFactory::create_participant (Reading in symbols for <artificial>@0x3ce5b...
this=0x7ffff3862960 <eprosima::fastdds::dds::DomainParticipantFactory::get_instance()::instance>, did=did@entry=0, qos=..., listen=<optimized out>, Reading in symbols for <artificial>@0x0...
mask=...) at ./src/cpp/fastdds/domain/DomainParticipantFactory.cpp:249
#28 0x00007ffff38f3033 in __create_participant (identifier=0x7ffff3968000 "rmw_fastrtps_cpp", domainParticipantQos=..., leave_middleware_default_qos=<optimized out>, publishing_mode=publishing_mode_t::SYNCHRONOUS, common_context=0x555555660430, domain_id=0) at ./src/participant.cpp:99
#29 0x00007ffff390059d in rmw_fastrtps_shared_cpp::create_participant (identifier=identifier@entry=0x7ffff3968000 "rmw_fastrtps_cpp", domain_id=0, security_options=security_options@entry=0x55555563d208, localhost_only=<optimized out>, enclave=<optimized out>, 
    common_context=common_context@entry=0x555555660430) at ./src/participant.cpp:284
#30 0x00007ffff394fb03 in init_context_impl (context=0x55555563d1e0) at /usr/include/c++/11/bits/std_function.h:211
#31 0x00007ffff3958790 in rmw_fastrtps_cpp::increment_context_impl_ref_count (context=0x55555563d1e0) at ./src/init_rmw_context_impl.cpp:196
#32 rmw_create_node (context=0x55555563d1e0, name=0x5555556603d0 "moveit_cpp_tutorial", namespace_=0x7ffff6dd3866 "/") at ./src/rmw_node.cpp:60
#33 0x00007ffff6dcb87a in rcl_node_init () from /opt/ros/humble/lib/librcl.so
#34 0x00007ffff78ce82d in rclcpp::node_interfaces::NodeBase::NodeBase(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&, std::shared_ptr<rclcpp::Context>, rcl_node_options_s const&, bool, bool) () from /opt/ros/humble/lib/librclcpp.so
#35 0x00007ffff78cf187 in rclcpp::Node::Node(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&, rclcpp::NodeOptions const&) () from /opt/ros/humble/lib/librclcpp.so
#36 0x000055555556cd3d in std::__shared_ptr<rclcpp::Node, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<rclcpp::Node>, char const (&) [15], char const (&) [1], rclcpp::NodeOptions&>(std::_Sp_alloc_shared_tag<std::allocator<rclcpp::Node> >, char const (&) [15], char const (&) [1], rclcpp::NodeOptions&) ()
Reading in symbols for ../sysdeps/x86/libc-start.c...
#37 0x00005555555607df in main ()

Switching the RMW to Cyclone DDS avoids this crash, however, will result in a segmentation fault during cleanup.

double free or corruption (fasttop)

Thread 1 "moveit_cpp_tuto" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737288229824) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
(gdb) backtrace
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737288229824)
    at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737288229824)
    at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737288229824, signo=signo@entry=6)
    at ./nptl/pthread_kill.c:89
#3  0x00007ffff7368476 in __GI_raise (sig=sig@entry=6)
    at ../sysdeps/posix/raise.c:26
#4  0x00007ffff734e7f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff73af6f6 in __libc_message (action=action@entry=do_abort, 
    fmt=fmt@entry=0x7ffff7501b8c "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#6  0x00007ffff73c6d7c in malloc_printerr (
    str=str@entry=0x7ffff7504768 "double free or corruption (fasttop)")
    at ./malloc/malloc.c:5664
#7  0x00007ffff73c8a4a in _int_free (av=0x7ffff753fc80 <main_arena>, 
    p=0x555555baf8a0, have_lock=0) at ./malloc/malloc.c:4539
#8  0x00007ffff73cb4d3 in __GI___libc_free (mem=<optimized out>)
    at ./malloc/malloc.c:3391
#9  0x00007ffff736ba56 in __cxa_finalize (d=0x7ffff77723e0)
    at ./stdlib/cxa_finalize.c:83
#10 0x00007ffff75fccb7 in __do_global_dtors_aux ()
   from /home/wyatt/workspaces/cart_interp/install/bio_ik/lib/libbio_ik.so
#11 0x00007fffffffb580 in ?? ()
--Type <RET> for more, q to quit, c to continue without paging--
#12 0x00007ffff7fc924e in _dl_fini () at ./elf/dl-fini.c:142
Backtrace stopped: frame did not save the PC
(gdb) info threads
  Id   Target Id                                           Frame 
* 1    Thread 0x7ffff41253c0 (LWP 17861) "moveit_cpp_tuto" __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737288229824)
    at ./nptl/pthread_kill.c:44
theodoropoulos7 commented 1 year ago

@wyattrees Have you found a solution? It seems that after all this time I am facing a similar Issue. I get a crash during runtime when linking bio_ik using ament_target_dependencies() in ROS2 Humble Ubuntu 22

DocVaughan commented 4 weeks ago

Did either of you figure out this issue? I think I'm running into the same thing. I'm also on ROS 2 Humble and Ubuntu 22.

theodoropoulos7 commented 2 weeks ago

I couldn't find a solution at the time, so I put the problem on hold. I may revisit it in the future though. In any case, if you find a solution or a workaround to get bio_ik working on ROS2, please let us know.