ControlProvider cannot be moved — captured this in registered callbacks makes it unsafe
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- distributed-systems
Research direction
Start with the ControlProvider implementation and main.cpp, then inspect ProcessGroupManager::deinitialize() and the control_provider and launch_manager Bazel targets. Verify that callback state has stable lifetime during drained transitions, Create() returns the provider by value, failure paths do not leak, and the build plus end-to-end ActivateRunTarget checks pass.
Written by the indexing model from the issue text.
Description
Description
Follow-up from discussion on #489 (comment).
Analysis results
ControlProvider registers three callbacks that capture this (activate_run_target/get_active_run_target handlers via RegisterHandler, and registerActiveRunTargetCallback), with no unregister path for any of them. Because of that, ControlProvider is currently non-movable and non-copyable, and Create() returns Result<ControlProvider*> — if it were moved, the callbacks would keep pointing at the old, now-dangling address (a real use-after-free, not just a theoretical one).
Solution
Proposed fix: move the callback-registering state (skeleton_, graph_, and the three setup*/handle* methods) into a private ControlProvider::Impl, with the callbacks capturing Impl* instead. ControlProvider then holds a single unique_ptr and becomes freely movable — moving it only moves the pointer, and Impl's address never changes. Create() can then return Result by value.
As a side effect this also fixes a leak on Create()'s failure paths (the current raw new is never deleted if a later setup*() call fails) and surfaces a lifetime dependency in main.cpp that the current code satisfies only by accident (scoping needs to keep ControlProvider alive through ProcessGroupManager::deinitialize()'s drain, since a drained transition can still invoke the registered callback).
Error Occurrence Rate
None
How to reproduce
Status: already implemented and verified — bazel build of control_provider + the full launch_manager binary succeeds, and manually verified end-to-end against a real Launch Manager daemon (2/2 ActivateRunTarget round trips over shared-memory IPC). Will open as a separate PR once #489 merges, per @danth's request on the thread above.
Supporting Information
No response
Classification
Minor
First Affected Release
not released (main)
Last Affected Release
not released (main)
Expected Fixed Release
before release (main)
Category
- Safety Relevant
- Security Relevant
- Dominant language
- C++
- Stars
- 6
- Forks
- 34
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 83
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-score/lifecycle
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
eclipse-score/lifecycle#407 ·
-
cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
eclipse-score/lifecycle#375 ·
-
Feature Req Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
eclipse-score/lifecycle#664 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
eclipse-score/lifecycle#652 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
eclipse-score/lifecycle#648 ·
All issues in eclipse-score/lifecycle
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·