Repository navigation
GPU: a null SRV has no alias source - #2851
Ingenioeren wants to merge 1 commit into
Conversation
Return no alias source before dereferencing a null resource, and cover the null SRV with a regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Confirms the crash on a second host (RTX 3080 Ti, driver 621.24, Windows 11), in a fork that had cherry-picked #1273: access violation (read 0x60) at world load, symbolised to Ran with AI assistance (Claude Code). |
|
Verified
Looks clean and ready to merge. |
|
This just landed on main as 219878a ('GPU: a null shader view has no alias source') — same guard, same test name. This PR is now a no-op; suggest closing. |
|
Tested on an RTX 4070 SUPER (driver 32.0.16.1742, Windows 11 26300), title 1.0.2.1, Series X profile, diag build, scripted Enter presses. Tree:
Two runs in all, one each. AI-assisted (Claude Code). Runs done on my machine. |
|
Game run of this head on current
One run each, so the counts are small, but the stop is the one #2847 describes and the guard removes it on a third card. AI-assisted (Claude Code); the runs are on my machine. |
|
Closing: main already has this guard as 219878a ("GPU: a null shader view has no alias source"), so this PR is a no-op now. Thanks to everyone who tested it. |
What
Return
Nonefromresource::alias_sourcewhen the resource pointer is null. Add a Windows regression test that callsalias_sourcedirectly with a null pointer.Why
Since #1273,
draw::readablelooks for a texture alias for every SRV, includingView::Shader(0, _). Passing that zero pointer toresource()causes a null dereference. The guard protects every caller ofalias_source.host_resourcealready returnsNonefor null, which skipstexture::uploadand the diagnosticsGetDesccall.list::ensure_stateexits throughHostList::transitionwhenhost_copyreturnsNone.Thanks to frenziedcoder for diagnosing the crash.
How tested
cargo test --locked --offline -p victory-gpu resource::tests::a_null_shader_view_has_no_alias_source -- --exact— with the guard stashed and the test staged, the test binary reported a null pointer dereference inresource()and aborted with0xc0000409(STATUS_STACK_BUFFER_OVERRUN). With the guard restored, the same command passed (1 passed, 0 failed).cargo test --locked --offline -p victory-gpu— 229 passed, 0 failed, 1 ignored (the existing synthetic benchmark). The doc-test harness ran 0 tests and passed.cargo clippy --locked --offline -p victory-gpu --all-targets— passed with no warnings.cargo run --locked --offline -p xtask -- policy --staged— passed aftergit add. The asset policy accepted the one staged file.What was not tested
No game run and no hardware run of the game.
Fixes #2847
AI assistance: prepared with OpenAI Codex under Claude Code's direction, reviewed by Ingenioeren.
🤖 Generated with Claude Code