Skip to content

MoveGroupMoveAction detached goal workers can race shutdown, cancellation, and overlapping goals #3837

Open

Description

@elyforl

Description

MoveGroupMoveAction::initialize() accepts every goal and starts a detached thread that captures a raw this. The thread continues to use the capability context and shared per-action members throughout planning/execution, but the capability has no destructor or worker ownership. MoveGroupExe can therefore destroy the capability while a goal thread is still active.

The same design permits multiple accepted goals to execute concurrently while sharing goal_, move_state_, and preempt_requested_. The cancellation callback and workers access preempt_requested_ without synchronization.

ROS Distro

Jazzy

OS and version

Ubuntu 24.04

Source or binary build?

Source

If binary, which release version?

No response

If source, which branch?

No response

Which RMW are you using?

None

Steps to Reproduce

  1. Build the commit above with AddressSanitizer.
  2. Start move_group with trajectory execution enabled and send a MoveGroup action goal whose planning or execution remains active.
  3. Shut down move_group while the goal is active.
  4. Stress the timing or block the planning pipeline until MoveGroupExe::~MoveGroupExe() has begun, then release it.

Expected behavior

The capability owns all goal execution work and waits for it before destruction. Concurrent-goal behavior is explicit, and cancellation/state is scoped to and synchronized for the corresponding goal.

Actual behavior

Each accepted goal creates an untracked detached worker. Shutdown can free the capability first. Overlapping workers and cancel callbacks can concurrently overwrite or read shared state, including a plain bool preempt_requested_.

Backtrace or Console output

No response

Activity

  1. added
    bug
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions