D3D12.X: read the adopted vtable pointer unaligned in is_adopted #1424
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1434"
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?
Imported from ivall/xcl. Originally posted by JorgeMJM on 2026-11-24T15:54:39Z.
Fixes #1130.
this_firstpasses both arguments of struct-returning hooks tois_adopted, including 4-byte-aligned return buffers such asD3D12_HEAP_PROPERTIES. The aligned 8-byte load is UB and aborts debug builds with a misaligned-pointer panic.read_unaligned()answers the same question with no trap; genuine adopted objects are heap COM pointers and never misaligned, so no verdict changes.What is in it
crates/xcl/src/hle/d3d12x/real.rs:is_adopteduses(obj as *const usize).read_unaligned(); new regression testfour_byte_aligned_return_buffer_does_not_trapinthis_first_tests.Tested
cargo test --workspace -- --test-threads=4: lib 708 passed, 0 failed, 21 ignored (2 GPU tests SKIPPED on this adapter); all other targets green, 0 failed. One full-suite run hitcoherent_buffer_sanitizes_console_flags_and_statefailing atVirtualFree; it passes in isolation and in the rerun and on cleanorigin/main(707/707) — flake, left untouched as a separate issue.508a0c7+ fix, test against reverted line); the with-fix result holds on this PR's head.Regression run
Not tested
GetCustomHeapPropertiestrace in the smoke logs); the run counts as a no-regression check on the touched area.AI use
Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T16:52:55Z.
Full-suite run, since this PR has no test report yet. Tested exact head
a4202ed(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.four_byte_aligned_return_buffer_does_not_trap.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
Imported from ivall/xcl. Originally posted by JorgeMJM on 2026-11-24T17:05:42Z.
Withdrawn by the author.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T18:52:25Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
Pull request closed