Bug 61020 - Attempting to JIT compile method '(wrapper runtime-invoke) <Module>:runtime_invoke_void__this___int_long_object_Nullable`1<long>_int_Nullable`1<long>_int (object,intptr,intptr,intptr)'
Summary: Attempting to JIT compile method '(wrapper runtime-invoke) <Module>:runtime_i...
Status: RESOLVED DUPLICATE of bug 59184
Alias: None
Product: iOS
Classification: Xamarin
Component: Mono runtime / AOT compiler ()
Version: XI 11.4 (d15-5)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2017-12-07 10:40 UTC by Christophe C
Modified: 2017-12-09 10:20 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 59184

Description Christophe C 2017-12-07 10:40:04 UTC
Hello, 

I noticed a crash on my iOS devices (working on simulator) using EFCore. It seems to be a limitation of iOS. I have this crash since I add a property
on my entity object (nullable long). Here is my entity class : 

public class Card : IIdentifiable<int>
{
        public int Id { get; set; }

        public long CreationDate { get; set; }
        public long? UploadedDate { get; set; }
        public long? OrderedDate { get; set; } // crash since I had this property

        public string Message { get; set; }

        public virtual int PhotoId { get; set; }
        public virtual Photo Photo { get; set; }

        public virtual int VideoId { get; set; }
        public virtual Video Video { get; set; }
}

Here is my config: 

=== Visual Studio Enterprise 2017 for Mac ===

Version 7.3 (build 797)
Runtime:
	Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 504010007

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.0.0
	2.0.0-preview2-25407-01
	1.1.4
	1.0.7
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Versions:
	2.0.0
	2.0.0-preview2-006497
	1.1.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 8.1.0.24 (Visual Studio Enterprise)
Android SDK: /Users/Christophe/Library/Android/sdk
	Supported Android versions:
		4.1 (API level 16)
		5.1 (API level 22)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 26.0.1
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Inspector ===

Version: 1.4.0-beta1
Hash: 2e30f47
Branch: master
Build date: Tue, 14 Nov 2017 22:32:31 GMT
Client compatibility: 1

=== Apple Developer Tools ===

Xcode 9.1 (13532)
Build 9B55

=== Xamarin.iOS ===

Version: 11.4.0.214 (Visual Studio Enterprise)
Hash: c4240f3f
Branch: d15-5
Build date: 2017-11-08 17:28:18-0500

=== Xamarin.Mac ===

Version: 4.0.0.214 (Visual Studio Enterprise)

=== Build Information ===

Release ID: 703000797
Git revision: ff055b3ecaaeb4229434d0ca871c7d67c62f6388
Build date: 2017-11-30 14:34:51-05
Xamarin addins: 351fc12d4f2367490f8fc2a66b14690d825bb7f1
Build lane: monodevelop-lion-d15-5

=== Operating System ===

Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Wed Oct  4 00:17:00 PDT 2017
    root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Android Signature Tool 2.1.2
AddinMaker 1.4.1
NuGet Package Explorer 0.2
NuGet Package Management Extensions 0.12.2
Redth's Addins 1.0.9
Internet of Things (IoT) development (Preview) 7.1

============================================================

Here the crash details : 


System.ExecutionEngineException: Attempting to JIT compile method '(wrapper runtime-invoke) <Module>:runtime_invoke_void__this___int_long_object_Nullable`1<long>_int_Nullable`1<long>_int (object,intptr,intptr,intptr)' while running in aot-only mode. See https://developer.xamarin.com/guides/ios/advanced_topics/limitations/ for more information.

  at at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:661
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Exception source) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:156
  at System.Linq.Expressions.Interpreter.ExceptionHelpers.UnwrapAndRethrow (System.Reflection.TargetInvocationException exception) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Utilities.cs:172
  at System.Linq.Expressions.Interpreter.NewInstruction.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00026] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs:39
  at System.Linq.Expressions.Interpreter.Interpreter.Run (System.Linq.Expressions.Interpreter.InterpretedFrame frame) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Interpreter.cs:63
  at System.Linq.Expressions.Interpreter.LightLambda.Run1[T0,TRet] (T0 arg0) [0x0001c] in <33da90db789c4ee197ee080a10d72499>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry+OriginalValues..ctor (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x0000c] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.EnsureOriginalValues () [0x0000d] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntrySubscriber.SnapshotAndSubscribe (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x0000f] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry) [0x0008f] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState oldState, Microsoft.EntityFrameworkCore.EntityState newState, System.Boolean acceptChanges) [0x00141] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState entityState, System.Boolean acceptChanges, System.Boolean forceStateWhenUnknownKey) [0x00034] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction (Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode node) [0x00024] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph (Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode node, System.Func`2[T,TResult] handleNode) [0x00000] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry rootEntry, Microsoft.EntityFrameworkCore.EntityState entityState, System.Boolean forceStateWhenUnknownKey) [0x00020] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.DbContext.SetEntityState (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry entry, Microsoft.EntityFrameworkCore.EntityState entityState) [0x00013] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.DbContext.SetEntityStates (System.Collections.Generic.IEnumerable`1[T] entities, Microsoft.EntityFrameworkCore.EntityState entityState) [0x00024] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.DbContext.AddRange (System.Collections.Generic.IEnumerable`1[T] entities) [0x00012] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1[TEntity].AddRange (System.Collections.Generic.IEnumerable`1[T] entities) [0x00000] in <f7da5a12d702478088613d8aefc8f3d1>:0
  at Dj.Persistence.Repositories.Dj.Persistence.Repositories.Repository`1[TEntity].InsertAll (System.Collections.Generic.IEnumerable`1[T] entities) [0x00000] in <84e61dc67d12467d8c982ceea61c86ec>:0
  at Dj.Persistence.Services.EntityService`2[TEntity,TRepository].InsertAllAsync (System.Collections.Generic.IEnumerable`1[T] entities, System.Threading.CancellationToken cancellationToken) [0x00001] in <84e61dc67d12467d8c982ceea61c86ec>:0
  at Dj.Persistence.Services.EntityService`2[TEntity,TRepository].InsertAsync (TEntity entity, System.Threading.CancellationToken cancellationToken) [0x00000] in <84e61dc67d12467d8c982ceea61c86ec>:0
  at MyProject.Mobile.Client.Core.Services.CardService+<CreateEmptyAsync>d__16.MoveNext () [0x0002e] in /Users/Christophe/Documents/Projets/Xamarin/MyProject/myproject.mobile.client.core/Services/CardService.cs:63
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <1f5960abbfdf4434802d3b8a03ded4fa>:0
  at MyProject.Mobile.Client.Core.CrossControllers.Card.CardContentCrossController+<CreateCardAsync>d__24.MoveNext () [0x00039] in /Users/Christophe/Documents/Projets/Xamarin/MyProject/myproject.mobile.client.core/CrossControllers/Card/CardContentCrossController.cs:57
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:113
  at MyProject.Mobile.Client.iOS.Controllers.Card.CardContentViewController+<ViewDidLoad>d__22.MoveNext () [0x0003d] in /Users/Christophe/Documents/Projets/Xamarin/MyProject/myproject.mobile.client.ios/Controllers/Card/CardContentViewController.cs:68
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:152
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.4.0.214/src/mono/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1018
  at UIKit.UIKitSynchronizationContext+<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/5489/c4240f3f/source/xamarin-macios/src/UIKit/UIKitSynchronizationContext.cs:24
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/5489/c4240f3f/source/xamarin-macios/src/Foundation/NSAction.cs:163
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5489/c4240f3f/source/xamarin-macios/src/UIKit/UIApplication.cs:79
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5489/c4240f3f/source/xamarin-macios/src/UIKit/UIApplication.cs:63
  at MyProject.Mobile.Client.iOS.Application.Main (System.String[] args) [0x00001] in /Users/Christophe/Documents/Projets/Xamarin/MyProject/myproject.mobile.client.ios/Main.cs:17

Thank you,
Best regards.
Comment 1 Christophe C 2017-12-07 10:49:31 UTC
The only way I found for now is to make the property not nullable. But I don't like that because in reality, OrderedDate can be null.
Comment 2 Zoltan Varga 2017-12-07 17:49:32 UTC
Probably a dup of:
https://bugzilla.xamarin.com/show_bug.cgi?id=59184
Comment 3 Christophe C 2017-12-07 19:57:32 UTC
Ok ! So, it will be released on the next update as I can see ?
Right ?

Many thanks Zoltan.
Best regards,
Christophe.
Comment 4 Zoltan Varga 2017-12-07 20:07:43 UTC
It will be in future xamarin.ios release.
Comment 5 Christophe C 2017-12-07 21:07:32 UTC
Perfect ! 
I will keep you updated if it’s fixed or not.

Best regards,
Christophe.
Comment 6 Timothy Risi 2017-12-07 21:12:30 UTC
I'm going to mark this bug as a duplicate of 59184.  Feel free to re-open the bug if the fix doesn't work for you when it's released.

*** This bug has been marked as a duplicate of bug 59184 ***
Comment 7 gidanmx2 2017-12-09 10:20:40 UTC
Is there a possible date for the release of the version that solves the problem?