You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS: Attempting to JIT compile method '(wrapper dynamic-method) string object:lambda_method1 (System.Runtime.CompilerServices.Closure)' while running in aot-only mode. #47112
System.ExecutionEngineException: Attempting to JIT compile method '(wrapperdynamic-method)stringobject:lambda_method1 (System.Runtime.CompilerServices.Closure)' whilerunninginaot-onlymode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.at System.Delegate.CreateDelegate(Typetype,ObjectfirstArgument,MethodInfomethod,BooleanthrowOnBindFailure,BooleanallowClosed)
at System.Delegate.CreateDelegate(Typetype,ObjectfirstArgument,MethodInfomethod,BooleanthrowOnBindFailure)
at System.Delegate.CreateDelegate(Typetype,ObjectfirstArgument,MethodInfomethod)
at System.Reflection.Emit.DynamicMethod.CreateDelegate(TypedelegateType,Objecttarget)
at System.Linq.Expressions.Compiler.LambdaCompiler.CreateDelegate()
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpressionlambda)
at System.Linq.Expressions.Expression`1[[System.Func`1[[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]].Compile()
at System.Linq.EnumerableExecutor`1[[System.String,System.Private.CoreLib,Version=6.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e]].Execute()
at System.Linq.EnumerableQuery`1[[System.String,System.Private.CoreLib,Version=6.0.0.0,Culture=neutral,PublicKeyToken=7cec85d7bea7798e]].System.Linq.IQueryProvider.Execute[String](Expressionexpression)
at System.Linq.Queryable.First[String](IQueryable`1source)
at MySingleView.AppDelegate.FinishedLaunching(UIApplicationapp,NSDictionaryoptions)in/Users/rolf/work/maccore/onedotnet/xamarin-macios/tests/dotnet/MySingleView/AppDelegate.cs:line 27
Repro:
git clone https://github.com/rolfbjarne/xamarin-macios
cd xamarin-macios
git checkout dotnet-attempting-to-jit-compile-method-lamba_method1
./configure --enable-dotnet
make reset
make all -j8
make install -j8
make mysingleview -C tests/dotnet
I faced a lot of library test failures with similar error in in #50510. I have no any ios device at hand so I'll try re-enabling System.Linq.Expresions test suite in the PR and see any related CI failures.
@EgorBo What would be the right way to apply your suggestion? When trying to set <IsInterpreting>true</IsInterpreting>
I get the following error:
/Users/maxim/.nuget/packages/microsoft.dotnet.apicompat/6.0.0-beta.21321.1/build/Microsoft.DotNet.ApiCompat.targets(145,5): error : TypesMustExist : Type 'System.Linq.Expressions.ExpressionCreator<TDelegate>' does not exist in the reference but it does exist in the implementation. [/Users/maxim/dev/runtime/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj]
/Users/maxim/.nuget/packages/microsoft.dotnet.apicompat/6.0.0-beta.21321.1/build/Microsoft.DotNet.ApiCompat.targets(159,5): error : MatchingRefApiCompat failed - The reference assembly doesn't match all the APIs in the implementation for '/Users/maxim/dev/runtime/artifacts/bin/System.Linq.Expressions/net6.0-Release/System.Linq.Expressions.dll'. To address either fix errors in the reference assembly (referenced as implementation in compat errors for this reverse compat check), add the issues to the baseline file '/Users/maxim/dev/runtime/src/libraries/System.Linq.Expressions/src/MatchingRefApiCompatBaseline.txt' or disable this check by setting RunMatchingRefApiCompat=false in this project. [/Users/maxim/dev/runtime/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj]
The System.Linq.Expressions.ExpressionCreator type is not in the reference assembly.
@MaximLipnin I guess nobody tested "true" for that condition and it doesn't expose the same public APIs when it's set.
if the only error AppCompat found is
error : TypesMustExist : Type 'System.Linq.Expressions.ExpressionCreator<TDelegate>' does not exist in the reference but it does exist in the implementation. [/Users/maxim/dev/runtime/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj]
I guess nobody tested "true" for that condition and it doesn't expose the same public APIs when it's set.
if the only error AppCompat found is
Right, we had that option enabled on some configurations (I believe uap) which don't exist anymore. Nobody noticed that the API surface diverged when using the interpreter mode.
Activity
EgorBo commentedon Jan 18, 2021
I suspect
LambdaCompilershould always prefer interpretation instead of compilation on iOS.https://github.com/dotnet/runtime/blob/master/src/libraries/System.Linq.Expressions/src/System.Linq.Expressions.csproj#L6-L9
steveisok commentedon Jun 28, 2021
@MaximLipnin See if you can reproduce and give Egor's suggestion a try after.
MaximLipnin commentedon Jun 29, 2021
I faced a lot of library test failures with similar error in in #50510. I have no any ios device at hand so I'll try re-enabling System.Linq.Expresions test suite in the PR and see any related CI failures.
steveisok commentedon Jun 29, 2021
@MaximLipnin try testing against the simulator with aot enabled. You should be able to take Rolf's example and alter the functional test to repro.
MaximLipnin commentedon Jun 30, 2021
It's reproducible against the simulator when executing
@EgorBo What would be the right way to apply your suggestion? When trying to set
<IsInterpreting>true</IsInterpreting>I get the following error:
The
System.Linq.Expressions.ExpressionCreatortype is not in the reference assembly.steveisok commentedon Jun 30, 2021
@ViktorHofer Not quite sure who to ask, but would you happen to know the answer to Maxim's question?
EgorBo commentedon Jun 30, 2021
@MaximLipnin I guess nobody tested "true" for that condition and it doesn't expose the same public APIs when it's set.
if the only error AppCompat found is
that should not be difficult to fix
ViktorHofer commentedon Jun 30, 2021
Right, we had that option enabled on some configurations (I believe uap) which don't exist anymore. Nobody noticed that the API surface diverged when using the interpreter mode.
Make LambdaCompiler prefer interpretation to compilation on iOS (#54970)