-
Notifications
You must be signed in to change notification settings - Fork 5k
AOT compile aot-instances.dll, the AOT compiler exited with code 139. #109966
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
Comments
From @rolfbjarne on Fri, 15 Nov 2024 19:29:01 GMT Could you get an MSBuild binlog and attach it here? Thanks! |
From @bwinklesky on Fri, 15 Nov 2024 19:52:13 GMT Let me know if this doesn't work |
From @rolfbjarne on Mon, 18 Nov 2024 08:13:11 GMT Unfortunately that didn't give me many clues. Is there any chance we could get access to your project to compile it ourselves? |
From @bwinklesky on Mon, 18 Nov 2024 19:06:13 GMT
@rolfbjarne I created a respository and gave you access. WasatchBackcountryAlliance is the app to build. I ask that you destroy the source code after you've diagnosed the issue. |
From @rolfbjarne on Tue, 19 Nov 2024 12:28:31 GMT
I confirm I can reproduce the problem; I'll see if I can figure out where to route the bug and create a smaller test project that doesn't involve any of your code. |
From @formerlymisterhenson on Tue, 19 Nov 2024 13:27:19 GMT Well this error occured in my project as well, I went with:
|
From @rolfbjarne on Tue, 19 Nov 2024 16:17:20 GMT Smaller test case: aot-instances-1003365.zip To repro: unzip & run Binlog: msbuild.binlog.zip Crash report (mono-aot-cross): crash.txt |
@rolfbjarne thanks for looking into this! |
Just to let you know that I have this problem also - exactly as described above. I gave the solution from @formerlymisterhenson a shot and my build has now completed OK. However, not sure whether True is going to have any adverse effects? |
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger |
@BrzVlad could you please repro from Rolf's repro and get a real callstack - the one in the crash report is probably without symbols. That should help us triage this better. |
Any news on this issue? we have the exact same |
The fix is there, the release cycle will take a while. I would assume the new .NET9 version will be available sometime in January. |
The backport to 9 is #110271. |
Tried the suggestion above and others separate and together and still same issues.IOSBuild.zip
1> With environment: |
True
-all,System.Private.Windows.Core
this worked for me I was able to do a release build. @rolfbjarne thank you |
As of to date. Still not able to do a release, but have been able to upload a "Debug" version of the app for Test Flight until this is fixed. |
Not sure if you’re building against .NET 9 or not, but if you are… you can downgrade to version 8 and you should be able to publish a release build. |
I am developing for .Net 9. I did try switching to .Net 8 but many of my libraries also needed to be downgraded as well. Then some other issues came up that were fixed in the 9 libraries. So I will wait, this application is multi platform. |
Removing the package SixLabors.ImageSharp from the project "resolved" the problem for me. |
Any word on when this fix will be released? I too have the SizLablrs.ImageSharp nuget package and I'm getting this error. Unfortunately, I can't remove that package. |
I can confirm that this has a catastrophic performance hit. Unfortunately, the v9 release as a whole has been catastrophic for Web and iOS projects. |
Also hitting this one. Fingers crossed for this Patch Tuesday! 🤞 |
Still present in 9.0.4 sadly |
@jeremy-visionaid could you please create a separate issue with some more details about the failure you're seeing? It's possible it's yet another combination we haven't seen so far and the existing fixes don't cover. |
I could provide a project. But actually it is quite easy to reproduce it.
|
I installed the latest .NET, SDK 9.0.203, installed the maui workload and I can't reproduce the original issue from this bug report. I also tried the repro steps from above, without reproducing any crashes. On an arm64 mac I tried:
|
I can confirm that adding |
No repro for me referencing
Unfortunately, I can't share the project I can still repro on, but I'll have a go at cutting it down to something minimal to see which bit is causing the failure. |
At the risk of going off topic, does anybody know why Catalyst builds so much faster that iOS? For the SixLabours example:
For the project I'm working on where I can repro, the iOS build fails after about 10 mins, but the Catalyst build fails after only 30 seconds. |
OK. I have a minimal repro... It's just referencing types from System.Drawing.Common:
Repo available at https://github.com/jeremy-visionaid/MauiTestApp/tree/aot-crash Both iOS and Catalyst fail, but Catalyst fails much faster: Interestingly, the x64 build succeeds, but the arm64 build fails:
|
This is not an issue with the AOT compiler, rather a problem with packages and a missing dll. The errors reported during AOT compilation are Having said this, you shouldn't use This particular problem was reported before, for example: dotnet/maui#27057 |
@BrzVlad Thanks for the reply. Sadly it's not so simple as just not using System.Drawing.Common since I'm investigating porting an old application from WinForms to MAUI. There would be a lot of code to port to new types and serialization of them in settings, documents etc. Sure I could at least handle it in code that I control (with some effort), but it's also possible a reference might be acquired transitively. I think there are some other points for consideration here (I don't necessarily expect a reply since they not all compiler/runtime related, so maybe a bit off topic for this project):
I'm grateful to have a workaround (it's certainly a lot less work than removing the dependency), but it does feel like the developer experience could be improved here - even if that's beyond the scope of the compiler/runtime. |
Thank you @jeremy-visionaid for the effort of sharing more information with us and for your feedback! I'll try to answer some of your questions:
if (doIWantExceptions)
{
ThrowMySpecialException();
}
else
{
WriteItOutToLog();
} If the
|
For us adding |
This is because there's no AOT compiler for x64, it'll always use the JIT/interpreter. |
For me updating to .NET 9.0.4 (along with updating the iOS and MAUI workloads) fixed the build issue. (".NET 9 for iOS" project with ImageSharp) |
Came across the same issue after adding a NotificationServiceExtension project for BlazorHybrid. |
Thanks @rolfbjarne! You're of course correct that _ |
@vitek-karas Thanks to you also for taking the time for such a detailed reply! With respect to point 1, I was more looking at it from the Debug/JIT side... It would have been nice to have gotten some kind of warning. e.g. If |
This I agree with - I'm guessing that when we deprecated the assembly on non-Windows we didn't really do work to correctly annotate the APIs (that's actually quite a lot of work). We can open a bug on it, not sure if it will be fixed though. The analyzer would have a hard time with this - mostly due to technical limitations. It's a Roslyn analyzer, which only sees your source code and metadata about references. If the code you're calling directly is not in the references, then C# compiler itself will fail - no need to analyze for that. And if you're calling code which has the problem, the analyzer doesn't see that code. Ultimately there are a set of problems which the analyzer can't see, missing references in dependencies is one such set. |
All good. It's working for me now, so I'm happy enough, and I'm grateful for the help. There are just some orthoganal issues that made it a bit harder to deal with than I would have liked. FWIW, if types like |
I am in the unfortunate position of having "upgraded" from VS2002 17.12.4 to 17.13.6 today. Since doing that, I can no longer build Debug builds of our main commercial project: Failed to AOT compile Microsoft.Maui.Controls.HotReload.Forms.dll, the AOT compiler exited with code 139. Interestingly, a Release build seems to work fine. Obviously, I am stuck now. This is an iOS project that does not use MAUI. We are not referencing anything other than a couple of projects, which themselves do not reference anything. How do I get myself unblocked? |
Try disabling Hot Reload, it brings in assemblies that need MAUI, so it won't work if you're not using MAUI. |
I guessed you meant Tools -> Options -> Debugging -> XAML Hot Reload. We've never used that feature. You were right, turning it off has fixed the problem. Thank you. I really hope you are able to improve these error messages, and prioritise doing so. They are so unhelpful! |
Anecdotic datapoint: I do not use hot reload (my project is native .NET, not MAUI) in Rider and the issue appeared when I finally migrated from an Intel Mac to an Apple Silicon Mac last week. Same setup, except maybe the minor version of .NET 9 is newer now, haven't checked that one (the new machine got the latest 9.0.203).
|
Tried without the interpreter and the app built on iOS azure pipeline but app crashes when run - trying to see what the error is... Added back interpreter=true and all good |
From @bwinklesky on Fri, 15 Nov 2024 19:19:59 GMT
Apple platform
iOS
Framework version
net9.0-*
Affected platform version
.NET 9
Description
After upgrading to Xcode 16 and upgrading source code to version 9 we are getting this error.
IL stripping assemblies
12:01:24 Tool /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution finished (exit code = 139).
12:01:24
12:01:24 /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.0/18.0.9617/targets/Xamarin.Shared.Sdk.targets(1277,3): error : Failed to AOT compile aot-instances.dll, the AOT compiler exited with code 139.
Steps to Reproduce
dotnet publish release
Did you find any workaround?
No response
Build logs
No response
Copied from original issue dotnet/macios#21634
The text was updated successfully, but these errors were encountered: