Repository navigation
Use private executable-template mappings under Rosetta - #136289
Merged
Merged
Conversation
CoreCLR's template allocator bypasses the existing restriction on shared executable mappings under Rosetta. Shared vm_remap aliases can leave Rosetta repeatedly faulting in its AOT translation-cache list during x64 startup, preventing managed code from running. Request copy-on-write mappings when Rosetta is detected, retaining the existing image-backed executable protections and preserving shared mappings for native execution. This changes the problematic mapping itself rather than masking the startup hang with retries, timeout increases, or disabled AOT. The exact-revision unmodified native build reproduced the fault on launch 8. The source-built change passed 100 uninstrumented minimal-host launches; forcing only its remap copy argument back to FALSE reproduced the same native fault on launch 7, and removing that intervention passed another 100 launches. Co-authored-by: Copilot App <[email protected]> Copilot-Session: d6bbfaee-7acb-41c6-ad60-06713a457a09
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @agocke |
Contributor
|
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @steveisok, @akoeplinger |
This was referenced Oct 26, 2026
rolfbjarne
added a commit
to dotnet/macios
that referenced
this pull request
Oct 28, 2026
Ignore dotnet unit tests at the shared `TestBaseClass.CanExecute` check when an x64 executable would run through Rosetta, pointing to tracking issue #27034. Intermittent runtime startup hangs are blocking PR validation while the upstream fix is pending. Keep native Intel execution and ARM64-capable universal apps on native ARM64 test runners enabled. Also cover translated x64 test runners while preserving the existing Windows and simulator behavior. Affected cases are marked ignored rather than merely returning false from the execution check. This is a temporary CI mitigation, not the runtime root-cause fix. Track removal of the ignore after the fixed runtime is adopted and verified in #27034; the upstream fix is dotnet/runtime#136289. Related: #27034 🤖 Pull request created by Copilot
Member
|
should this be backported to 11.0? |
Member
Author
I haven't seen this in .NET 11 so far, only .NET 12. I think the best option would be to wait with backporting until we have concrete evidence it's actually a problem in .NET 11. |
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.
CoreCLR's template allocator bypasses the existing restriction on shared executable mappings under Rosetta. Shared
vm_remapaliases can leave Rosetta repeatedly faulting in its AOT translation-cache list during x64 startup, preventing managed code from running.Request copy-on-write mappings when Rosetta is detected, retaining the existing image-backed executable protections and preserving shared mappings for native execution. This changes the problematic mapping itself rather than masking the startup hang with retries, timeout increases, or disabled AOT.
The exact-revision unmodified native build reproduced the fault on launch 8. The source-built change passed 100 uninstrumented minimal-host launches; forcing only its remap copy argument back to
FALSEreproduced the same native fault on launch 7, and removing that intervention passed another 100 launches.The standalone
net11.0Hello World app from the issue also reproduces using the failing .NET 12 runtime, without macios or custom native code. Replacing only itslibcoreclr.dylibwith the fixed runtime passed 200 launches. The original repeated macios Debug and Release cases passed all 80 application launches. These investigation results were collected against the runtime revision from the failing package, before rebasing this fix onto currentmain.After rebasing onto
mainat132d07183975d2846b0252c4dc9fabcb85bcba61, the x64 Release CoreCLR build succeeded with no warnings or errors. The same standalone app passed another 200 launches using the rebased build's CoreCLR, JIT, and CoreLib, with the original 30-second timeout and Rosetta AOT enabled.The new detection check runs when allocating a template block, not when executing a stub. A native allocation/remap/free microbenchmark under Rosetta (five runs, each with 30 alternating baseline/candidate pairs and 20,000 allocations per phase) showed no consistent slowdown: median allocation-cycle times were approximately 4.3 us baseline and 4.4 us candidate, with run-to-run variation larger than that difference. The detection call itself measured approximately 25 ns under Rosetta and 1 ns on native ARM64. These measurements do not execute the remapped templates or measure Rosetta translation costs, end-to-end application performance, or native Intel performance.
Resolves #136288
Note
This pull request description was prepared with GitHub Copilot.