Runs that "crash" ~30 s after a stall (e.g. at the prologue) are the title's own watchdog: how to identify and disable it #3624

Open
opened 2026-11-27 23:17:55 +00:00 by transbinaryunicorn-sys · 0 comments
transbinaryunicorn-sys commented 2026-11-27 23:17:55 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by transbinaryunicorn-sys on 2026-11-27T23:17:55Z.


Hi
Played around with claude and found out something importand, the Whatchdog can cause trouble
here is a detailed Claude generated help. got ingame after 5 hours chasing clouds cause of the whatchdog...

If your run ends with this at the transition into the prologue (or after any long stall):

VIctory: unhandled exception 0xc0000005 at victory-image-<hash>.dll+0x23cf683 (write 0x0: nothing mapped there)
  #0  victory-image-<hash>.dll+0x23cf683
  #1  victory-image-<hash>.dll+0x2215c35
  #2  victory-image-<hash>.dll+0x2215eca
  #3  kernel32.dll+...

then it is not a crash in VIctory or in the translated code. It is the title's own watchdog, which deliberately writes to address 0 when the game has not sent a heartbeat for 30 seconds. Whatever stalls the game (GPU hang/TDR, slow pipeline creation with a cold cache, loading) only triggers it.

Offsets are for image b99f876b74d4a77f, title version 930.048.020-vb_sub_story. See below for how to find them in other versions.

How it works

The watchdog runs on its own thread (function at image +0x2215a60, thread start around +0x2215ea0):

  • It wakes up once per second (Sleep(1000)).
  • It compares a heartbeat timestamp (data at 0x1471b6338, written by the function at 0x1422159f0) with the last value it saw.
  • If the timestamp did not change, it counts down from 30 (mov $0x1e, %ebp). At 0 it calls a crash hook and then executes
    movl $0x4d8bd421, 0x0 at +0x23cf683. That is a deliberate write to NULL with the code 0x4D8BD421.
  • A long Sleep (machine suspended) or the suspend/resume notifications reset the countdown.
  • The dword at 0x1471b6334 only enables an extra check over 64 per-subsystem entries. Setting it to 0 does not stop the 30 s countdown.
  • The byte at 0x1471b6340 (bit 0) is the watchdog's quit flag. It is checked at the start (+0x2215ab8) and in every round (+0x2215c44, +0x2215dba). If it is set, the thread cleans up and returns. Nothing crashes.

The title's crash report (<data_dir>/<title id>/temp/victory-*.crash.log) is written at that moment and looks normal (game state, streaming requests, pools). It does not mention the watchdog.

Workaround (diagnostics build)

VICTORY_POKE=71b6340:1

VICTORY_POKE (diagnostics builds, apps/victory/src/run.rs) keeps writing the byte, so the watchdog thread exits on its next wake-up. With it, runs that used to end at the prologue continue into the game.

This hides the stall, it does not fix it. If the game is waiting on something that never comes (e.g. a real GPU hang), it will now hang instead of exiting. Still, it shows whether a "crash" is a real fault or just a slow phase. For example, on Linux + RTX 5090 with a cold cache, the prologue first runs at ~1 fps and then continues.

Finding it in another title version

The crash instruction is unique and easy to find in the converted image (<cache_dir>/images/victory-image-<hash>.dll):

C7 04 25 00 00 00 00 21 D4 8B 4D     ; movl $0x4d8bd421, 0x0

Its caller is the watchdog loop. Look for mov $0x1e, %ebp (the 30 s countdown) and, at the top of the function, a movb <flag>(%rip), %al; testb $0x1, %al; jne <exit>. That <flag> is the quit flag. Its address minus the image base (0x140000000) is the RVA for VICTORY_POKE.

Suggestion

Ideas for something better than a POKE:

  • a switch that sets the quit flag (found by the pattern above), or
  • feeding the heartbeat while the host is legitimately busy (pipeline creation, GPU waits it knows about), or
  • printing "title watchdog fired (code 0x4D8BD421)" instead of a generic access violation, so nobody chases a non-existent crash.

That last one alone would have saved me a day: I spent it bisecting shaders, vkd3d options and driver behavior on Linux/NVIDIA before I saw that the "crash" was intentional.


Wine's builtin d3dcompiler_47 (vkd3d-shader) rejects the indirect argument clamp HLSL:

argument clamp: clamp:106:10: E5005: Method 'InterlockedOr' is not defined on type 'RWByteAddressBuffer'.
no argument clamp: indirect execution dropped

Then every indirect execution is dropped (~1300/frame in the world) and the world renders black while menus work. Rewriting the clamp to StructuredBuffer<uint> (b.Load3(a) → uint3(b[a/4], b[a/4+1], b[a/4+2]), b.InterlockedOr(a, …) → InterlockedOr(b[a/4], …), no [allow_uav_condition]) plus serializing the root signature with D3D12SerializeRootSignature when CreateRootSignature on the blob fails (vkd3d-shader drops the [RootSignature] attribute) fixes it. I can post details if anyone needs them.

Setup used: Nobara Linux, RTX 5090, NVIDIA 615.78.08, GE-Proton11-7, vkd3d-proton master 71cae09, DXVK dxgi, built from the gabeparra/victory-4090 tree.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6655970497 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/3624). Originally posted by [transbinaryunicorn-sys](https://github.com/transbinaryunicorn-sys) on 2026-11-27T23:17:55Z. --- Hi Played around with claude and found out something importand, the Whatchdog can cause trouble here is a detailed Claude generated help. got ingame after 5 hours chasing clouds cause of the whatchdog... If your run ends with this at the transition into the prologue (or after any long stall): ``` VIctory: unhandled exception 0xc0000005 at victory-image-<hash>.dll+0x23cf683 (write 0x0: nothing mapped there) #0 victory-image-<hash>.dll+0x23cf683 #1 victory-image-<hash>.dll+0x2215c35 #2 victory-image-<hash>.dll+0x2215eca #3 kernel32.dll+... ``` then it is **not a crash in VIctory or in the translated code**. It is the **title's own watchdog**, which deliberately writes to address 0 when the game has not sent a heartbeat for 30 seconds. Whatever stalls the game (GPU hang/TDR, slow pipeline creation with a cold cache, loading) only triggers it. Offsets are for image `b99f876b74d4a77f`, title version `930.048.020-vb_sub_story`. See below for how to find them in other versions. ## How it works The watchdog runs on its own thread (function at image `+0x2215a60`, thread start around `+0x2215ea0`): - It wakes up once per second (`Sleep(1000)`). - It compares a **heartbeat timestamp** (data at `0x1471b6338`, written by the function at `0x1422159f0`) with the last value it saw. - If the timestamp did not change, it counts down from **30** (`mov $0x1e, %ebp`). At 0 it calls a crash hook and then executes `movl $0x4d8bd421, 0x0` at `+0x23cf683`. That is a deliberate write to NULL with the code `0x4D8BD421`. - A long `Sleep` (machine suspended) or the suspend/resume notifications reset the countdown. - The dword at `0x1471b6334` only enables an extra check over 64 per-subsystem entries. Setting it to 0 does **not** stop the 30 s countdown. - The byte at **`0x1471b6340`** (bit 0) is the watchdog's **quit flag**. It is checked at the start (`+0x2215ab8`) and in every round (`+0x2215c44`, `+0x2215dba`). If it is set, the thread cleans up and returns. Nothing crashes. The title's crash report (`<data_dir>/<title id>/temp/victory-*.crash.log`) is written at that moment and looks normal (game state, streaming requests, pools). It does not mention the watchdog. ## Workaround (diagnostics build) ``` VICTORY_POKE=71b6340:1 ``` `VICTORY_POKE` (diagnostics builds, `apps/victory/src/run.rs`) keeps writing the byte, so the watchdog thread exits on its next wake-up. With it, runs that used to end at the prologue continue into the game. **This hides the stall, it does not fix it.** If the game is waiting on something that never comes (e.g. a real GPU hang), it will now hang instead of exiting. Still, it shows whether a "crash" is a real fault or just a slow phase. For example, on Linux + RTX 5090 with a cold cache, the prologue first runs at ~1 fps and then continues. ## Finding it in another title version The crash instruction is unique and easy to find in the converted image (`<cache_dir>/images/victory-image-<hash>.dll`): ``` C7 04 25 00 00 00 00 21 D4 8B 4D ; movl $0x4d8bd421, 0x0 ``` Its caller is the watchdog loop. Look for `mov $0x1e, %ebp` (the 30 s countdown) and, at the top of the function, a `movb <flag>(%rip), %al; testb $0x1, %al; jne <exit>`. That `<flag>` is the quit flag. Its address minus the image base (`0x140000000`) is the RVA for `VICTORY_POKE`. ## Suggestion Ideas for something better than a POKE: - a switch that sets the quit flag (found by the pattern above), or - feeding the heartbeat while the host is legitimately busy (pipeline creation, GPU waits it knows about), or - printing "title watchdog fired (code 0x4D8BD421)" instead of a generic access violation, so nobody chases a non-existent crash. That last one alone would have saved me a day: I spent it bisecting shaders, vkd3d options and driver behavior on Linux/NVIDIA before I saw that the "crash" was intentional. --- ### Related, for Linux users without the native `d3dcompiler_47.dll` Wine's builtin `d3dcompiler_47` (vkd3d-shader) rejects the indirect **argument clamp** HLSL: ``` argument clamp: clamp:106:10: E5005: Method 'InterlockedOr' is not defined on type 'RWByteAddressBuffer'. no argument clamp: indirect execution dropped ``` Then every indirect execution is dropped (~1300/frame in the world) and the world renders **black** while menus work. Rewriting the clamp to `StructuredBuffer<uint>` (`b.Load3(a)` → `uint3(b[a/4], b[a/4+1], b[a/4+2])`, `b.InterlockedOr(a, …)` → `InterlockedOr(b[a/4], …)`, no `[allow_uav_condition]`) plus serializing the root signature with `D3D12SerializeRootSignature` when `CreateRootSignature` on the blob fails (vkd3d-shader drops the `[RootSignature]` attribute) fixes it. I can post details if anyone needs them. Setup used: Nobara Linux, RTX 5090, NVIDIA 615.78.08, GE-Proton11-7, vkd3d-proton master `71cae09`, DXVK dxgi, built from the `gabeparra/victory-4090` tree.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Marvisak/VIctory#3624
No description provided.