report: take a poisoned crash or write lock instead of losing the report #1695
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1705"
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 b3IKK on 2026-11-24T19:27:54Z.
report::lock_withintreats everytry_lockerror exceptWouldBlockas "give up":A poisoned lock is one a thread panicked while holding — exactly the situation a crash report exists for — yet it made
write_finalreturn before writing anything (WRITE_LOCK) andbuilddrop the crash text (.ok()onCRASH). So a panic insidebuild()took the report with it, including the crash it was reporting.This takes the poisoned guard with
TryLockError::Poisoned(e) => Some(e.into_inner())inlock_within, and readsCRASHthroughlock_withininbuildso the crash text is not silently dropped. A lock held by a live thread is still not waited for beyondwait, so a report from a thread already insidebuild()cannot wedge the process at exit.What is in it
crates/xcl/src/report.rs: handleTryLockError::Poisonedinlock_within; readCRASHthrough it inbuild; add unit testa_poisoned_lock_is_taken_instead_of_losing_the_report(fails onmainatexpect("a poisoned lock is still taken")) and keep the held-lock timeout assertion.Tested
stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1).\scripts\test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4): 960 passed, 0 failed, 43 ignored (SKIPPED: the wave64 / direct-DXIL per-lane tests that need 64-lane hardware or a semantics mode this adapter refuses,no heap windows, andcannot disable the driver cache (Windows Developer Mode is required))cargo test -p xcl --lib report::tests: 2 passed, 0 failedRegression run
main (
1d027e5, clean tree, no local changes):PR (
cf0cde2, clean tree, no local changes):(Two runs of this head: 1229 and 1232 frames. The change is in
report.rsonly — nothing on the render path — andXCL_TRANSLATOR_SOURCE_ID, which keys the translated-shader cache, does not include it; the minute went into the title's compute-pipeline work on this loaded box. No crashes and no device removals in either.)Not tested
build()(the unit test poisons the lock directly)AI use
report.rs, wrote the fix and unit test (and confirmed it fails without the fix), rebased onto1d027e5, ran the test suite andscripts/smoke.ps1regression runs with #677's title hashing, and drafted this PR description.Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T22:02:34Z.
Rebased onto
1d027e5and re-ran: 960 passed, 0 failed, 43 ignored; the blocks above use the current scripts/smoke.ps1 (#677's hashed itle: line). The PR block's frame count is lower than main's on this loaded box — the change is ineport.rs only and is not part of the translated-shader cache key — but both runs show 0 crashes and 0 device removals.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T22:09:44Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.Thanks!
Imported from ivall/xcl. Originally posted by throny on 2026-11-25T00:37:54Z.
Two contributors checked independently and found that #240 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 CalvyPZ on 2026-11-25T22:45:53Z.
This PR has been marked as a duplicate and closed after multiple agreeing checks in #1607. If you believe this is incorrect please re-open with why.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T06:07:52Z.
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.Thanks!
— Devin
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:43:05Z.
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-01T06:32:19Z.
Triage (#1607) – head
cf0cde2#240 also makes
report::lock_withintake a poisoned lock. It goes further: a thread-local re-entrancy guard, and fallback report writes made withoutWRITE_LOCK, which can race the thread that holds it. Itsbuild()also readsCRASHwith a blockinglock(). This PR is the minimal form (the poisoned branch,build()throughlock_withinwith no wait, and a test). Neither is on main.No problems found in the diff.
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.