Repository navigation
Loader: serialize crash-log appends in a single write - #2403
ashrafsdrop wants to merge 1 commit into
Conversation
Addresses the crash-log interleaving reported in Marvisak#2025: - Format each crash/panic log entry into a single buffer and write it via write_all under a static Mutex so concurrent threads never interleave lines mid-report. - Add concurrent_crash_log_appends_do_not_interleave unit test.
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: merged into main 940d32f, cargo test -p victory-loader --locked on macOS arm64. The 3 failures (prepare::tests) are the known pre-existing macOS ones — they parse the host's own Mach-O test binary as PE ("Unknown file magic"), fail identically on main, and are exactly what #2334's #[cfg(windows)] gating removes. Approving — crash-log appends serialized in a single write.
|
Automated triage for the maintainers. Merge candidate (worth a look). This fixes interleaved entries in Generated by Claude Code |
|
Independent local validation, PR #2403 (Windows, Rust 1.100.0/MSVC, head ed3d01a, no game data): |
|
Automated triage for the maintainers, second look (a review against current Closing in favour of #2033, which makes the same single buffered write without the mutex. One If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution. |
Addresses the crash-log interleaving reported in #2025:
Summary
crates/victory-loader/src/crash.rs,append_to_logpreviously usedwrite!(f, ...)without a lock, issuing multipleWrite::writecalls that interleaved mid-report when concurrent threads hit exceptions or panics.append_to_fileto format the entire entry into a single buffer and write it viawrite_allunder a staticLOG_LOCKmutex.Verification
concurrent_crash_log_appends_do_not_interleave(8 threads x 25 multi-line appends verified intact).cargo test -p victory-loader(35 unit + 4 integration tests passed).cargo clippy -p victory-loader --all-targets --all-features -- -D warnings(clean).cargo run -p xtask -- policy(182 files ok).