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

Crash on function invoking in a release mode (iOS), if a function was created from lambda expression #71323

Open
MariyaGordeeva opened this issue Jun 7, 2022 · 11 comments

Comments

@MariyaGordeeva
Copy link

MariyaGordeeva commented Jun 7, 2022

Description

Hello, I am developing DevExpress .NET MAUI controls, and I experienced a bug described below. It is severe for us.

Please see following project to reproduce this issue: test.zip
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

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

No response

Relevant log output

No response

@drasticactions
Copy link

Can you try running that code on a new net6.0 iOS app? (dotnet new ios)

Does it break there?

@ghost
Copy link

ghost commented Jun 7, 2022

Hi @MariyaGordeeva. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. 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.

@MariyaGordeeva
Copy link
Author

MariyaGordeeva commented Jun 7, 2022

I run our code on a new net 6.0 iOS app, and the app crashes with the same exception

TEST_IOS.zip

@ghost ghost added the s/needs-attention label Jun 7, 2022
@MariyaGordeeva MariyaGordeeva changed the title Crash on function invoking, if function was created from lambda expression in a release mode (iOS) Crash on function invoking in a release mode (iOS), if a function was created from lambda expression Jun 7, 2022
@jfversluis
Copy link
Member

@dalexsoto @rolfbjarne Since it's happening on pure iOS as well I guess this is something for you?

@rolfbjarne
Copy link
Member

Is there a stack trace / crash report? This might be either for xamarin/xamarin-macios or dotnet/runtime, depending on what's happening.

@AntonKosenkoDX
Copy link

AntonKosenkoDX commented Jun 24, 2022

@rolfbjarne Here it is:


2022-06-24 14:20:42.443 TEST_IOS[59568:4380379] System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) string <Module>:invoke_callvirt_string_object (object)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
2022-06-24 14:20:42.443 TEST_IOS[59568:4380379]    at System.Linq.Expressions.Interpreter.FuncCallInstruction`2[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, 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-06-24 14:20:42.443 TEST_IOS[59568:4380379]    at System.Linq.Expressions.Interpreter.CallInstruction.InterpretLambdaInvoke(LightLambda , Object[] )
2022-06-24 14:20:42.443 TEST_IOS[59568:4380379]    at System.Linq.Expressions.Interpreter.FuncCallInstruction`3[[System.Func`2[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(InterpretedFrame )
   at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame )
2022-06-24 14:20:42.443 TEST_IOS[59568:4380379]    at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] )
   at System.Linq.Expressions.Interpreter.CallInstruction.InterpretLambdaInvoke(LightLambda , Object[] )
2022-06-24 14:20:42.443 TEST_IOS[59568:4380379]    at System.Linq.Expressions.Interpreter.FuncCallInstruction`4[[System.Func`3[[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Boolean, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Object, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.Boolean, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Run(InterpretedFrame )
2022-06-24 14:20:42.443 TEST_IOS[59568:4380379]    at System.Linq.Expressions.Interpreter.Interpreter.Run(InterpretedFrame )
   at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] )
   at System.Dynamic.Utils.DelegateHelpers.FuncThunk1[Object[],Object](Func`2 handler, Object[] t1)
2022-06-24 14:20:42.443 TEST_IOS[59568:4380379]    at TEST_IOS.AppDelegate.EvaluateLambdableContainsFunction(Object[] args)
   at TEST_IOS.AppDelegate.FinishedLaunching(UIApplication application, NSDictionary launchOptions)

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 27, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@rolfbjarne rolfbjarne transferred this issue from dotnet/maui Jun 27, 2022
@danmoseley danmoseley added os-ios Apple iOS and removed area/upstream labels Jun 28, 2022
@ghost
Copy link

ghost commented Jun 28, 2022

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

Issue Details

Description

Hello, I am developing DevExpress .NET MAUI controls, and I experienced a bug described below. It is severe for us.

Please see following project to reproduce this issue: test.zip
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

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15

Did you find any workaround?

No response

Relevant log output

No response

Author: MariyaGordeeva
Assignees: -
Labels:

untriaged, area-VM-meta-mono, os-ios

Milestone: -

@steveisok steveisok removed the untriaged New issue has not been triaged by the area owner label Jun 30, 2022
@lambdageek lambdageek added this to the 7.0.0 milestone Jul 5, 2022
@steveisok
Copy link
Member

steveisok commented Jul 25, 2022

Likely a duplicate of #69410

To get this to work, you will have to enable the interpreter as this is not supported in full aot mode

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

@steveisok steveisok removed this from the 7.0.0 milestone Jul 25, 2022
@steveisok steveisok added this to the Future milestone Jul 25, 2022
@rolfbjarne
Copy link
Member

@steveisok the link to the duplicate is a link to this issue...

@steveisok
Copy link
Member

@steveisok the link to the duplicate is a link to this issue...

Whoops! Fixed in the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants