xcl run: end the process when the title's crash filter has not ended it in 30 s #961
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/967"
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 milas6669 on 2026-11-24T09:38:44Z.
After an unhandled exception XCL logs the crash and hands over to the title's own crash filter. A retail title's filter (a crash report of a process with tens of GB committed) can take very long or never return, and nothing in XCL ends the process then. On an 8 GB card the run ended with
0xc0000005 in VCRUNTIME140.dll, theprocess endsline never came, and the process stayed "not responding" with 29 GB committed for 4 minutes until it was killed by hand (the same happened in a second run).A thread started with the crash handler waits for the first unhandled exception, then gives the process
XCL_CRASH_EXIT_SECONDS(default 30; 0 turns it off) to end by itself, and ends it through the realNtTerminateProcess(not our hook, whose thread dump could hang the same way) with status 0xC0000005. A process that ends in time is left alone.What is in it
crates/xcl/src/eh.rs:crash_exit_seconds,crash_deadline(takes the end action as a closure, so it can be tested),end_process_now, the thread started ininstall_crash_handler, andCRASHEDset at the top ofunhandled_filter; three unit tests ofcrash_deadline(ends a process that does not end itself; leaves one that ends in time; waits for a crash first)tests/testtitle/src/main.rs:--hang-in-crash-filter(a crash filter that sleeps forever, then a null write)crates/xcl/tests/e2e.rs:a_crash_filter_that_never_returns_does_not_keep_the_process_aliveruns it withXCL_CRASH_EXIT_SECONDS=2, kills the process tree if it is still alive after 120 s, and checks the log for the crash and for the deadline lineTested
cargo test --workspace --no-fail-fast -- --test-threads=4on this commit: 723 passed, 0 failed, 41 ignoredgpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware(no wave64)eh.rsfrom main, the process is still alive after 120 s and the test fails with "the process was still alive 120 s after the title's crash filter hung" (120.8 s)Regression run (retail title, 60 s, release builds, default settings)
main (
6bac4b4):this PR (
c997205):Not tested
XCL_CRASH_EXIT_SECONDSAI use
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-24T10:38:16Z.
Linux / AMD RDNA3 datapoint, with a Wine caveat on the new test.
Merged state: head onto main
6bac4b4(lane merge), clean merge.Full suite,
cargo test --workspace --release --no-fail-fast --target x86_64-pc-windows-gnu -- --test-threads=4: 720 passed, 8 failed, 41 ignored; 7 are the known Wine-lane set from my #42 rows, and the 8th is this PR's new e2e test, failing 3/3 deterministically:a_crash_filter_that_never_returns_does_not_keep_the_process_alive(crates/xcl/tests/e2e.rs) - fails at theunhandled exception 0xc0000005log assert. Diagnosis from the capturedxcl.log: the test title exits ~0.2 s after start, before it ever takes the crash - the log ends atDirectStorage: request #0mid-startup, thexcl-crash-deadlinethread is present and waiting, but no exception is ever logged. The process does exit non-success, so the first assert passes and the crash-logging assert fails.test_title_runs_and_game_folder_is_untouchedfailure on this rig (the testgame's startup path dies under Wine before the deliberate crash), not a defect in the deadline mechanism itself. Thexcl run+ testgame-under-Wine path can't validate this fix on Wine lanes until that e2e family is stable.Counts only, no game data. Full captured log on request.
Not tested: retail titles (none here), Windows, RDNA4.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross
x86_64-pc-windows-gnu,XCL_NETWORK=0, release profile,--test-threads=4. My Linux rows: #42 / #718.AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-24T10:40:25Z.
Code/CI review only (not independently runtime-tested by me): clean merge and
PR descriptiongreen (just awaiting CI workflow approval). Cleanly enforces a 30 s exit deadline inxcl runif a title's crash filter stalls process termination. Recommend approving CI and merging, @ivall.Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T12:29:40Z.
Independent verification, merged onto current
main384f7f7locally (clean merge).Machine: Windows 11, Ryzen 9 7900X + RTX 3060 Ti; Rust stable MSVC, debug.
cargo build --workspace && cargo test -p xcl --test e2e: 4 passed, 0 failed — including the newa_crash_filter_that_never_returns_does_not_keep_the_process_alive, which verifies the 30 s crash-filter timeout ends the process (took ~3.4 s total for the suite).AI use: test runs by Devin (Cognition, SWE-2); no code changes.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T03:23:23Z.
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:41:57Z.
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-01T04:33:18Z.
Triage (#1607) – head
c997205Related: #742 attacks one cause of the same hang. It declines the title's in-process
MiniDumpWriteDump. This PR adds a general deadline after any unhandled exception, so the two complement each other.Problem: main now has
pub(crate) unsafe fn end_process_now(status: i32)ineh.rs(88f29d1, same body). The PR adds its ownunsafe fn end_process_now. Git merges the two cleanly, but the merged file defines the function twice and does not compile. Drop the PR's copy and use main's.Minor:
CRASHEDis set on every entry tounhandled_filterand never cleared. If the title's filter returnsEXCEPTION_CONTINUE_EXECUTION, a process that keeps running is ended 30 s later.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.