Skip to content

xcl run: name a title's deliberate write of a tag to address 0 in the crash line - #1062

Open
papasmurph0 wants to merge 1 commit into
xcl-dev:mainfrom
papasmurph0:log-deliberate-null-write
Open

papasmurph0 wants to merge 1 commit into
xcl-dev:mainfrom
papasmurph0:log-deliberate-null-write

Conversation

@papasmurph0

@papasmurph0 papasmurph0 commented Nov 24, 2026 •

Copy link
Copy Markdown

Part of #505; the stop of #746 is the second of the two below.

Titles end themselves on purpose with mov dword ptr [0], imm32. XCL's line for the unhandled exception showed only write at address 0x0, which reads like a bug in XCL. The retail title of #505 does it twice:

Read from the title's code: the watchdog function reports the stall, then reaches the write on both of its paths; after the write it only returns (add rsp, 0x48; ret). The thread procedure that called it calls an optional hook, then writes 0 to address 0.

The crash line now ends with – the title's own deliberate crash: mov dword ptr [0], <tag> when the faulting instruction is that one. Nothing else changes.

What is in it

  • crates/xcl/src/eh.rs: deliberate_null_write (the instruction's tag) and its use in unhandled_filter for a write at address 0. Test: a_write_of_a_tag_to_address_0_is_named_a_deliberate_crash.

Tested

Regression run

main:

xcl-smoke v1
commit: 384f7f7f8c79fa4d4dee59336d650a4021af4c7e
gpu: NVIDIA GeForce RTX 4080 SUPER
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1322 (PresentX 1322)
presents per 2 s (last 3): 60 60 61
device removals: 0
crashes: 0
peak commit: 15231 MB

this PR:

xcl-smoke v1
commit: 0117b92df882ded62dda4060a4f0444499ee4c2d
gpu: NVIDIA GeForce RTX 4080 SUPER
title: ea3b5e4d
seconds: 60
exit: 0x0
frames shown: 1389 (PresentX 1389)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14997 MB

Not tested

  • A crash line written by this change in a real run: neither 60 s run reaches the title's world load, where it ends itself; the test covers the instruction match.
  • AMD and Intel GPUs; Wine.
  • An earlier pair of runs had a higher peak commit (14.9 GB against 9.1 GB for main) while an offline pipeline builder held 75 GB of commit on the same machine; the pair above was made after it was stopped.

AI use

  • Claude Code with Claude Opus 5.5: read the title's code at the two addresses, wrote the change, the test and this description; the runs were made on my PC.

https://claude.ai/code/session_01SEW8zXNUmMq1tRUZpstWXS

… crash line

Titles end themselves on purpose with `mov dword ptr [0], imm32`. XCL's line
for the unhandled exception showed only "write at address 0x0", which reads
like a bug of XCL's own. The retail title of xcl-dev#505 does it twice: its GPU
watchdog ("GPU Loc Sig") at +0x23cf683 writes 0x4d8bd421, and when that
watchdog's function returns, its thread's exit path at +0x2215c35 writes 0
(the stop of xcl-dev#746). Read from the title's code: the watchdog's function
reports the stall, then reaches the write on both of its paths; after the
write it only returns; the thread procedure calls an optional hook and then
writes 0 to address 0.

The crash line now ends with "the title's own deliberate crash: mov dword
ptr [0], <tag>" when the faulting instruction is that one.

Assisted-by: Claude Code (Claude Opus 5.5)
@futurepro62

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 0117b92 (on its base 384f7f7).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 738 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: a_write_of_a_tag_to_address_0_is_named_a_deliberate_crash.

Not tested

  • AMD, a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@Royalflamejlh

Copy link
Copy Markdown
Contributor

Linux (Wine + vkd3d-proton) + NVIDIA: with 0117b92 the crash line of a run that ends at the title's GPU watchdog names it, with the tag the description gives. 1 run.

Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging (Wayland driver), vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175 and a local dxil-spirv patch. RTX 4070 12 GB (driver 615.71.09), Ryzen 9 9950X3D, 64 GB RAM. Release, cross-compiled to x86_64-pc-windows-gnu (rustc 1.98.0), XCL_NETWORK=0, XCL_PSO_PRELOAD=0. Retail title 1.0.2.1, the first-run screens completed once and no story progress, one A press at 44.8 s, 140 s asked for. 0117b92 (on main 384f7f7) with #684 (e56dbc3) merged in, because main alone faults in copy_from before the watchdog.

Tested

  • cargo test --release -p xcl --lib a_write_of_a_tag under Wine, on the merge: 1 passed, 0 failed.

Presents stopped at 102 s and the title ended itself at 130.6 s:

[  130.633] unhandled exception 0xc0000005 in game+0x23cf683 (write at address 0x0) – the title's own deliberate crash: mov dword ptr [0], 0x4d8bd421 rax=0x0 rbx=0x0 …; on the stack: kernelbase.dll+0x663ac, game+0x4e4ba89, game+0x2215c35, game+0x71b9a20, game+0x2215eca, kernel32.dll+0x11709

The same stop without this change reads … (write at address 0x0) rax=0x0 … (the base runs of our reports on #684 and #899).

Read

  • eh.rs:276 (deliberate_null_write, used at :82) matches only C7 04 25 00 00 00 00 imm32, and the text is added after (write at address 0x0) and before the registers, so a tool that reads the module and offset from the start of the line still finds them. Ours did.
  • The second write the description names, 0 at +0x2215c35, did not come in this run: the process ended on the first. +0x2215c35 is on the stack of the line above, as the description says of the thread procedure.

Not tested: the stop of #746 at +0x2215c35; the rest of the test suite.

AI use: Claude Code (Claude Fable 5.2) read the diff, built the tree, ran the title once and wrote this note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

goal:world-load Bears on the retail title getting past world loading

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants