Repository navigation
d3d12_existing_heap_test: a real event handle instead of 0x1234 (0xC0000008 under strict handle checks); the layer refuses a non-section handle as the host does - #7357
Conversation
…layer refuses a non-section handle as the host does The test passed the made-up handle (HANDLE)0x1234 to OpenExistingHeapFromFileMapping. Under strict handle checking (Application Verifier, a debugger, some security software) GetHandleInformation raises STATUS_INVALID_HANDLE on it, so the test ended with 0xC0000008 before printing anything (an RTX 3060 setup, on main and on ItsNotRexed#7218). It now uses an event, a real handle that is not a section. That exposed a difference: the host runtime answers E_INVALIDARG for an event handle on the RTX 4090 and WARP, and the Vulkan layer answered E_NOTIMPL, because it only checked that the handle was valid. It now also checks that the handle names a section object (NtQueryObject's type name; nothing is mapped). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devnull34
left a comment
There was a problem hiding this comment.
Verified: test builds and passes cleanly. Validating real event handle usage (CreateEventW) avoids STATUS_INVALID_HANDLE (
|
Tested f5de0db on NVIDIA GeForce RTX 5090, driver 617.42, Windows 11 (26200), native MSVC 2022 RelWithDebInfo: pass.
AI-assisted (Claude Code). |
|
Independent native Windows/MSVC 19.44, RTX 5060 driver 32.0.16.1088: #7357 diff applied cleanly to main 8575d36 (review checkout already has the unrelated #7125 test correction). Rebuilt d3d12_existing_heap_test, RelWithDebInfo, and ran it: exit 0. Existing-heap and lifetime-tracker refusals match on Vulkan, native RTX 5060 and WARP. Strict handle checking and validation layer unavailable here, so original STATUS_INVALID_HANDLE was not reproduced. Build emitted pre-existing vulkan_present.h:669 C4189 and TEMP MSB8029. Synthetic handles only, no game files. AI-assisted (Codex). |
|
Retested on the Windows / RTX 3060 12 GB setup that previously reproduced 0xC0000008 in #7218. At f5de0db, the unmodified d3d12_existing_heap CTest passed with NVIDIA 621.14, clang-cl/xwin SDK 10.0.26100 and Khronos validation 1.4.363. Native NVIDIA D3D12 and WARP refusal checks also passed. AI-assisted testing. |
|
Tested f5de0db on Windows 10 22H2 (19045), MSVC 2022, Vulkan SDK 1.4.363: pass for the change.
(My first version of this comment blamed allocation-info size lines; those are only printed, not the failing assertions. Corrected.) AI-assisted (Claude Code). |
|
Independent controlled strict-handle check of f5de0db: PASS, with the original 0xC0000008 reproduced as a negative control. Claim: #7333 (comment)
All six successful runs completed the Vulkan, native NVIDIA D3D12 and WARP refusal checks. The validation-on PR runs printed Method: a separate launcher uses CreateProcessW with STARTUPINFOEXW, PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY and PROCESS_CREATION_MITIGATION_POLICY_STRICT_HANDLE_CHECKS_ALWAYS_ON. It creates the child suspended, queries GetProcessMitigationPolicy(child, ProcessStrictHandleCheckPolicy), requires RaiseExceptionOnInvalidHandleReference=1 and HandleExceptionsPermanentlyEnabled=1, then resumes and records the child exit code. This changes the child process policy only; no registry, system-wide mitigation or Application Verifier configuration was changed. The policy is documented by Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-updateprocthreadattribute The PR's test and runtime source were unchanged. For the negative control I compiled HEAD^:runtime/test/d3d12_existing_heap_test.cpp as a second local target linked to the SAME PR library. This isolates replacement of the bogus handle; it is not a claim that the entire parent revision was built. Local CMake additions only register that extra target. I did not repeat the author's separate E_NOTIMPL-before/E_INVALIDARG-after runtime comparison. Build: cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo; cmake --build runtime/build --target d3d12_existing_heap_test strict_original_heap_test -j 6. The existing vulkan_present.h:669 C4189 warning appears twice. Fresh head/coordination recheck completed; merge-tree with main 86d1c86 is clean. Tests were of the exact PR head, not that speculative merge. AI-assisted (Codex). This fills the controlled strict-policy reproduction gap in the earlier reviews; no replacement implementation PR. |
|
Tested AI-assisted (Claude Code), no game files. |
Claimed in the coordination issue: #7333 (comment) (from my finding in #7231).
What and why
d3d12_existing_heap_test(from #4538) passed the made-up handle(HANDLE)0x1234toOpenExistingHeapFromFileMapping. With strict handle checking on (Application Verifier, a debugger, some security software),GetHandleInformationraisesSTATUS_INVALID_HANDLEon it instead of returning FALSE, so the test ended with0xC0000008before printing anything. @umnitus saw it on an RTX 3060 / NVIDIA 621.14 onmain8575d36e, with validation on and off.E_INVALIDARG(RTX 4090 and WARP), while the Vulkan layer answeredE_NOTIMPL, because it only checked that the handle was valid.OpenExistingHeapFromFileMappingnow also checks that the handle names a section object, fromNtQueryObject's type name, with nothing mapped. IfNtQueryObjectisn't available, the handle counts as a section, which keeps the old behaviour.Tested
RTX 4090, driver 617.42, Windows 11 26200, MSVC 2022 RelWithDebInfo,
LEONIDA_VK_VALIDATION=1:d3d12_existing_heap_testpasses on the Vulkan device, the RTX 4090 host device and WARP, with no validation errors. Before the layer change, the new assertion failed on the Vulkan device only (0x80004001vs the host's0x80070057).Not reproduced here: the
0xC0000008itself, since this machine doesn't have strict handle checking. The fix removes the bogus handle that causes it. Synthetic only, no game data.AI-assisted: yes (Claude Code).
🤖 Generated with Claude Code