Repository navigation
D3D12.X: pass a NULL-ppv CreateDescriptorHeap validation call through (#2401) - #2556
kotekompotek wants to merge 1 commit into
Conversation
…xcl-dev#2401) dev_create_descriptor_heap_x read *ppv the moment hr >= 0, but a title may call CreateDescriptorHeap with ppv == NULL as the D3D12 validation call – the PC answers S_FALSE and writes nothing – or hand back a NULL *ppv. Dereferencing either is a null read. Gate the console bookkeeping on !ppv.is_null() && !(*ppv).is_null(), the same guard the creator! macro and the other _x methods already use.
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! — Devin |
|
Test run on exact head Tested
Regression run (60 s, default settings, a retail title) main: this PR: No crash or device removal; frames 105 % of Not tested
AI use
|
|
Closing as a duplicate of #2444, which was opened earlier for the same issue (#2401). Both make the same change in Compared at heads 43d1ebb (this PR) and e5e5528 (#2444) against main 08db802. Reviewed with Claude Code (Claude Opus 5.5); I checked the comparison before closing. |
…ixes Integrates upstream amd-dev 61121fe/xcl-dev#2569 (DirectStorage ordered completion wakeups) plus open PRs xcl-dev#2577 (skip AMD cache-reference driver blobs on disk, xcl-dev#2512), xcl-dev#2578 (clear LAST_CONTENT on placed texture unmap/remap, xcl-dev#2460), xcl-dev#2579 (mark put-off builds wanted immediately), xcl-dev#2556 (NULL-ppv CreateDescriptorHeap test), xcl-dev#2550 (skipped ExecuteIndirect occlusion query), xcl-dev#2549 (reused spare keeps in-flight deferred allocator, with Wine raw fences and UnadoptGuard), and xcl-dev#2548 (Reset/KickoffX/CreateCommandList do not wait on building compute pipelines). Assisted-by: Antigravity (Gemini 4 Neon)
Fixes #2401.
In D3D12,
ID3D12Device::CreateDescriptorHeapwithppvHeap == NULLis the documented parameter-validation call – the PC answersS_FALSE(1, which satisfieshr >= 0) and writes nothing.dev_create_descriptor_heap_xchecked onlyhr >= 0and then read*ppvto register the heap's console bookkeeping: a NULLppv(or a*ppvthe PC left NULL) is a null-pointer read the moment the call "succeeds".What is in it
hle/d3d12x/real.rs: the heap-registration block now runs underhr >= 0 && !ppv.is_null() && !(*ppv).is_null()– the same guard thecreator!macro and the other_xmethods already apply. The HRESULT passes through untouched either way.create_descriptor_heap_x_tests: a fake adopted device (CLASSES entry + ext vtable stub, asadopt()records them) whose PC-sideCreateDescriptorHeapanswersS_FALSE. Callingdev_create_descriptor_heap_xwithppv == NULL, and with an out pointer the PC left NULL, returnsS_FALSEinstead of dereferencing it; the test aborts on the null read when the guard is reverted (checked).Tested
cargo test --workspace --no-fail-fast -- --test-threads=4on the head commit: 1421 passed, 3 failed, 46 ignored (SKIPPED GPU tests: 355 – this adapter has no SM 6.6 / mesh shaders)gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark(driver refuses a sparse heap op, HRESULT 0x80070057),stale_blob_cannot_bypass_the_offline_pipeline_capandsplit_compute_program_prebuilds_and_caches_chain_pieces(both build/dispatch cs_6_6, which this SM 6.5 adapter cannot run; the latter is a new upstream test with no capability gate)a_null_ppv_validation_call_passes_the_pc_answer_throughaborts with a null-pointer dereference when the fix is reverted (checked by restoringif hr >= 0)Regression run
main:
PR:
Not tested
-Seconds1-8 the log showsunhandled exception 0x80000003thenprocess ends with status 0x80000003). The blocks above end it throughXCL_RUN_SECONDS=0before that point – they cover host boot, game loading and shutdown, no frames, no shaders.CreateDescriptorHeapwithppv == NULLthrough the console interface: the validation call is exercised by the unit test's fake device, not observed from a real game.AI use