loader(crash): append crash report records in a single write #121
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: launcher
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
run report
security: hold
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs gpu test
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Androtim--MiniVI!121
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/121/head"
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?
@Androtim on GitHub · 2026-11-29 13:05 UTC · original
Androtim:feat/iter122-loader-atomic-crash-append→main· +58 −4 · 1 files · 1 commits · merged 2026-11-29 14:05 UTCSummary
append_record(file, text)incrates/victory-loader/src/crash.rsto format the full crash report string first and append it via a singlefile.write(record.as_bytes())call, avoiding interleaved fragments when concurrent threads fault simultaneously.ErrorKind::WriteZeroon short writes without retrying (since retrying could interleave another thread's report between fragments), still lock-free for exception-handler safety.concurrent_crash_records_stay_togetherverifying 8 threads concurrently appending 168 KiBrecords produce intact non-interleaved reports.Verification
cargo +1.98.1-x86_64-pc-windows-gnu xtask policy:asset policy: 303 files okcargo +1.98.1-x86_64-pc-windows-gnu test -p victory-loader --lib --locked -- crash::: 20 passed; 0 failedcargo +1.98.1-x86_64-pc-windows-gnu clippy --workspace --all-targets --locked -- -D warningsand--features diagnostics: 0 code warnings@Androtim on GitHub · 2026-11-29 14:02 UTC · original
Automated triage for the maintainers (not an approval).
Verdict:
merge-candidate· CI (check):passingClean, focused fix with solid test coverage and passing CI.
Review Notes
crates/victory-loader/src/crash.rs(append_to_log,append_record): Previously,write!(f, ...)issued multiple unbufferedFile::write_allcalls per crash report (one per format literal/argument), allowing concurrent faulting threads to interleave fragments in the crash log. Formatting the full record into a single buffer and appending it with onefile.write(record.as_bytes())call avoids fragment interleaving without introducing a mutex that could deadlock inside an exception handler.ErrorKind::WriteZeroon a short write rather than retrying is the right trade-off here (avoiding split appends), andappend_to_logpreserves best-effort fire-and-forget semantics.concurrent_crash_records_stay_together: Verifies 8 concurrent threads × 16 records of 8 KiB each produce intact, non-interleaved 3-line records with exact set coverage and clean temp-dir cleanup.No GPU or runtime rendering paths are affected; ready as a merge candidate.
Generated with Antigravity CLI (
agy).