[BUG] Utility cleanup can hide the original operation error #8
Labels
No labels
alpha-1
bug
ci
docs
duplicate
enhancement
help wanted
invalid
performance
phase-6
question
refactor
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
erix/coreutils#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The shared utility lease wrapper and copy/listing retirement paths can replace an
original operation or acquisition error with a later cleanup error. Multiple
failed releases also retain the last error rather than the first. Inherited
stream teardown also stops at its first failed close, skipping later owned
directions.
Reproduction
At Coreutils
0e7ad3017c, arrange a failing copyread followed by a failing destination release, or fail the second acquisition
and then the held source release. The code uses release(...)? before returning
the original Result. Inspect src/runtime/execute/authority.rs and copy.rs.
Expected and actual behavior
Preserve the original operation/acquisition/validation error, attempt every
already-owned release once, and retain the first cleanup failure separately.
A later execution or acquisition must refuse after uncertain cleanup. Successful
stream teardown must also permanently end admission; each already-owned dynamic
direction is attempted once, including after an earlier close failure.
The original code instead returns the later release error; its shared release
loop overwrites earlier cleanup errors and does not retain the stream-level latch.
Environment and identity
0e7ad3017c.Evidence and prior checks
The shared repair
uses one retirement helper across these paths and man. It also handles malformed
returned grants and acquisition cleanup uncertainty. Eight original lease controls and seven dynamic-stream lifecycle controls
execute in 7bbe1f2d.
The fresh supported-profile matrix passes 215 default and 216 all-feature Rust
cases plus hosted/freestanding strict checks without build warnings. Original
failed checks remain retained; no old-source failure or exploit is inferred.
Tracking
Related to Coreutils PR2.
7bbe1f2d completes dynamic stream retirement: every owned direction is attempted once, the first typed cleanup error is retained, and both successful and uncertain teardown end admission. The affected controls execute in both configurations; 215 default and 216 all-feature Rust cases and strict host/native checks pass without build warnings. This closes the reported cleanup scope.