D3D12.X: read the adopted vtable pointer unaligned in is_adopted #1434
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1434
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1434/head"
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?
@JorgeMJM on GitHub · 2026-11-24 15:54 UTC · original
JorgeMJM:d3d12x/is-adopted-unaligned→main· +12 −1 · 1 files · 1 commits · closed without mergingFixes #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
@futurepro62 on GitHub · 2026-11-24 16:52 UTC · original · edited 2026-11-24 17:01 UTC
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
@JorgeMJM on GitHub · 2026-11-24 17:05 UTC · original
Withdrawn by the author.
@DavidM1911 on GitHub · 2026-11-24 18:52 UTC · original
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