Skip to content

Incompatibility Issue Between BehaviorTree.ROS2 (v4) and nav2_behavior_tree (v3) Causing Crash #116

@Noah-Lau

Description

@Noah-Lau

Description:

I am encountering an issue while trying to use BehaviorTree.ROS2 with navigation2 in a ROS 2 Humble environment on Ubuntu 22.04. Specifically, I want to trigger navigation actions using BehaviorTree.ROS2 instead of the default nav2_bt_navigator. To achieve this, I copied the behavior tree XML files from navigation2 into my sample_bt_executor.yaml configuration for a custom sample_bt_executor node. However, this results in a crash with the following logs:

[INFO] [launch]: All log files can be found below /home/noah/.ros/log/2025-07-04-14-16-02-229927-noah-298395
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [sample_bt_executor-1]: process started with pid [298405]
[INFO] [sleep_server-2]: process started with pid [298407]
[sample_bt_executor-1] [INFO] [1751609762.298440445] [bt_action_server]: Starting Action Server: behavior_server
[sample_bt_executor-1] [INFO] [1751609762.300898229] [bt_action_server]: Loaded ROS Plugin: libmovebase_node_dyn.so
[sample_bt_executor-1] [INFO] [1751609762.301057632] [bt_action_server]: Loaded ROS Plugin: libcrossdoor_nodes_dyn.so
[sample_bt_executor-1] [INFO] [1751609762.301256744] [bt_action_server]: Loaded ROS Plugin: libdummy_nodes_dyn.so
[sample_bt_executor-1] [INFO] [1751609762.302595313] [bt_action_server]: Loaded ROS Plugin: libsleep_plugin.so
[sample_bt_executor-1] munmap_chunk(): invalid pointer
[ERROR] [sample_bt_executor-1]: process has died [pid 298405, exit code -6, cmd '/home/noah/ros2_ws/install/btcpp_ros2_samples/lib/btcpp_ros2_samples/sample_bt_executor --ros-args --params-file /home/noah/ros2_ws/install/btcpp_ros2_samples/share/btcpp_ros2_samples/config/sample_bt_executor.yaml'].
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[sleep_server-2] [INFO] [1751610662.775527823] [rclcpp]: signal_handler(signum=2)
[INFO] [sleep_server-2]: process has finished cleanly [pid 298407]

Problem Details:

  • BehaviorTree.ROS2 in my setup is using behaviortree_cpp v4, while the Humble version of navigation2's nav2_behavior_tree is built with behaviortree_cpp v3.
  • I copied the behavior tree XML files (e.g., from navigation2) into sample_bt_executor.yaml to trigger navigation actions via my custom sample_bt_executor instead of nav2_bt_navigator.
  • The process starts and loads several plugins successfully, but crashes with munmap_chunk(): invalid pointer and exit code -6 (SIGABRT), indicating a memory management issue.

Suspected Cause:
I suspect this crash is due to the incompatibility between behaviortree_cpp v4 (used by BehaviorTree.ROS2) and v3 (used by nav2_behavior_tree). The mismatch might cause memory allocation/deallocation conflicts, leading to the munmap_chunk() error.

Question:
How can I resolve this incompatibility? Possible approaches I am considering include:

  • Modifying navigation2 to build with behaviortree_cpp v4.
  • Adapting the XML files or plugins to be compatible with v4.
  • Using a different version of ROS 2 (e.g., Jazzy) that natively supports v4.

Could you please provide guidance on the best way to address this issue? Any suggestions or patches would be greatly appreciated!

Environment:

  • OS: Ubuntu 22.04
  • ROS 2 Version: Humble Hawksbill
  • behaviortree_cpp Version: v4 (BehaviorTree.ROS2), v3 (nav2_behavior_tree)

Additional Information:

  • I am willing to provide further logs or code snippets if needed.
  • The project involves integrating custom navigation logic with XMobilityNavigator from booster_robotics_sdk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions