Repository navigation
Conversation
alloc_code always committed a 64 KiB arena, even when the aligned request was larger. Its returned pointer therefore did not cover the requested range, and the bump cursor advanced past the arena end. Allocate the larger of the default arena and the aligned request. Reject alignment overflow before taking the arena mutex, and compare the request against remaining capacity without adding it to an address. Windows 11 ARM64 VM, x64 MSVC rustc 1.100.0: VirtualQuery reproduced 65537 requested bytes backed by only 65536 committed bytes before the fix. Afterward cargo test --locked -p xcl --lib stubs::tests -- --test-threads=4 passed 5 tests, 0 failed, 0 ignored (716 filtered out), including overflow rejection, generated-code execution and concurrent stub reuse. No real-title smoke run or release-profile test was performed. Assisted-by: omp (openai-codex/gpt-6-astra)
Owner
Author
|
Upstream PR xcl-dev#1155 was closed or merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I make
alloc_codehonor requests larger than its default 64 KiB arena. Previously, it committed only 64 KiB and advanced the allocation cursor by the larger requested size, returning a pointer without enough backing memory.What is in it
stubs.rs: size each new arena for the aligned request, reject alignment overflow before locking, and compare against remaining capacity without overflowing an address addition.VirtualQueryregression for large requests and a subsequent small request; overflow regression and allocation-contract documentation.This is independent of xcl-dev#936's unwind registration; it does not add unwind metadata.
Tested
I ran debug tests on Windows 11 Pro ARM64 10.0.26100.1742 in UTM (4 GiB RAM, virtual
virt-10.0CPU, Red Hat VirtIO GPU DOD), with Rust 1.100.0x86_64-pc-windows-msvcand Visual Studio 2022 Build Tools. The guest used main47efa2ecea0a12934719ae69b81930cf02a4b1c3plus the source changes committed asa59c84e8309560e5dbf90e17ae965ee6d0c82212.cargo test --locked -p xcl --lib stubs::tests::executable_allocations_cover_the_requested_size -- --exact: 0 passed, 1 failed, 0 ignored, 720 filtered out.VirtualQueryshowed 65,537 requested bytes backed by only 65,536 committed bytes; the test did not write past the allocation.cargo test --locked -p xcl --lib stubs::tests -- --test-threads=4: 5 passed, 0 failed, 0 ignored, 716 filtered out; noSKIPPEDoutput. This includes the allocation regressions, generated stub execution and concurrent stub reuse.Not tested
I have not run the release profile, full workspace suite, native x64 Windows hardware, D3D12 GPU execution or a real title. I have not observed a game requesting an executable allocation larger than 64 KiB; this reproduces the allocator contract failure directly.
Regression run
Not run. This remains a draft pending the required real-title
xcl-smokeblocks from main and this PR's clean head, with the same title and duration.AI use
I used omp (
openai-codex/gpt-6-astra) to investigate, implement the fix and regressions, run the Windows tests, and prepare this PR.Mirror of xcl-dev#1155 (auto-synced, do not edit).