Support Linux fork on Windows userland - #1492
Open
Weidong Cui (wdcui) wants to merge 2 commits into
Open
Weidong Cui (wdcui) wants to merge 2 commits into
Weidong Cui (wdcui) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4c14910e-872b-44e8-a57e-eb7c6a1d43a2
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4c14910e-872b-44e8-a57e-eb7c6a1d43a2
|
🤖 SemverChecks 🤖 Click for details |
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.
This PR adds Linux-shim
forkandvfork+exec support on Windows userland. The broker writes a forked child's memory image into a page-file-backed section that reserves the policy's maximum child image size and commits pages as they are written, and passes the child runner a read-only handle to it during setup. The runner maps short-lived views of the section to restore each region. To support this,ProcessLauncher::create_imagenow takes the image capacity, and--allow-process-duplicationis now available on Windows. The Linux-on-Windows runner now decodes child startup data, either restoring a forked process from its image or starting an exec'd program in a new runner, so its program argument is now optional. New Windows loader tests run prebuilt staticfork_parentandvfork_exec_parent/vfork_exec_childguests, and unit tests cover the image transport, including that the runner cannot write the image.