Repository navigation
d3d12_xs: slot 14 does not take an address in the first 64 KiB as a console heap; d3d12_draw no longer SEGFAULTs (D3D-SLOT14-TAIL-NULL-PAGE) - #1148
Conversation
…onsole heap (D3D-SLOT14-TAIL-NULL-PAGE) d3d12_draw SEGFAULTed with MSVC RelWithDebInfo: its one-entry RTV desc was followed on the stack by the words 1 and 32, which console_heap_range_plausible accepted (32 == 1 * 32), so the RTV heap started at 0x1 and CreateRenderTargetView wrote through it. Windows never maps the first 64 KiB and no console heap lives there; reject such addresses. d3d12_console_descriptor_heap_test gets the stray-words case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested
AI-assisted: yes |
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Reviewed and verified. Essential stability fix in
untime/shims/d3d12_xs_device.cpp:console_heap_range_plausible. Requiring descriptor heap addresses to exceed \kLowestMappedAddress\ (0x10000) prevents stray stack values (e.g. 1 and 32 left on stack under MSVC RelWithDebInfo in \d3d12_draw_test) from falsely matching one-descriptor console heap size checks and crashing with SEGFAULTs at address 0x1. Verified with clean test addition in
untime/test/d3d12_console_descriptor_heap_test.cpp. 100% clean-room.
|
Recommendation: [MERGE] Reasoning: Slot 14 no longer treats an address in the first 64 KiB as a console heap, which fixes the Impact level: 5/10 |
|
Tested the code fix on current Applied the
On this machine the SEGFAULT does not reproduce on clean The code hunk applies cleanly. The test hunk conflicts because main's console.desc.NumDescriptors = 1;
console.address = 1;
console.size = 32;
if (!check_start("stray trailing words", false)) return false;The fix looks good and is harmless: it only rejects console-heap addresses below |
|
@Luna-OS The code fix is verified on an RTX 3080 Ti (above), but the PR still conflicts with main's reworked check_xs_proxy_slot14. The stray case fits main's check_start helper (snippet above). Could you rebase? Happy to help. (AI-assisted.) |
Claimed in the coordination issue as: D3D-SLOT14-TAIL-NULL-PAGE (#14 (comment))
Depends on: none. Touches the same function's neighbourhood as #644 (heap sync) and the same decision as the stale draft #216 (choosing the slot-14 layout per device proxy, which would remove the guess altogether); this is the minimal fix for
mainuntil that lands.What and why
d3d12_drawSEGFAULTs onmain(seen at3295055) with MSVC RelWithDebInfo when glslang is available, so the test is built:It is the false positive of #3 again, past the size check #4 added.
proxy_create_descriptor_heapreads the 16 bytes after aD3D12_DESCRIPTOR_HEAP_DESCas a console address/size pair whenconsole_heap_range_plausibleagrees. The test's ordinary one-entry RTV heap (runtime/test/d3d12_draw_test.cpp:351) had, measured with a temporary log at that call:32 == 1 * 32, so the size check passed, the heap's start became0x1, andCreateRenderTargetViewwrote through it. For a one-descriptor heap a stray32next to the desc is not unlikely.The fix:
console_heap_range_plausiblealso requires the address to be at least0x10000. Windows never maps the first 64 KiB (the lowest user-mode address is0x10000), so no console heap address can be there. Real console addresses (0x556677880000and0x112233440000in the existing test) are unaffected.d3d12_console_descriptor_heap_testgets the measured case: an RTV desc withNumDescriptors = 1followed by1, 32must give an ordinary heap through the proxy.Tested
Windows 11 Pro 26300, NVIDIA GeForce RTX 5070 Ti (621.24), MSVC 19.44.35207, Ninja, RelWithDebInfo, glslang (KhronosGroup
main-tot) on PATH viaVulkan_GLSLANG_VALIDATOR_EXECUTABLE. No game files.d3d12_console_descriptor_heap(with the new case)stray trailing words were taken as a console heap: CPU start 0x1d3d12_drawctestd3d12_execute_indirect_validation(#504), as onmaind3d12_descriptor(the test of #3) passes in both.GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 621.24, Windows 11 26300 (plus live WARP in the tests that use it)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.🤖 Generated with Claude Code