forked from redox-os/redox
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
During runtime, a warning is being triggered indicating that a PendingState::Placeholder is persisting when it should have been replaced with a valid state.
Warning message:
[src/procmgr.rs:284 WARN] State Id(25) was placeholder!
Root Cause Analysis
In recipes/core/base/source/bootstrap/src/procmgr.rs, the Placeholder variant is used as a temporary placeholder during state transitions:
let this_state = core::mem::replace(state, PendingState::Placeholder);The placeholder should always be immediately replaced with a valid state. However, line 284 shows that sometimes a cancellation request encounters a Placeholder state, which suggests:
- A state transition didn't complete properly (the placeholder wasn't replaced)
- A cancellation is being processed before the state transition completes
- There's a race condition between state updates and cancellations
Location
- File:
recipes/core/base/source/bootstrap/src/procmgr.rs:284 - Function: Cancellation handling logic
- Related: Line 1672 where placeholder is created during state transitions
Expected Behavior
The Placeholder state should never be observed during normal operation. It should only exist momentarily during mem::replace operations.
Actual Behavior
VirtualId(25) is in a Placeholder state when a cancellation request is processed, triggering the warning.
Impact
- May indicate incomplete state transitions
- Could potentially lead to request handling failures
- Suggests possible race conditions in process management
Suggested Investigation
- Add more detailed logging around state transitions (especially around line 1672)
- Check if there are concurrent operations on the same VirtualId
- Verify that all code paths properly replace the Placeholder with a valid state
- Consider using a more robust state transition mechanism that doesn't rely on temporary invalid states
Metadata
Metadata
Assignees
Labels
No labels