Report: lock-safe crash report persistence under contention and re-entrancy (#106) #237
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/240"
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?
Imported from ivall/xcl. Originally posted by slopgobblercobbler on 2026-11-23T21:45:47Z.
Addresses #106 Item 4 (Crash reporting lock safety & persistence under contention):
Prevents dropping crash data during process termination or unhandled exceptions:
lock_within()andbuild()recover from mutex poisoning viap.into_inner(), guaranteeing the report persists even if a thread panics during exit.InWriteGuardprevents same-thread recursion if formatting/writing faults, using a fallback path rather than self-deadlocking onWRITE_LOCK.WRITE_LOCKcannot be acquired within timeout during process termination, writes a direct fallback report or refreshes the existing report file rather than discarding crash data.CRASHbefore and after serialization so a concurrent crash is captured before process exit.What is in it
crates/xcl/src/report.rs:lock_withinwith poison recovery.InWriteGuardre-entrancy tracker.Tested
cargo test -p xcl -- report(24 passed, 0 failed).cargo test --workspace(608 passed, 0 failed).Not tested
AI use
author-report,verify-report). Verified and reviewed independently.Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:33:51Z.
Test run of
62cd3bcc6028930ec22237dfbd271fd7a81ba461on AMD RDNA4. I merged it onto currentmain64b3f35locally (clean merge) and tested that tree.Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 707 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 666 passed, 0 failed, 21 ignoredSKIPPED; thereporttests pass.Review: Recovering the report data from a poisoned mutex (
into_inner) and the thread-localIN_WRITEguard against re-entry mean a panic or a nested fault while writing no longer loses the report. I found nothing to change.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T00:37:53Z.
Two contributors checked independently and found that #1705 solves the same problem in a different way: #1607, group D65. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.
This is a hint from the community triage in #1607, not a maintainer decision.
AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T15:14:24Z.
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:43:41Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:01:40Z.
Triage (#1607) – head
62cd3bcOverlap: #1705 makes the same core fix:
lock_withintakes a poisoned lock instead of losing the crash, with a test. This PR adds a same-thread re-entrancy guard, a fallback report, and rechecks ofCRASHafterbuild()and after the write. Neither is on main.Problem in
report.rs: write_final: whenWRITE_LOCKtimes out, the fallback path loads and rewrites the report file without the lock while the holder may be writing it.loadcan then read a half-written file and fall back tobuild_fallback, overwriting the full report with a minimal one.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.