Skip to content

[Windows / Vulkan] Reproducible 0xC0000005 at game_scarlett_master.exe+0x23cf683 ~40 s after two E_DSTORAGE_DECOMPRESSION_ERROR reads #2019

Backlog

Description

@azmuricy466-pixel

Summary

gta6rt --first-run-ui loads the title, shows the splash and runs the first-run UI, then the title
writes to 0x0 at game_scarlett_master.exe+0x23cf683 (0xC0000005, access=write). It reproduces on
every run, at 145–204 s, always after exactly two DirectStorage decompression failures with
E_DSTORAGE_DECOMPRESSION_ERROR (0x89240030). No world frame is ever presented.

Environment

  • Windows 11, RTX 5090 32 GB, driver 616.92, Ryzen 9 9950X3D, 192 GB RAM
  • Vulkan SDK 1.4.363.1, MSVC 14.44 (VS 2022 Build Tools), CMake/Ninja, Rust 1.100 (XMA decoder built)
  • main @ 71a769d7, built with scripts/build_runtime.ps1, -DLEONIDA_SDL3=ON with SDL3 3.4.20
    shared (SDL_SHARED ON, SDL3::SDL3), -DLEONIDA_REQUIRE_VULKAN=ON, RelWithDebInfo
  • Own 1.0.2.1 package, make_game.py --stages check,shaders,runtime → 26,503 shaders translated,
    check all files present and hashes match
  • TdrDelay/TdrDdiDelay raised to 60 s (a 8.9 s pipeline build no longer resets the device;
    device was lost has not recurred since)

Command

$env:TMP='C:\...\cltmp'; $env:TEMP=$env:TMP
$env:LEONIDA_D3D12='vulkan'; $env:LEONIDA_KEYBOARD_PAD='always'
.\gta6rt.exe --first-run-ui game_scarlett_master.exe --trace fru.jsonl

Trace (three runs, identical)

seq 203  t=103.77  dstorage_failure  hr=0x89240030 (E_DSTORAGE_DECOMPRESSION_ERROR)
                   offset=455285504  source_size=9423   destination_size=12288
seq 204  t=103.81  dstorage_failure  hr=0x89240030
                   offset=76014336   source_size=19699  destination_size=24576
seq 205  t=145.83  exception  code=0xc0000005  at=game_scarlett_master.exe+0x23cf683
                   access=write  address=0x0  region{base=0, state=MEM_FREE, protect=PAGE_NOACCESS}

Other runs: failures at t=135.9/136.1, crash at t=203.85; failures at t=113.5/113.6, crash at t=157.85.
The two failing reads are always the same file ranges and the same sizes. unimplemented_call
events: none. int3: none.

What I tried

  • LEONIDA_DSTORAGE_FITTED=0 LEONIDA_DSTORAGE_FAST_BCPACK=0 → worse: 120 decompression
    failures and an earlier, different xmem fault. Reverted.
  • Default flags → back to exactly 2 failures + the same crash offset.

Guess

The two failed decompressions leave a destination buffer in a state the title does not test; the
title later writes through a pointer derived from it. If those two reads can be made to succeed (or
return a well-formed block), the crash may move on. Happy to run LEONIDA_DSTORAGE_TRACE=1 and send
the request list for those two ranges, or any diagnostic build you want.

Notes

  • Before this, with an older main (a1ed7bcb, no SDL3) the run died earlier at
    game_scarlett_master.exe+0x104075 (read 0xffffffffffffffff); the TLS-slot work fixed that.
  • Splash + first-run UI work: 26 fps, 8.9 GB VRAM, XUser offline Player, no crashes up to the point
    above.

Activity

  1. azmuricy466-pixel commented on Nov 25, 2026

    @azmuricy466-pixel
    Author

    Update with LEONIDA_DSTORAGE_TRACE=1 (same build, same command, plus LEONIDA_SKIP_INT3=1):

    Both failing reads are in the same file, both BC7 page destinations:

    [rt] ds-request queue=…E83A0 options=20000e zlib=0 bc=7 sw=0 dest=pages
      file=G:\.\data\ttdb\props\octa_imposters.ttpf offset=455285504 src=9423 mid=0 dst=12288
      hr=89240030 page_offset=16384 read_us=35 bc_us=170 paired=1
    [rt] ds-request queue=…EB640 options=20000e zlib=0 bc=7 sw=0 dest=pages
      file=G:\.\data\ttdb\props\octa_imposters.ttpf offset=76014336 src=19699 mid=0 dst=24576
      hr=89240030 page_offset=32768 read_us=14 bc_us=168 paired=0
    

    data/ttdb/props/octa_imposters.ttpf is 35,286,784 bytes and matches the size and SHA-256 in
    game/xbox-1.0.2.1.json, so the archive is not the problem. LEONIDA_SKIP_INT3=1 changes nothing
    (no int3 is logged); the crash is still game_scarlett_master.exe+0x23cf683 write to 0x0, this
    time at t=199.87 s, ~48 s after the two failures.

    Also note: with LEONIDA_DSTORAGE_FITTED=0 LEONIDA_DSTORAGE_FAST_BCPACK=0 the same file produces
    120 decompression failures instead of 2 and the run dies earlier with an xmem read fault, so the
    fitted-predictor path is doing the right thing for the other blocks here.

  2. Snooozs commented on Nov 25, 2026

    @Snooozs
    Contributor

    Two separate things, as far as I can tell. Counts, offsets and addresses only.

    The crash at +0x23cf683 is the title's hang watchdog, not the decompression. I have a run with the same stop and no DirectStorage failure at all (RTX 5060 Ti, NVIDIA 621.01, Windows 10): write to 0x0 at t=173.8 s, stack +0x23cf683, +0x2215c35, +0x2215eca. +0x2215c35 is the watchdog's own trap: runtime/src/main.cpp:36-43 describes it (function at RVA 0x2215a60, 30 one-second ticks without a kick from the main loop, then a crash callback and the write to address 0). DadaCap recorded the same stop and the same two callers in the body of #1537. A main loop stalled for 30 s by pipeline builds or by a wait is enough.

    To check it: compare the stack of your exception event (seq 205) with those three addresses, and run once with LEONIDA_TITLE_WATCHDOG=0 (runtime/README.md, it only acts when the trap bytes are where this build has them). If the stop disappears or the stack matches, it is the watchdog, and the question is what stalls the main loop for 30 s in your run (your log's last submit phases lines show where the submit thread was). I have not tested whether it keeps your run going.

    The two 0x89240030 reads are known: #1715 lists exactly your two BC7 requests of data/ttdb/props/octa_imposters.ttpf, at 455285504 (768 blocks) and 76014336 (1,536 blocks), each with one endpoint entry the reconstructed profile does not know, and decodes both with a lost-block limit of 1/32 (LEONIDA_DSTORAGE_LOST_DIVISOR). Its description says it was checked against the package, not in a boot, so whether it changes your run is open. LEONIDA_DSTORAGE_FITTED=0 making it worse is expected (docs/directstorage.md: it needs confirmed entries).

    AI-assisted (Claude Code, Claude Opus 5.5).

  3. azmuricy466-pixel commented on Nov 26, 2026

    @azmuricy466-pixel
    Author

    Thanks — that reframed it completely. Two data points now.

    1. The stack matches yours byte for byte. Our crash (0xC0000005, write to 0x0, t=199.87 s) has
    game_scarlett_master.exe+0x23cf683
    game_scarlett_master.exe+0x2215c35
    game_scarlett_master.exe+0x2215eca
    host:KERNEL32.DLL+0x1259d
    host:ntdll.dll+0x5af38
    

    so we agree it is the title's own hang watchdog, not the decompression.
    2. With LEONIDA_TITLE_WATCHDOG=0 the game gets past the old dead point, and then the machine blue-screens.
    RTX 5090, 32 GB, Windows 11, TdrDelay=60 for the test (reverted to default afterwards).

    t=59 s   25.85 fps, 1735 submissions
    t=119 s  23.54 fps, 5229 submissions   <- past the 145-200 s window where we used to die
    

    then at ~t=3 min, before any world frame, the box bugchecked:

    0x000000EF (CRITICAL_PROCESS_DIED)
    params 0xffffa98d8f4d4140, 0, 0xffffa98d8f4d4140, 0
    dump   C:\Windows\Minidumps\112626-23781-01.dmp
    report 10ba598f-4783-48ee-a2bb-e5853fa69c18
    

    So disabling the watchdog does not get us into the world — it converts "title kills itself in 30 s" into "the main loop never comes back and takes a critical system process with it". Not asking you to support that config; it just tells us the stall is real and long, and it happens right around the compute pipeline builds:

    compute pipeline library/lib_cs_01552 took 5.1 s to build (624776 B SPIR-V)
    compute pipeline library/lib_cs_01395 took 2.4 s to build
    

    Question: is the pipeline build on the main thread by design right now (so a slow build is indistinguishable from a hang), and is kicking the watchdog from inside the build loop — or moving these builds off the tick — something you would accept a PR for? If you already have a branch or a preference for how it should look, point me at it and we can try a patch on our side to confirm the diagnosis before anything else.

  4. nicoco23 commented on Nov 26, 2026

    @nicoco23
    Contributor

    Second Windows/NVIDIA data point: i7-12700KF (Intel, no SSE4a/CLZERO/MONITORX), RTX 5070, 32 GB, Windows 11 26200, main 73516a2 + #2195 (the TLS atexit fix — without it the title's CRT aborts at startup).

    • First-run UI reached and driven with the keyboard pad (brightness page, choices saved in the overlay).
    • Library warm-up: ~1,040 compute pipelines at startup, then ~25 frames/s on the UI; the NVIDIA shader cache and pipeline_cache.session.bin make the next boots much faster.
    • Then the title ends itself with a write to address 0, during the story load, ~2-4 min in, the same way on three runs. It also happens with LEONIDA_RT_AS=off and every library program of 1 MiB or more in LEONIDA_SKIP_COMPUTE, with no build pending, so it is not only the compile stalls.
    • The stored value written at address 0 is not 0, so it may not match the trap pattern main.cpp checks for the watchdog KICK. Can someone who measured the KICK values confirm it is the same trap?
  5. azmuricy466-pixel commented on Nov 26, 2026

    @azmuricy466-pixel
    Author

    Data point, no action request — this fills two of the TBDs in docs/running.md → Windows, NVIDIA.

    Setup. ubiquitarianism/leonida main 56bdd7e, scripts/build_runtime.ps1 (SDL3 static, RelWithDebInfo), RTX 5090 32 GB, driver 616.92, Windows 11. TdrDelay/TdrDdiDelay were deleted from the registry after the bugcheck, but the running boot still came up with 60 s (the keys are read when the driver initialises), so the two runs below ran with 60 s; a re-test with the stock 2 s is still pending. shaders+runtime built by make_game.py --stages check,shaders,runtime; package check passes (108 files).

    The pipeline stall is gone without the KICK values. With

    LEONIDA_D3D12=vulkan
    LEONIDA_KEYBOARD_PAD=always
    LEONIDA_FAST_PIPELINES=compute
    LEONIDA_COMPUTE_WARMUP_LIVE_MAX_BYTES=131072
    

    the title watchdog never fires and compile-gate never reports a wait. Previous runs with the default pipeline settings (and with a warm pipeline_cache.session.bin) stalled 32.1 s on one compute create — compute library/lib_cs_01261, 692564 B SPIR-V — and the watchdog exited the process at t≈48.9 s. So Pipeline pre-compile: can be written as "not needed for the first-run UI: LEONIDA_FAST_PIPELINES=compute keeps the main loop alive".

    What is behind the watchdog. Two consecutive runs, identical command line, both died on a title-side AV at different sites — this looks like the next stop, not the watchdog:

    • Run A (61.8 s): 12–26 frames/s until t≈32 s, then the submission rate fell from ~50/s to ~2.8/s (per-submission shadows 342 ms of 696 ms) and the frame rate settled at 1.2–1.4 frames/s. At t=61.1 s: 0xc0000005 write at game_scarlett_master.exe+0x7456da, address in a MEM_COMMIT/PAGE_NOACCESS run with allocation_base=0x0. dstorage_failure count this run: 0.
    • Run B (29.8 s, same environment): 0xc0000005 read at +0x507b2f4 on address 0x8, then +0x18bae6f reading 0xffffffffffffffff. The runtime's own line right before it: xmem: title read fault at t+0x507b2f4 on 0x8 state 0x10000 protect 0x1 type 0x0 allocation 0x0, outside stream CPU window, unmaps 90531, no recent ma….

    Both are reads/writes into pages the title believes it owns (manually mapped, allocation_base=0x0), so I read them as title-memory-map state rather than as a new class. I searched issues and PRs for 0x7456da, 0x507b2f4 and "title read fault": no report names these offsets. The neighbouring work I found is #2163 (slot-133 shadow keeps the GPU's writes), #1897 (a page kept read-only by another tracker is copied once) and the closed #2240 / #1972 — so I am not filing a separate issue and will re-test once #2163 and #1897 land. If those two sites survive that re-test I will open a report with the traces.

    No payload, shader, texture or name list is included here; only RVAs, counters and frame rates.

  6. LGlong1 commented on Nov 28, 2026

    @LGlong1

    Follow-up from the Windows 10 / RX 6750 GRE (RDNA2) machine: the hang watchdog's two RVAs, measured here, and one Windows-AMD number that matters for it.

    The crash site is the watchdog's callback, not its own trap. The dialog Windows shows is 0x00000001423CF683 ... written, i.e. game+0x23cf683. Disassembling game_scarlett_master.exe at that RVA:

    1423cf683: c7 04 25 00 00 00 00 21 d4 8b 4d   movl $0x4d8bd421, 0x0
    

    A write to address 0 with a non-zero immediate. The watchdog thread itself (RVA 0x2215a60, the function Snooozs named) has its own fallback write at RVA 0x2215c35:

    142215c35: c7 04 25 00 00 00 00 00 00 00 00   movl $0x0, 0x0
    142215c40: cc                                 int3
    

    That one matches the runtime's kWatchdogTrap byte pattern; 0x23cf683 does not. Before those lines the thread reads its "main loop alive" flags at 0x471b6340 (bit 0), 0x471b6331, 0x471b6330, and the last-kick timestamp at 0x471b6338; a counter of 0x1e (30) one-second ticks runs down, then it calls the callback pointer at 0x471b6348 (the write above) and then does its own movl $0,0x0.

    What I tried. With LEONIDA_TITLE_WATCHDOG=0 LEONIDA_TITLE_WATCHDOG_KICK=2215c35,471b6331 on commit d442851, the loader printed no "keeping the title's hang watchdog kicked" line and the run still ended at +0x23cf683. I did not try 0x471b6330 as the kick byte. Questions for whoever measured these: is the kick byte 0x471b6331, 0x471b6330, or something else this disassembly does not show; and should the trap check also accept the callback site (0x23cf683, pattern with the 0x4d8bd421 immediate) so a run whose only write-to-0 site reached is the callback can still be defused?

    Why it matters here: the 30 s is shorter than this driver's pipeline creates. On this machine the main thread stalls in compute creates:

    [rt] d3d12: compute pipeline library/lib_cs_01047 took 56.8 s to build (421844 B SPIR-V)
    [rt] d3d12: compute pipeline library/lib_cs_01056 took 72.2 s to build (1651484 B SPIR-V)
    

    so the watchdog fires on any run that meets one of them. On RADV the same programs are seconds (docs/linux_proton.md, step 2), which is why the world frame was reached there and not here.

    One more Windows data point: the runtime built from 6dfca64 (SDL3, scripts/build_runtime.ps1) crashes at startup on this machine before the title's first draw — 0xc0000005 read 0x0 at host:gta6rt.exe+0xbb13a, right after the title's TLS callbacks. The d442851 binary starts and reaches the first-run pages. The assets here were built from the d442851-era make_game.py; I have not re-run the assets stage (2.5 h) to test whether that is the cause.

    Logs and traces stay on this machine; no game files attached.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions