startup-runtime: deterministic null read in the Gameruntime after a StoreContext handle is rejected (~2 min, render path) #1617

Closed
opened 2026-11-24 15:14:11 +00:00 by triggered02 · 3 comments
triggered02 commented 2026-11-24 15:14:11 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T15:14:11Z.


Problem

On current main (81df4051, release preset), a run with rendering enabled stops on a deterministic access violation inside the Gameruntime about two minutes in. The fatal read comes immediately after the title creates a store context and the Gameruntime rejects a handle:

[about 110 s] first-chance access violation inside d3d12_xs.dll
[about 110 s] Windows.Media.dll loads
[about 117 s] Runtime Service struct SStoreImpl Created
[about 117 s] XERROR: HR:80070006 Handle: does not exist (StoreContext)
[about 117 s] fatal access violation inside xgameruntime.dll, params 0x0 / 0xffffffffffffffff

0x80070006 is ERROR_INVALID_HANDLE, and the second parameter of the fatal read is a length of -1 at address 0, so something walks a handle that was never valid and then dereferences the null result.

Reproduction

cmake --preset release
cmake --build --preset release
.\tools\startup\run.ps1 -Exe <folder>\game_scarlett_master.exe -DataDir <package root> `
    -LogDir out\startup\store-crash -Seconds 200 -Render -FakeUser -GpuMirror `
    -ContinueAsserts 1000 -ShaderCache <a populated shader cache>

Two runs stopped the same way:

run stop frames rendered translated draws pipelines
1 access violation after 116.8 s 2,474 in 91.8 s (27.0 fps) 7,816 6 / 0 missing
2 access violation after 120.6 s same shape same shape same

Both times the fault is the same second-chance access violation inside xgameruntime.dll with identical parameters. The control run without translated pipelines (-Render with an empty cache, so every draw is dropped) survives the full 240 s, so this does not reproduce on the non-rendering path; the sequence above is only reached once drawing works.

What the run reaches

With these runs: the Rockstar stars splash is drawn through translated pipelines at about 27 fps and the process then dies at the store-context step. It never reaches the title's front-end.

For comparison, an earlier run on the same machine (out/startup/i1150, this afternoon) got further on a fuller cache: it reached the Legal Notices screen with readable text and UI, 14 translated pipelines, 163,572 translated draws, 1,371 textures uploaded (about 5.6 GB), 6,854 frames at 28.8 fps, survived to the 260 s timeout and played Bink movies (449 frames). That run also shows a separate symptom worth noting: BinkPause called 4,533 times and a luma plane reported unreadable with a bogus pointer.

So I can say the code reaches store-context creation deterministically; I cannot say whether the fatal fault is new, because the two configurations differ in cache contents and the earlier run's exact switches are not recorded.

Where to look

  • The handle the Gameruntime refuses is a StoreContext handle. The store stand-in path is the first thing to compare against the Gameruntime's expectations: a fake or forwarded handle that the real GDK does not recognise would produce exactly this rejection and then the null walk.
  • The first-chance faults inside d3d12_xs.dll a few seconds earlier are handled by the title, so they do not by themselves stop the run, but the timing suggests the media/store transition is where the shim and the title disagree.
  • Offline mode refuses the four network opens the title makes; whether the store context can be valid offline at all is worth checking before treating the fault as a shim bug.

What this does not establish

No claim about gameplay: the title never gets past its front-end legally-notice screen in any run here. No claim that the fault is new — the comparison run used a different cache. No content from the title is attached: the logs stay local, and module names appear here without offsets or return addresses.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6585021229 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1624). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T15:14:11Z. --- ## Problem On current `main` (`81df4051`, release preset), a run with rendering enabled stops on a deterministic access violation inside the Gameruntime about two minutes in. The fatal read comes immediately after the title creates a store context and the Gameruntime rejects a handle: ``` [about 110 s] first-chance access violation inside d3d12_xs.dll [about 110 s] Windows.Media.dll loads [about 117 s] Runtime Service struct SStoreImpl Created [about 117 s] XERROR: HR:80070006 Handle: does not exist (StoreContext) [about 117 s] fatal access violation inside xgameruntime.dll, params 0x0 / 0xffffffffffffffff ``` `0x80070006` is `ERROR_INVALID_HANDLE`, and the second parameter of the fatal read is a length of -1 at address 0, so something walks a handle that was never valid and then dereferences the null result. ## Reproduction ``` cmake --preset release cmake --build --preset release .\tools\startup\run.ps1 -Exe <folder>\game_scarlett_master.exe -DataDir <package root> ` -LogDir out\startup\store-crash -Seconds 200 -Render -FakeUser -GpuMirror ` -ContinueAsserts 1000 -ShaderCache <a populated shader cache> ``` Two runs stopped the same way: | run | stop | frames rendered | translated draws | pipelines | |---|---|---|---|---| | 1 | access violation after 116.8 s | 2,474 in 91.8 s (27.0 fps) | 7,816 | 6 / 0 missing | | 2 | access violation after 120.6 s | same shape | same shape | same | Both times the fault is the same second-chance access violation inside `xgameruntime.dll` with identical parameters. The control run without translated pipelines (`-Render` with an empty cache, so every draw is dropped) survives the full 240 s, so this does not reproduce on the non-rendering path; the sequence above is only reached once drawing works. ## What the run reaches With these runs: the Rockstar stars splash is drawn through translated pipelines at about 27 fps and the process then dies at the store-context step. It never reaches the title's front-end. For comparison, an earlier run on the same machine (`out/startup/i1150`, this afternoon) got further on a fuller cache: it reached the Legal Notices screen with readable text and UI, 14 translated pipelines, 163,572 translated draws, 1,371 textures uploaded (about 5.6 GB), 6,854 frames at 28.8 fps, survived to the 260 s timeout and played Bink movies (449 frames). That run also shows a separate symptom worth noting: `BinkPause` called 4,533 times and a luma plane reported unreadable with a bogus pointer. So I can say the code reaches store-context creation deterministically; I cannot say whether the fatal fault is new, because the two configurations differ in cache contents and the earlier run's exact switches are not recorded. ## Where to look - The handle the Gameruntime refuses is a **StoreContext** handle. The store stand-in path is the first thing to compare against the Gameruntime's expectations: a fake or forwarded handle that the real GDK does not recognise would produce exactly this rejection and then the null walk. - The first-chance faults inside `d3d12_xs.dll` a few seconds earlier are handled by the title, so they do not by themselves stop the run, but the timing suggests the media/store transition is where the shim and the title disagree. - Offline mode refuses the four network opens the title makes; whether the store context can be valid offline at all is worth checking before treating the fault as a shim bug. ## What this does not establish No claim about gameplay: the title never gets past its front-end legally-notice screen in any run here. No claim that the fault is new — the comparison run used a different cache. No content from the title is attached: the logs stay local, and module names appear here without offsets or return addresses. AI-assisted (Claude Code).
R0Y00 commented 2026-11-24 16:03:34 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T15:31:51Z.


The reported build predates #1599. Please try the same reproduction on a clean main containing 7c5dac78 and report whether the first failing provider call changes. The source-built regression verifies that the offline store token is refused before an unimplemented call enters the desktop runtime. If the crash persists, share a short sequence of operation names and result codes around the first failure and whether the offline token is involved. Keep the earlier graphics exception separate and omit local paths, addresses, or raw captures.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7136183585 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1624#issuecomment-7136183585). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T15:31:51Z. --- The reported build predates #1599. Please try the same reproduction on a clean main containing 7c5dac78 and report whether the first failing provider call changes. The source-built regression verifies that the offline store token is refused before an unimplemented call enters the desktop runtime. If the crash persists, share a short sequence of operation names and result codes around the first failure and whether the offline token is involved. Keep the earlier graphics exception separate and omit local paths, addresses, or raw captures.
triggered02 commented 2026-11-24 16:03:35 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T15:46:34Z.


Tested on cb94b8ca, which contains 7c5dac78 (#1599). The crash does not reproduce there, and the first failing provider call changes exactly as you expected. One correction to my report first: the fault was not deterministic — on the older build it happened in 3 of 5 runs (116.8 s, 120.6 s, 105.8 s) and two runs survived to their timeout, so "2/2" was an over-claim from too few runs.

Before #1599, sequence around the first failure (provider, slot, result):

provider 0dd112ac (XStoreImpl) -> proxied object
  0dd112ac::slot3   (XStoreCreateContext, offline token written)  -> 0x0
  0dd112ac::slot71  (offline token, licence path)                 -> forwarded to desktop runtime
      desktop runtime: 0x80070006  (invalid handle, type StoreContext)
      then a second-chance access violation inside the Gameruntime

The forwarding call was invisible in the log because the proxy logged after the call returned; I added a before-forward log to catch it. The token was definitely involved: slot71's first argument was the offline context value, and the runtime's own error names that handle as an unresolvable StoreContext.

On cb94b8ca, the same sequence:

  0dd112ac::slot3   (XStoreCreateContext)                         -> 0x0
  0dd112ac::slot71  (offline token)                               -> 0x80004005, no desktop call
  the title repeats that pair once and continues

So the guard refuses the offline token before an unimplemented method enters the desktop runtime, which is what the regression you mentioned checks. No second-chance exception for the rest of the run.

Run on cb94b8ca (240 s, rendering on, first-run user answered, translated pipelines from cache): survived to the timeout, 6,192 frames at 28.5 fps, 16 pipelines translated, 118,451 translated draws, 1,384 textures uploaded (about 5.6 GB), no traps. It also plays its movies: 48 Bink opens, 449 frames decoded.

Keeping the graphics exception separate as asked: the first-chance access violations inside the D3D12 stand-in happen within the first two seconds, are handled by the title, and appear in the surviving runs too, so they are not this fault.

Two things I am not claiming: that the title gets past its front-end (it does not; it ends on a screen waiting for the next screen's data), and that a remaining video symptom is harmless — that run still shows 3,037 BinkPause calls and nonsense values in the stop report's Bink frame header, which looks like a separate problem worth its own report once reproduced on purpose.

No local paths, addresses or raw captures included. Thanks for pointing at #1599 — my local patch was converging on the same fix, and yours is the version that arrives with a test.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7136591261 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1624#issuecomment-7136591261). Originally posted by [triggered02](https://github.com/triggered02) on 2026-11-24T15:46:34Z. --- Tested on `cb94b8ca`, which contains `7c5dac78` (#1599). **The crash does not reproduce there**, and the first failing provider call changes exactly as you expected. One correction to my report first: the fault was **not** deterministic — on the older build it happened in 3 of 5 runs (116.8 s, 120.6 s, 105.8 s) and two runs survived to their timeout, so "2/2" was an over-claim from too few runs. **Before #1599**, sequence around the first failure (provider, slot, result): ``` provider 0dd112ac (XStoreImpl) -> proxied object 0dd112ac::slot3 (XStoreCreateContext, offline token written) -> 0x0 0dd112ac::slot71 (offline token, licence path) -> forwarded to desktop runtime desktop runtime: 0x80070006 (invalid handle, type StoreContext) then a second-chance access violation inside the Gameruntime ``` The forwarding call was invisible in the log because the proxy logged after the call returned; I added a before-forward log to catch it. The token was definitely involved: `slot71`'s first argument was the offline context value, and the runtime's own error names that handle as an unresolvable `StoreContext`. **On `cb94b8ca`**, the same sequence: ``` 0dd112ac::slot3 (XStoreCreateContext) -> 0x0 0dd112ac::slot71 (offline token) -> 0x80004005, no desktop call the title repeats that pair once and continues ``` So the guard refuses the offline token before an unimplemented method enters the desktop runtime, which is what the regression you mentioned checks. No second-chance exception for the rest of the run. Run on `cb94b8ca` (240 s, rendering on, first-run user answered, translated pipelines from cache): survived to the timeout, 6,192 frames at 28.5 fps, 16 pipelines translated, 118,451 translated draws, 1,384 textures uploaded (about 5.6 GB), no traps. It also plays its movies: 48 Bink opens, 449 frames decoded. Keeping the graphics exception separate as asked: the first-chance access violations inside the D3D12 stand-in happen within the first two seconds, are handled by the title, and appear in the surviving runs too, so they are not this fault. Two things I am **not** claiming: that the title gets past its front-end (it does not; it ends on a screen waiting for the next screen's data), and that a remaining video symptom is harmless — that run still shows 3,037 `BinkPause` calls and nonsense values in the stop report's Bink frame header, which looks like a separate problem worth its own report once reproduced on purpose. No local paths, addresses or raw captures included. Thanks for pointing at #1599 — my local patch was converging on the same fix, and yours is the version that arrives with a test.
R0Y00 commented 2026-11-24 16:03:36 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T15:55:29Z.


Thanks for the retest and the correction to the baseline. The earlier build hit the StoreContext crash in 3 of 5 runs. With #1599 present at cb94b8ca, the offline token was refused before the provider call and the 240-second retest completed without that exception. Closing this StoreContext report as fixed by #1599. The separately observed video symptom can be tracked independently once isolated.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7136839412 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1624#issuecomment-7136839412). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T15:55:29Z. --- Thanks for the retest and the correction to the baseline. The earlier build hit the StoreContext crash in 3 of 5 runs. With #1599 present at cb94b8ca, the offline token was refused before the provider call and the 240-second retest completed without that exception. Closing this StoreContext report as fixed by #1599. The separately observed video symptom can be tracked independently once isolated.
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
R0Y00/Xbox2Windows#1617
No description provided.