Skip to content

Lifecycle manager crash on startup during heavy CPU load #2689

@afrixs

Description

@afrixs

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • ROS2 Version:
    • Galactic binaries
  • Version or commit hash:
  • DDS implementation:
    • Eclipse Cyclone DDS

Steps to reproduce issue

This happened when I launched nav2 bringup while many CPU-expensive nodes were running (Gazebo, data processing, object detection, ...).

Most easily reproducible by adding

std::this_thread::sleep_for(500ms);

at the end of lifecycle manager constructor and launching

ros2 launch nav2_bringup bringup_launch.py 

Expected behavior

LifecycleManager starts.

Actual behavior

LifecycleManager crashes in createLifecycleServiceClients() method on shared_from_this() as the shared pointer has not been created yet when init_timer_ fires.

Additional information

Can be fixed by removing callback_group_ from init_timer_ construction, so that the callback is fired from rclcpp::spin(node) after the shared ptr has been created for sure. Cannot say whether this change affects negatively different ways of bringing up the manager (other than ros2 launch nav2_bringup bringup_launch.py )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions