-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mono] Add a no-exec code manager for AOT compilation; switch Catalyst CI to JustInterp AOT mode #53197
Conversation
…ip during System.Diagnostics.FileVersionInfo test run
Tagging subscribers to this area: @directhex Issue DetailsDon't allocate pages with execute permission if we're never going to be executing code. Also don't try to toggle per-thread write protection if we're not expecting to write to executable pages.
|
ping @steveisok @vargaz I haven't tested it yet. But this will stop allocating executable pages on all platforms when we're just doing AOT compilation. As a side-effect it will let the AOT compiler run without special permissions on M1 macs @vargaz it's just the last 5 commits that have the interesting changes. |
Don't allocate pages with execute permission if we're never going to be executing code. Also don't try to toggle per-thread write protection if we're not expecting to write to executable pages.
Ok, System.Buffers.Tests and System.Runtime.Tests both compile and run with FullAOT MacCatalyst arm64 and with JustInterp MacCatalyst arm64. For System.Runtime.Tests I had to enable @vargaz System.Runtime.Tests crashes https://gist.github.com/lambdageek/1906b3f28166cdf150f4840240caef4d To repro, build the runtime on M1 with: ./build.sh --os maccatalyst -c Release then in ../../../../dotnet.sh build /p:RunAOTCompilation=true /p:MonoForceInterpreter=false /t:Test /p:TargetOS=MacCatalyst -c Release then run the AOT binary under |
We defensively also toggle the page write protect bits when resolving some AOT patch targets in mono_resolve_patch_target_ext. Instead allow the call, but don't do anything.
It's a forwarding assembly. Don't treat it specially
We only need to AOT the trampolines in System.Private.CoreLib in interpreter-only mode. We don't need to AOT any of the user code in other assemblies. Side effect: fixes the System.Runtime.Loader.DefaultContext testsuite in JustInterp mode. Still broken in Full AOT mode. (That testsuite references the System.Runtime.Loader.Noop.Assembly assembly, but with a different filename System.Runtime.Loader.Noop.Assembly_test.dll which causes linking errors due to incorrect symbols in AOT module registration in AppleAppBuilder)
and adhoc signing
The catalyst arm64 tests all compiled, apparently, but some of the runs bailed out like this:
I will investigate |
@steveisok @akoeplinger I think xharness will need to do something - macOS seems flaky Okay, I can repro the failure it's really weird. Basically if I build with If I then "simulate" what helix seems to do by just doing
it will immediately fail with However both of the following work:
or
So I think the right thing is for |
Added an xharness issue about it dotnet/xharness#611 |
Catalyst launch issue should be fixed by dotnet/xharness@6969531 -- need to wait for maestro to do its thing in #53423 |
@steveisok I think this is good to go. There were a couple of failures but I think they can be investigated separately - I don't think they're indicative of some underlying problem with this PR.
|
Not sure what to make of the |
@lambdageek I'd say just skip the ones you find troubling. |
Aha... leakwheel is #53452 |
CoreCLR failure is unrelated. Catalyst arm64 had one flaky System.IO.FileSystem.Watcher.Tests failure - but that testsuite also flakes on macOS with mono and with coreclr, so I don't think it's related to this PR. Catalyst x64 had some flaky failures, too, but also don't look related. Merging. |
@steveisok - should we log an issue to investigate and proactively disable the flaky test - possibly dragging down pass rates for corresponding lanes. |
Yep, @mdh1418 please follow up and skip what Aleksey outlined. |
Since we cannot easily JIT on arm64, we need to change how we run in interp mode. The old way apparently has some JIT fallbacks, so we need to switch to the mode supported by AOT.
Don't allocate pages with execute permission if we're never going to be executing code. Also don't try to toggle per-thread write protection if we're not expecting to write to executable pages.
Don't assert on Catalyst in mono_codeman_enable_write
We defensively also toggle the page write protect bits when resolving some
AOT patch targets in mono_resolve_patch_target_ext. Instead allow the
call, but don't do anything.
Set ENABLE_MONOTOUCH for MacCatalyst arm64. Define MONOTOUCH in one place
[aot] mscorlib.dll isn't CoreLib on netcore. It's a forwarding assembly. Don't treat it specially
[testing] In JustInterp mode, only AOT System.Private.CoreLib
We only need to AOT the trampolines in System.Private.CoreLib in
interpreter-only mode. We don't need to AOT any of the user code in
other assemblies.
Side effect: fixes the System.Runtime.Loader.DefaultContext testsuite
in JustInterp mode. Still broken in Full AOT mode.
(That testsuite references the System.Runtime.Loader.Noop.Assembly
assembly, but with a different filename
System.Runtime.Loader.Noop.Assembly_test.dll which causes linking
errors due to incorrect symbols in AOT module registration in
AppleAppBuilder)
Fixes #53106