dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.04k stars 4.68k forks source link

AOT Crash on iOS Release build, net8p7 #90751

Closed Redth closed 10 months ago

Redth commented 1 year ago

Description

Catching a crash at runtime with a .NET MAUI iOS app on .NET 8 Preview 7.

Native output / trace: https://gist.github.com/Redth/60b7ec5051d447c3e9321e6a5497e371

Using full interpreter mode does seem to avoid the crash.

Reproduction Steps

Not sure about extracting a simple repro yet, but happy to run more builds/diagnostics on request.

Expected behavior

No crashing

Actual behavior

Crashes

Regression?

This worked at least with .NET 7 and I believe earlier .NET 8 previews as well.

Known Workarounds

No response

Configuration

Other information

No response

Redth commented 1 year ago

@steveisok FYI

ghost commented 1 year ago

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos See info in area-owners.md if you want to be subscribed.

Issue Details
### Description Catching a crash at runtime with a .NET MAUI iOS app on .NET 8 Preview 7. Native output / trace: https://gist.github.com/Redth/60b7ec5051d447c3e9321e6a5497e371 Using full interpreter mode does seem to avoid the crash. ### Reproduction Steps Not sure about extracting a simple repro yet, but happy to run more builds/diagnostics on request. ### Expected behavior No crashing ### Actual behavior Crashes ### Regression? This worked at least with .NET 7 and I believe earlier .NET 8 previews as well. ### Known Workarounds _No response_ ### Configuration - .NET 8 Preview 7 - iOS 17 - ARM64 ### Other information _No response_
Author: Redth
Assignees: -
Labels: `area-Codegen-AOT-mono`, `os-ios`
Milestone: -
steveisok commented 1 year ago

/cc @SamMonoRT

SamMonoRT commented 1 year ago

cc @ivanpovazan @kotlarmilos

ivanpovazan commented 1 year ago

After an offline discussion, the reported issue seems to happen only in the AOT+interpreter configuration. However, it has been confirmed that the issue is not reproducible in this configuration anymore with .NET8 rc1 release.

Additionally, it was reported that for the iOS app in question, the interpreter had to be enabled (via: UseInterpreter=true) in the first place, because the app was crashing in the default - AOT only configuration with:

System.TypeInitializationException: TypeInitialization_Type, LiteDB.BsonExpression
2023-08-23 10:01:38.995 PoolMath[47619:3598848]  ---> System.ExecutionEngineException: Attempting to JIT compile method '(wrapper dynamic-method) LiteDB.BsonValue object:Thunk1ret_BsonValue_IEnumerable`1_BsonDocument_BsonValue_Collation_BsonDocument (System.Func`2<object[], object>,System.Collections.Generic.IEnumerable`1<LiteDB.BsonDocument>,LiteDB.BsonDocument,LiteDB.BsonValue,LiteDB.Collation,LiteDB.BsonDocument)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

As this failure seems to be present in .NET7 as well, I have a created separate tracking issue: https://github.com/dotnet/runtime/issues/91332 for it, where we will try to address it in .NET9 timeframe.

I would suggest that we close this issue if what was originally reported is not reproducible anymore. Do you agree @Redth ?

ivanpovazan commented 11 months ago

@Redth is this issue still reproducible?

ivanpovazan commented 10 months ago

Based on my last comments I will close this issue as it does not seem to be reproducible anymore.

@Redth please feel free to reopen it if needed.