Skip to content

Segmentation Fault in bt_navigator #5618

@yigitboracagiran

Description

@yigitboracagiran

Humble Branch
I applied this commit.

After I changed the below;
1- lifecycle_node.cpp: LifecycleNode::createBond() make_unique to make_shared
2- lifecycle_node.hpp: bond_ variable from unique pointer to shared pointer

My bt_navigator started to give segmentation fault error when I send a goal.

Note: I'm running in debug mode.


[INFO] [1760606775.805391890] [bt_navigator]: bt_navigator lifecycle node launched. Waiting on external lifecycle transitions to activate See https://design.ros2.org/articles/node_lifecycle.html for more information. 

[INFO] [1760606775.805511725] [bt_navigator]: Creating 

[INFO] [1760606775.962375019] [bt_navigator]: Configuring 

[INFO] [1760606777.558579073] [bt_navigator]: Activating 

[INFO] [1760606777.588819874] [bt_navigator]: Creating bond (bt_navigator) to lifecycle manager. 

[DEBUG] [1760606780.757258598] [bt_navigator]: [navigate_to_pose] [ActionServer] Received request for goal acceptance 

[DEBUG] [1760606780.757423968] [bt_navigator.rclcpp_action]: Accepted goal 741bbf9e221a7c55f77521a0837c1d77 

[DEBUG] [1760606780.757545206] [bt_navigator]: [navigate_to_pose] [ActionServer] Receiving a new goal 

[DEBUG] [1760606780.757593436] [bt_navigator]: [navigate_to_pose] [ActionServer] Executing goal asynchronously. 

[DEBUG] [1760606780.757857632] [bt_navigator]: [navigate_to_pose] [ActionServer] Executing the goal... 

[DEBUG] [1760606780.757933845] [bt_navigator.rclcpp_action]: Received status for unknown goal. Ignoring... 

[ros2run]: Segmentation fault

With gdb:


[INFO] [1760607544.522379183] [bt_navigator]: 

	bt_navigator lifecycle node launched. 

	Waiting on external lifecycle transitions to activate

	See https://design.ros2.org/articles/node_lifecycle.html for more information.

[INFO] [1760607544.522479150] [bt_navigator]: Creating

[INFO] [1760607556.590515159] [bt_navigator]: Configuring

[INFO] [1760607557.923865762] [bt_navigator]: Activating

[INFO] [1760607557.954600990] [bt_navigator]: Creating bond (bt_navigator) to lifecycle manager.

[DEBUG] [1760607617.032933479] [bt_navigator]: [navigate_to_pose] [ActionServer] Received request for goal acceptance

[DEBUG] [1760607617.033039788] [bt_navigator.rclcpp_action]: Accepted goal 88eff83318e46c6a3cb464943c95159

[DEBUG] [1760607617.033124316] [bt_navigator]: [navigate_to_pose] [ActionServer] Receiving a new goal

[DEBUG] [1760607617.033138102] [bt_navigator]: [navigate_to_pose] [ActionServer] Executing goal asynchronously.

[New Thread 0x7fffedef7640 (LWP 162978)]

[DEBUG] [1760607617.033420972] [bt_navigator]: [navigate_to_pose] [ActionServer] Executing the goal...

[DEBUG] [1760607617.033445237] [bt_navigator.rclcpp_action]: Received status for unknown goal. Ignoring...



Thread 10 "bt_navigator" received signal SIGSEGV, Segmentation fault.

[Switching to Thread 0x7fffedef7640 (LWP 162978)]

__memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:317

317	../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.

(gdb) bt full:


#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:317

No locals.

#1  0x00007ffff7c0e546 in void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) [clone .constprop.0] ()

   from /home/user1/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#2  0x00007ffff7c424fe in nav2_behavior_tree::BtActionServer<nav2_msgs::action::NavigateToPose>::loadBehaviorTree(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)

    () from /home/user1/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#3  0x00007ffff7c6ea5d in nav2_bt_navigator::NavigateToPoseNavigator::goalReceived(std::shared_ptr<nav2_msgs::action::NavigateToPose_Goal_<std::allocator<void> > const>) ()

   from /home/use1r/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#4  0x00007ffff7c26378 in nav2_bt_navigator::Navigator<nav2_msgs::action::NavigateToPose>::onGoalReceived(std::shared_ptr<nav2_msgs::action::NavigateToPose_Goal_<std::allocator<void> > const>) ()

   from /home/user1/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#5  0x00007ffff7c2e91b in std::_Function_handler<bool (std::shared_ptr<nav2_msgs::action::NavigateToPose_Goal_<std::allocator<void> > const>), std::_Bind<bool (nav2_bt_navigator::Navigator<nav2_msgs::action::NavigateToPose>::*(nav2_bt_navigator::Navigator<nav2_msgs::action::NavigateToPose>*, std::_Placeholder<1>))(std::shared_ptr<nav2_msgs::action::NavigateToPose_Goal_<std::allocator<void> > const>)> >::_M_invoke(std::_Any_data const&, std::shared_ptr<nav2_msgs::action::NavigateToPose_Goal_<std::allocator<void> > const>&&) ()

   from /home/user1/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#6  0x00007ffff7c4038b in nav2_behavior_tree::BtActionServer<nav2_msgs::action::NavigateToPose>::executeCallback() ()

   from /home/user1/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#7  0x00007ffff7c5166d in nav2_util::SimpleActionServer<nav2_msgs::action::NavigateToPose>::work()

    () from /home/user1/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#8  0x00007ffff7c5236c 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<nav2_util::SimpleActionServer<nav2_msgs::action::NavigateToPose>::handle_accepted(std::shared_ptr<rclcpp_action::ServerGoalHandle<nav2_msgs::action::NavigateToPose> >)::{lambda()#1}> >, void> >::_M_invoke(std::_Any_data const&) ()

   from /home/user1/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#9  0x00007ffff7f5906d 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/humble/lib/libbehaviortree_cpp_v3.so

No symbol table info available.

#10 0x00007ffff7499ee8 in __pthread_once_slow (once_control=0x5555558fe318, 

    init_routine=0x7ffff78dad50 <__once_proxy>) at ./nptl/pthread_once.c:116

        __cancel_routine = 0x7ffff7499f40 <clear_once_control>

        __clframe = {__cancel_routine = 0x7ffff7499f40 <clear_once_control>, 

          __cancel_arg = 0x5555558fe318, __do_it = 1, __buffer = {

            __routine = 0x7ffff7499f90 <__pthread_cleanup_combined_routine_voidptr>, 

            __arg = 0x7fffedef6270, __canceltype = 0, __prev = 0x0}}

--Type <RET> for more, q to quit, c to continue without paging--c

        val = <optimized out>

        newval = <optimized out>

#11 0x00007ffff7c22701 in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<nav2_util::SimpleActionServer<nav2_msgs::action::NavigateToPose>::handle_accepted(std::shared_ptr<rclcpp_action::ServerGoalHandle<nav2_msgs::action::NavigateToPose> >)::{lambda()#1}> >, void>::_M_run() () from /home/user1/ws/install/nav2_bt_navigator/lib/libbt_navigator_core.so

No symbol table info available.

#12 0x00007ffff78dc253 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6

No symbol table info available.

#13 0x00007ffff7494ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442

        ret = <optimized out>

        pd = <optimized out>

        out = <optimized out>

        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737488320112, -1181940661165855791, 140737185281600, 0, 140737342162896, 140737488320464, 1181980385192340433, 1181924050945731537}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}

        not_first_call = <optimized out>

#14 0x00007ffff75268c0 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

No locals.

Originally posted by @yigitboracagiran in d68ab16

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions