GPU: since #1273, null SRVs reach alias_source and crash (0xc0000005, read 0x30) as the world loads #2847
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#2847
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@frenziedcoder on GitHub · 2026-11-25 22:10 UTC · original
Since #1273,
draw::readablecallsresource::alias_sourcefor every shader-resource view, including null SRVs (View::Shader(0, _)), andalias_source(0)dereferences a nullResource:0xc0000005(read0x30) as the world loads. A*resource != 0guard fixes it here.What happens: RTX 5080 (driver 621.40), Windows 11 26200, title 1.0.2.1, Series X profile,
diagbuild. Tree:main61bfc77plus the NVIDIA stack from #2464 / #2176 (#1906, #2098, #2626, #2628, #2464, #2176, #2118) — plainmaindoes not reach the world on NVIDIA, so I could not run it alone. Two runs, both at the same point (frame 1,328, as the world's first compute pipelines bind, ~55 s):Symbolised with the build's PDB:
Why: before #1273,
alias_sourcewas only called for theView::Shaderthatplaced_texture()returned, i.e. a texture made bytexture_at, as its doc says ("For a texture made for a placed view"). #1273 moved the call intoreadable's(View::Shader(resource, _), ResourceType::Srv)arm, so it now runs for every SRV. A null SRV isView::Shader(0, None)(descriptor.rs's own test:create_srv(null, …)→View::Shader(0, None)), andresource()is an unchecked&*this.cast::<Resource>(), soalias_source(0)readsb.descat a null base. Nothing here is NVIDIA-specific; any title that binds a null SRV to a dispatch should reach it.Check:
git revert 61bfc77, clean): no crash, world reached, 180 s.An early
return Noneinalias_sourcefor a nullplacedwould cover other callers too.Not tested: plain
main; AMD; whether any other caller passes a null view toalias_source.AI use: Claude Code (Claude Opus 5.5) found the crash in runs on my machine (sandboxed at Low integrity, game folder read-only), symbolised it, bisected it to #1273 and tested the guard, and wrote this issue.
@kotekompotek on GitHub · 2026-11-25 22:12 UTC · original
Verified on main: draw::readable (draw.rs:1712) calls alias_source(*b) for every placed View::Shader — a null SRV arrives as View::Shader(0, _), and alias_source(0) reads b.desc at offset 0x30 through a null Resource (resource.rs:1389-1391), exactly the reported 0xc0000005 read 0x30. The *b != 0 guard at the call site (or inside alias_source) is the right fix — cheap and unambiguous.
@frenziedcoder on GitHub · 2026-11-25 23:25 UTC · original
Confirmed fixed by
219878a("a null shader view has no alias source") on the RTX 5080 (621.40):main842b0cbwith the same NVIDIA stack, without my local guard, ran 600 s into the world with no0xc0000005(the old tree crashed at the same frame twice). This can be closed from my side.@Marvisak on GitHub · 2026-11-26 00:43 UTC · original · edited 2026-11-26 03:43 UTC
Automated triage for the maintainers.
Fixed in
main. Commit219878a("GPU: a null shader view has no alias source") makesalias_sourceincrates/victory-gpu/src/resource.rsreturnNonefor a null view before it reads the description, with the testa_null_view_has_no_alias_source. The reporter confirmed above that842b0cbruns 600 s into the world without the crash; the later comment points to the same commit. Open pull request #2865 adds further guards in the same function and can continue on its own.This issue will be closed in 48 hours unless the reporter replies or a maintainer removes the
triage: proposed closelabel.Generated by Claude Code
@kotekompotek on GitHub · 2026-11-26 03:00 UTC · original
Heads-up: this should be fixed on main by
219878a(GPU: a null shader view has no alias source) —readablenow returns an ordinary view for a null SRV instead of handing the null pointer toalias_source, which was the read-0x30 crash site. Worth a retest on the world-loading path that hit it.@kotekompotek on GitHub · 2026-11-26 06:55 UTC · original
This is fixed on main:
219878a("GPU: a null shader view has no alias source") makesalias_sourcereturn None for a null resource — the exact crash site in your stack — and addsa_null_view_has_no_alias_source. Thereadablecall it guards is at draw.rs:1918 on current main.