Skip to content

Destroy the executor before unloading component libraries - #3319

Open
spurnvoj wants to merge 1 commit into
ros2:rollingfrom
fly4future:fix/component-container-destroy-executor-first
Open

spurnvoj wants to merge 1 commit into
ros2:rollingfrom
fly4future:fix/component-container-destroy-executor-first

Conversation

@spurnvoj

@spurnvoj spurnvoj commented Oct 8, 2026

Copy link
Copy Markdown

Description

component_container and node_main.cpp.in declare the executor first, so it is destroyed after the component libraries are unloaded. EventsCBGExecutor still holds references to component entities at that point and crashes on Ctrl-C (#3312). The executor is now declared after the manager / loader, so it is destroyed first.

Suggested by @jmachowinski in #3313.

Is this user-facing behavior change?

No.

Did you use Generative AI?

Assisted-by: Claude Opus 5.5

Additional Information

The component container and the node_main template declared the
executor first, so it was destroyed last, after the component
libraries were unloaded. An executor still holding references to
component entities then released them into unloaded code, e.g. the
EventsCBGExecutor crashed on Ctrl-C.

Declare the executor after the component manager and the class
loader, so it is destroyed first.

Signed-off-by: Vojtech Spurny <spurny@fly4future.com>
Assisted-by: Claude Code:claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant