Build: the high-entropy VA opt-out reaches only the xcl binary, so the 17 in-process integration tests run in the address space #631 removed #2263
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#2263
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?
@itsonewi on GitHub · 2026-11-25 11:48 UTC · original
Summary
crates/xcl/build.rs(1a0bbe3) turns high-entropy VA off for one target:-bin=xclis the[[bin]] xclonly. The crate also has a[lib], and 17 integration tests link that lib and drive the HLE in process:Those binaries are linked with Rust's default, so they keep high-entropy VA and their
VirtualAlloc(NULL)reservations land around 1-2.5 TiB - the layout #631 measured and removed fromxcl.exe:(from #631's description)
Why it matters
heap_probe,sparse_reinit,pls_quota,predication_e2eand the rest run the HLE against an address space the released binary no longer has. Anything address-sensitive - the 2^40 ceiling in #585, theVirtualAlloc2fallbacks @sub-north traced, heap-window and sparse reservations - is exercised at 2 TiB incargo testand at 2 GiB inxcl.exe. In both directions that is wrong: a test can pass over a path the exe cannot take, and can fail on a layout the exe cannot reach.crates/xcl/tests/low_va.rsdoes not cover this: it readsenv!("CARGO_BIN_EXE_xcl")(the binary's PEDllCharacteristics), so the process it runs in is still high-entropy VA.Suggested fix
rustc-link-arg-testsapplies to every integration-test binary of the package. The binary keeps its own directive, and the PE-header test keeps guarding it, so the two cannot drift apart silently. If the tests are meant to run in the default layout on purpose, then what is missing is a note saying so: as it stands the difference is invisible from the test side.A cheap check after the change: a test that calls
VirtualAlloc(NULL)once and asserts the returned address is below 2^40 - it fails onmaintoday.Not tested
1a0bbe3without a checkout, and the 1-2.5 TiB figures are #631's measurement, not a new one.AI use
crates/xcl/build.rs,crates/xcl/tests/low_va.rsand the list of tests that import the crate, and wrote this report; the human account checked each file before opening it.@Decodere on GitHub · 2026-11-25 12:19 UTC · original
Taking #2263 in
crates/xcl/build.rsandcrates/xcl/tests/low_va.rs.Plan:
cargo:rustc-link-arg-tests=/HIGHENTROPYVA:NO(MSVC) andcargo:rustc-link-arg-tests=-Wl,--disable-high-entropy-va(GNU) alongside the existingrustc-link-arg-bin=xcldirectives incrates/xcl/build.rs.crates/xcl/tests/low_va.rsto checkDllCharacteristics & HIGH_ENTROPY_VA == 0onstd::env::current_exe()as well asxcl.exe, plus verify a liveVirtualAlloc(NULL, 64 KiB, MEM_RESERVE, PAGE_READWRITE)(freed withVirtualFree) lands below1 << 40.main, post-fixlow_vapass, fullcargo test --release --workspaceacross all 17 integration-test binaries under the low-VA layout, andpr_check.py.AI use: drafted with Google Antigravity (Gemini 4 Neon); implementation and tests will run locally.
@Lum7nt on GitHub · 2026-11-25 14:55 UTC · original
Verified PR #2292 (\
5a26eb9) on Windows 11 (NT \10.0.22631.0),ustc 1.100.0\ MSVC, RTX 3060 (\XCL_ADAPTER=nvidia, debug profile):