Skip to content

Crash on using Expression.Compile() in a release mode (iOS). #69410

Closed
@JaneySprings

Description

@JaneySprings

Description

Please see following project to reproduce this issue: https://github.com/JaneySprings/MauiReflectionBug
Same code works perfectly in Xamarin.Forms (iOS release).

Steps to Reproduce

  1. Open project folder in terminal
  2. Run 'dotnet build -t:run -f:net6.0-ios -p:_DeviceName=insert_device_id_here /p:RuntimeIdentifier=ios-arm64 -c release'

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15.4

Did you find any workaround?

no

Relevant log output

 System.ExecutionEngineException: Attempting to JIT compile method (wrapper delegate-invoke) int <Module>:invoke_callvirt_int_MyItem (reflecBug.MyItem) while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
2022-05-16 15:16:40.965 reflecBug[93626:11651593]    at System.Linq.Expressions.Interpreter.FuncCallInstruction 2[[reflecBug.MyItem, reflecBug, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(InterpretedFrame )
   at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame )
   at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] )
2022-05-16 15:16:40.965 reflecBug[93626:11651593]    at System.Dynamic.Utils.DelegateHelpers.FuncThunk1[Object,Object](Func`2 handler, Object t1)
   at reflecBug.MainPage.GetValue(Object component)
   at reflecBug.MainPage..ctor()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions