mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:00:52 +01:00
[PR #1148] 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) #1182
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1182
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1148
Author: @Luna-OS
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/slot14-tail-null-page📝 Commits (1)
f6584edd3d12_xs: slot 14 does not take an address in the first 64 KiB as a console heap (D3D-SLOT14-TAIL-NULL-PAGE)📊 Changes
2 files changed (+31 additions, -3 deletions)
View changed files
📝
runtime/shims/d3d12_xs_device.cpp(+7 -3)📝
runtime/test/d3d12_console_descriptor_heap_test.cpp(+24 -0)📄 Description
Claimed in the coordination issue as: D3D-SLOT14-TAIL-NULL-PAGE (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141490109)
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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.