sim(storage): a truncation that overtakes a delayed read completes as InvalidInput instead of a short read
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 70/100
Research direction
Start by tracing the read submission and completion paths in crates/moonpool-sim/src/storage/file.rs:106 and crates/moonpool-sim/src/storage/sim/engine.rs:1217, then inspect FileImage::read in crates/moonpool-sim/src/storage/image.rs:241. Add ordered two-handle tests for partial truncation and truncation below the read offset across stream and positioned reads. Done means truncation produces a short read or EOF rather than InvalidInput, with the effective fault range and stream-cursor advance handled.
Written by the indexing model from the issue text.
Description
Found during the pre-release source audit of 8d9e779 (read-only, nothing compiled or run). Severity: medium. Status: plausible (path traced, not reproduced).
Where
crates/moonpool-sim/src/storage/file.rs:106(read length clamped at submission)crates/moonpool-sim/src/storage/sim/engine.rs:1217(completion readspending.len)crates/moonpool-sim/src/storage/image.rs:241(FileImage::readrejects any range past EOF withInvalidInput)
What
Simulated reads clamp their length when submitted. If another handle truncates the file before the delayed read completes, completion still uses the old length and FileImage::read returns InvalidInput because the range now runs past EOF. The caller sees a storage error that no injected fault explains.
Proposed fix
Reconcile the read length with the current EOF at completion (including the effective fault range and stream-cursor advance) and return a short read or EOF. Add ordered two-handle tests for partial truncation and truncation below the read offset, for both stream and positioned reads.
- Dominant language
- Rust
- Stars
- 49
- Forks
- 3
- Avg merge
- 1h 4m
- Merged PRs (30d)
- 41
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 PierreZ/moonpool
-
bug simulation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug github_actions
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
bug simulation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug simulation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
documentation release-blocker
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
All issues in PierreZ/moonpool
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100