Skip to content
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

[iOS] Attempting to JIT compile method while running in aot-only mode when using AutoMapper on iOS with .NET 8 #20611

Closed
thomaschenato opened this issue May 16, 2024 · 3 comments
Labels
need-repro Waiting for a test case before the bug can be investigated

Comments

@thomaschenato
Copy link

thomaschenato commented May 16, 2024

Hello,

I'm working on a Xamarin.iOS migration to .NET 8. However encounter a runtime crash "JIT compile method while running in aot-only mode"

I've read up a few past issues / articles around JIT/AOT crashes in Xamarin / Xamarin.Form and the workaround solution in the past e.g.

#15681

<PropertyGroup>
    <UseInterpreter>true</UseInterpreter>
</PropertyGroup>

However this workaround doesn't seem to work in .NET 8 as it trigger a crash at app launching.

Please see the detail below and wonder if there is fix in .NET 8 with AutoMapper on iOS

Steps to Reproduce

  1. Create an basica iOS project targeting .NET 8 from template
  2. With AutoMapper 13.0.1, .NET 8 SDK 8.0.203, XCode 15.1
  3. TargetObject targetObject = mapper.Map<TargetObject>(info);
  4. iOS throw exception during runtime on both simulator or physical iPhone. Exception detail listed in the Actual Behaviour section

Expected Behavior

Target object can be created

Actual Behavior

System.ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) mapper_ios.AppDelegate/TargetObject object:Thunk1ret_TargetObject_Object_TargetObject_ResolutionContext (System.Func`2<object[], object>,object,mapper_ios.AppDelegate/TargetObject,AutoMapper.ResolutionContext)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

Environment

Version information
macOS Sonoma 14.1
XCode 15.1
.NET 8 SDK 8.0.203

Build Logs

Example Project (If Possible)

@rolfbjarne
Copy link
Member

Please provide a complete test project we can use to reproduce the problem, that way we can be sure we're testing the same thing.

@rolfbjarne rolfbjarne added this to the Future milestone May 21, 2024
@rolfbjarne rolfbjarne added the need-repro Waiting for a test case before the bug can be investigated label May 21, 2024
Copy link
Contributor

Hi @thomaschenato. We have added the "need-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/xamarin/xamarin-macios/blob/main/docs/bug-repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

Copy link
Contributor

Hi @thomaschenato. Due to inactivity, we will be closing this issue. Please feel free to re-open this issue if the issue persists. For enhanced visibility, if over 7 days have passed, please open a new issue and link this issue there. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need-repro Waiting for a test case before the bug can be investigated
Projects
None yet
Development

No branches or pull requests

2 participants