-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Starting App on iOS fails with System.ExecutingEngineException #80853
Comments
From @rolfbjarne on Thu, 19 Jan 2023 15:12:23 GMT I can reproduce this with the provided sample and running on an iOS device. Using ILSpy on this method
and nothing in particular stands out to me, so I'm moving to dotnet/runtime. |
Tagging subscribers to this area: @directhex Issue DetailsFrom @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934 Steps to Reproduce
Expected BehaviorThe app runs Actual BehaviorThe following exception is raised on app startup
I have tried adding Environment
Copied from original issue xamarin/xamarin-macios#17159
|
/cc @vargaz |
FYI, this makes 'hello world' on iOS fail. For me, this implies that .NET on iOS isn't anyone's priority, given that the most basic of apps fails to launch and it's not being investigated. |
Yup. This issue hasn't received any activity for almost 4 months. |
@jhimes144 on android, was full aot being used and you didn't hit this problem? If not, it's very likely the code path was still using jit. |
@steveisok Full aot was/is being used on android and the problem is not encountered. |
This particular code pattern, when a function pointer is returned from native code and later called using calli is not supported by full-aot, don't think it ever was. The reason is that the runtime needs to generate a managed-to-native wrapper to call the function pointer, and the wrapper needs to embed the address which is called which is a runtime constant, so it cannot be generated at AOT time. Enabling the interpreter might fix the problem. |
@maxkatz6 Tagging you here |
@vargaz thanks for the explanation. Either way, we will look into possible workarounds. |
Also, you are right about interpreter. In our tests it did solve the problem. |
Testcase:
|
This looks fixable, will look into it. |
FYI, my repo case was getting started with Avalonia on iOS following these steps: https://docs.avaloniaui.net/tutorials/developing-for-mobile/create-a-cross-platform-solution If this patch has made it into a public .NET 7 build on MacOS, I will try. Or if you can point me to the right doc to build/install a private build on MacOS, will try as well. |
@SamMonoRT should we consider backporting #85923 to 7.0? |
@vargaz - not sure how much the code has deviated, but should be ok to backport the fix to 7.0 ? |
It could be backported, it should be low risk. |
@vargaz Thank you so much for looking into this. I could find time at some point this week to attempt to get the daily build of .net to work with Avalonia to see if the issue is resolved. I'm also a huge fan of a backport. Thanks! |
Looking forward to starting to invest in .NET/Avalonia on iOS app development! Appreciate the attention and effort, peoples. |
I came here from the linked issue in Avalonia. This issue is blocking my development of an iOS app using Avalonia. I'm stuck on NET 7 for now so a backport would be appreciated. |
@jhimes144, were you able to try out a nightly to see if this fixes the issue? |
I apologize, I have not had time to look into this yet. The boss man has thrown other priorities at me. It may be a week or two before I get back to this. |
@steveisok I can give it a try. How would I try the nightly? Installed |
There are daily SDKs in https://github.com/dotnet/installer if that is what you need? |
@danmoseley Thanks for confirming, that is what I found and installed. Then when I deployed my Avalonia-based iOS app, I still go the crash. So either the crash is unfixed, or I didn't deploy the new runtime, which led to my question, should I rebuild Avalonia too? Thanks! |
We landed the fix in main, but the backport to 7 hasn't made it yet. Can you try a .net 8 nightly sdk instead? |
Having trouble building with net8.0. Process so far:
Googling around points to the linker. |
The backport PR is: |
I believe you can work around this by adding this to your csproj: <PropertyGroup>
<_RequiresILLinkPack>true</_RequiresILLinkPack>
</PropertyGroup> |
Thanks @rolfbjarne . I added that and now am getting
|
@slater1 can you try directly from the Mac? |
Ok, sure. After following the steps below, on the mac a vanilla avalonia.xplat project builds and runs in the iOS simulator: Steps:
Not sure what this means for me using Visual Studio from Windows. Later today I can try this with a real iPhone. |
… in full-aot mode. (#86934) * [mono][aot] Generate 'native-indirect' wrappers in full-aot mode. Fixes #80853. * Add support for native_func_indirect wrapper type in append_mangled_wrapper and append_mangled_wrapper_subtype functions --------- Co-authored-by: Zoltan Varga <[email protected]> Co-authored-by: Milos Kotlar <[email protected]>
i'm facing to the same problem since days, on Simulator it runs perfectly. |
@DrWenz One workaround is to use the mono interpreter. <PropertyGroup>
<UseInterpreter>True</UseInterpreter>
</PropertyGroup> This worked for me to get my Avalonia iOS app running on real devices. Interpreter is slower sometimes than AOT so be sure to performance test your app. |
Thx @slater1 works like charm :) saved my day! |
Based on above comments and backported PR merging, closing this issue. Please re-open if you still encounter the crashes. |
From @jhimes144 on Sun, 08 Jan 2023 04:51:56 GMT
This is an issue I have raised over in Avalonia here AvaloniaUI/Avalonia#9934
To the best of our knowledge, the below method
GetStringNative
should not have any problem with AOT, and everything works fine on Android with AOT enabled. So far I've reproduced this on two separate code bases.Steps to Reproduce
CodesignKey
in project file for the ios projectExpected Behavior
The app runs
Actual Behavior
The following exception is raised on app startup
I have tried adding
<ResolveAssemblyConflicts>true</ResolveAssemblyConflicts>
, different linker settings, and downgrading the project to .net 6. All attempts failed with same error.Environment
Copied from original issue xamarin/xamarin-macios#17159
The text was updated successfully, but these errors were encountered: