Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Other Merge Risk:
|
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.
What
guest_main_stack_movefails now and then on macOS withcheck failed: the process start block stays mapped where dyld points. After the main stack moves, the emulator keeps the old stack from the page ofargv - sizeof(char*)up to its top (ProcessStartBlockLowandServeMainQueueinMainThreadMacOs.cpp, from boykopovar#15698) and releases the rest. The test expected the kept 64 KiB block at the address of a local variable inmain. That local sits a few KiB belowargv, and with stack ASLR the two addresses sometimes fall into different 64 KiB blocks. The test then probes the block below the kept range,GuestArenaMarkUsedaccepts it, and the check fails.Measured with temporary prints on an M1: in a passing run the local's block was
0x308d00000and the kept range started at0x308d02000; in a failing run the local's block was0x3087a0000and the kept range started at0x3087b1000.This change computes the expected block from
main'sargv - sizeof(char*), the same address the emulator uses. The page rounding is not repeated because 64 KiB is a multiple of the page size. The test is the only file changed and the assertion is unchanged.argvis read inmainbecause the emulator replaces*_NSGetArgv()with copies after the move.No open PR changes
GuestMainStackMove.cpporMainThreadMacOs.cpp. I searched open PRs forguest_main_stack_move,GuestMainStackMoveandMainThreadMacOs, and none of the hits touches either file.pr_overlap.py --branchcompared 2467 open PRs and found no overlap.Tested
Apple M1, macOS 26.5, x86_64 Release under Rosetta 2. The tree was
main61cce6e86bplus boykopovar#17425, boykopovar#11049 and boykopovar#26739, which a macOS full build needs.GuestMainStackMove.cpp,MainThreadMacOs.cppandGuestArena.hppare byte-identical there and on this PR's base8170c102d4.bce996ecc6):ctest --test-dir build -R '^guest_main_stack_move$' --repeat until-fail:60passed 60 of 60, then--repeat until-fail:200passed 200 of 200.main, same build with the test reverted and rebuilt:--repeat until-fail:60failed on the first run. 40 separatectestruns passed 38, and 40 direct runs ofguest_main_stack_move_testspassed 39. Every failure wasthe process start block stays mapped where dyld points.originalInArena). A temporary print, not part of this PR, showed that this was true in 100 of 100 runs with the change, and all 100 passed.Head
24543f9753only merges 9 latermaincommits, none of which touch the test,MainThreadMacOs.cpporGuestArena.hpp.Linux and Windows were not run. The test is built only for macOS x86_64.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)AI-assisted: yes (Claude Code)
Summary by CodeRabbit