Repository navigation
Tests: guard unmapped placeholder read and release views in heap_probe - #1744
kilvynsilveira-tech wants to merge 1 commit into
Conversation
In heaps_over_sections_in_a_placeholder, skipping chunk 1 left its placeholder PAGE_NOACCESS while the post-loop read still dereferenced it, and neither the mapped chunk views nor the 256 MiB reservation were released. Also unmap/close on CreatePlacedResource failure in heaps_over_partly_committed_sections, return cleanly on D3D12CreateDevice failure in view_heap_capacity, and add a non-ignored CPU test for placeholder split/unmap/coalesce/release. Assisted-by: Antigravity (Gemini 4 Carbon)
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
Nothing has happened on this PR for 3 days, so it is marked |
|
No open or merged PR makes the same change; #1328 adds separate probes to AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Fix three bugs in
crates/xcl/tests/heap_probe.rsand add a non-ignored CPU regression test for placeholder unmapping, coalescing, and release:heaps_over_sections_in_a_placeholder,*((base + 11 * chunk) as *const u32)ran unconditionally after the loop even if chunk 1 skipped (MapViewOfFile3orOpenExistingHeapFromFileMappingfailure), dereferencing an unmappedPAGE_NOACCESSplaceholder (0xc0000005). Guard the read on chunk 1 having mapped, assert its first word (1 << 28), and unmap + coalesce +VirtualFreethe 256 MiB placeholder reservation on exit (and on early-continue error paths).heaps_over_partly_committed_sections, failingCreatePlacedResourceskippedUnmapViewOfFile(view)andCloseHandle(h), leaking up to 4 GiB of virtual address space and a file-mapping handle.view_heap_capacity, return early whenD3D12CreateDevicefails instead of panicking on.unwrap(), matching the other three probes in the file.What is in it
crates/xcl/tests/heap_probe.rs:viewand closehonCreatePlacedResourcefailure inheaps_over_partly_committed_sections.CreateFileMappingW, clean up views/handles onMapViewOfFile3/OpenExistingHeapFromFileMappingfailure, guard chunk 1's read onchunk1_mapped, and unmap (MEM_PRESERVE_PLACEHOLDER) + coalesce (MEM_COALESCE_PLACEHOLDERS) + release (VirtualFree(..., 0, MEM_RELEASE)) the placeholder reservation inheaps_over_sections_in_a_placeholder.D3D12CreateDeviceerror inview_heap_capacity.placeholder_chunks_unmap_coalesce_and_release_cleanlyverifying that a skipped split chunk remainsMEM_RESERVE/PAGE_NOACCESSand thatUnmapViewOfFileEx+MEM_COALESCE_PLACEHOLDERSreleases the full reservation.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), DXCdxcompiler 1.8.2502.11(dxil 1.8.2502.11), debug build.cargo test -p xcl --test heap_probe -- --nocaptureon91d7cda: 1 passed, 0 failed, 4 ignored.cargo test -p xcl --test heap_probe -- --ignored --nocaptureon91d7cda(RX 580): 4 passed, 0 failed, 0 ignored (all four D3D12 probes ran and released their views, handles, and 256 MiB placeholder reservation cleanly).cargo test --workspace --no-fail-fast -- --test-threads=4on91d7cda: 858 passed, 1 failed, 42 ignored (242 SKIPPED SM 6.6 GPU tests on RX 580; the 1 failure is pre-existing onmainingpu_raw_window_view_reaches_its_top, addressed separately in Tests: skip gpu_raw_window_view_reaches_its_top without SM 6.6 #1736).Regression run
crates/xcl/tests/heap_probe.rs.Not tested
D3D12CreateDevicesucceeds on RX 580).AI use
heap_probe.rs, wrote the fix, regression test, and PR description, and ran the test suites on RX 580 under the user's direction.