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

Entity Framework crashes on Xamarin iOS Device when entity contains many columns #4984

Closed
kyurkchyan opened this issue Oct 14, 2018 · 16 comments
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS
Milestone

Comments

@kyurkchyan
Copy link

Steps to Reproduce

  1. Create a Xamarin.Forms project targeting iOS
  2. Install Entity Framework Core nuget for SQLite version 2.1.4
  3. Add the following class
public class JobSetup
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public Guid ID { get; set; }
    public int? MinimumCrewSize { get; set; }
    public int? MaximumCrewSize { get; set; }
    public int? ForemenForLoadDeliver { get; set; }
    public int? ForemenForShuttle { get; set; }
    public int? ForemenForPush { get; set; }
    public int? TimeForCleanup { get; set; }
    public int? TimeForSetup { get; set; }
    public int? TimeForToFromJob { get; set; }
    public int? TimeForOriginToDest { get; set; }
    public int? TimeForMinShift { get; set; }
    public int? TimeForNormalShift { get; set; }
    public int? TimeForMaxShift { get; set; }
    public int? CubesPerHourForPush { get; set; }
    public double? AccessFactorPer100Feet { get; set; }
    public double? AccessFactorPerElevatorFloor { get; set; }
    public double? AccessFactorPerStairFlight { get; set; }
    public double? AdjBldgToBldgPush { get; set; }
    public double? AdjBldgToBldgTruck { get; set; }
    public double? AdjLoadBldgToTruck { get; set; }
    public double? AdjUnloadTruckToBldg { get; set; }
    public double? AdjSameBldgSameFloor { get; set; }
    public double? AdjSameBldgDiffFloor { get; set; }
    public double? AdjStageReplaceSameFloor { get; set; }
    public double? AdjStageReplaceDiffFloor { get; set; }
}
  1. Add the following app DB context
public class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options)
        : base(options)
    {

    }
    public DbSet<JobSetup> JobSetups { get; set; }
}
  1. Call this method in MainPage.xaml.cs
private async void Test()
{
    var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "..", "Library", "Test.db");
    if (File.Exists(path))
    {
        File.Delete(path);
    }
    DbContextOptions<AppDbContext> options = new DbContextOptionsBuilder<AppDbContext>()
                                             .UseSqlite($"Filename={path}")
                                             .Options;
    var dbContext = new AppDbContext(options);
    await dbContext.Database.EnsureCreatedAsync();
    var js = new JobSetup();
    dbContext.JobSetups.Add(js);
    await dbContext.SaveChangesAsync();
}
  1. Run the app on a iOS device. Mine is iPad Mini 2, with iOS 11.4.1
  2. Observe that application crashes at line dbContext.JobSetups.Add(js); with the following stack trace

2018-10-14 09:59:36.678 EFCoreTest.iOS[337:13033] error: * Assertion at ../../../../../mono/mini/mini-arm64.c:1818, condition `buffer_offset <= 256' not met
2018-10-14 09:59:36.679 EFCoreTest.iOS[337:13033] critical: Stacktrace:

2018-10-14 09:59:36.679 EFCoreTest.iOS[337:13033] critical:   at <unknown> <0xffffffff>
2018-10-14 09:59:36.679 EFCoreTest.iOS[337:13033] critical:   at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) <0x00007>
2018-10-14 09:59:36.681 EFCoreTest.iOS[337:13033] critical:   at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:661
2018-10-14 09:59:36.681 EFCoreTest.iOS[337:13033] critical:   at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x0007a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:652
2018-10-14 09:59:36.681 EFCoreTest.iOS[337:13033] critical:   at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:680
2018-10-14 09:59:36.681 EFCoreTest.iOS[337:13033] critical:   at System.Reflection.ConstructorInfo.Invoke (object[]) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62
2018-10-14 09:59:36.685 EFCoreTest.iOS[337:13033] critical:   at System.Linq.Expressions.Interpreter.NewInstruction.Run (System.Linq.Expressions.Interpreter.InterpretedFrame) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs:35
2018-10-14 09:59:36.685 EFCoreTest.iOS[337:13033] critical:   at System.Linq.Expressions.Interpreter.Interpreter.Run (System.Linq.Expressions.Interpreter.InterpretedFrame) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Interpreter.cs:63
2018-10-14 09:59:36.685 EFCoreTest.iOS[337:13033] critical:   at System.Linq.Expressions.Interpreter.LightLambda.Run1<T0_REF, TRet_REF> (T0_REF) [0x0001c] in <41fdc0bc3c7345aebac34baf698c1a1e#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.685 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry/OriginalValues..ctor (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry) [0x00012] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.685 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.EnsureOriginalValues () [0x0000f] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.686 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntrySubscriber.SnapshotAndSubscribe (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry) [0x00010] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.686 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry) [0x0009b] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.686 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState,Microsoft.EntityFrameworkCore.EntityState,bool) [0x00161] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.686 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState,bool,System.Nullable`1<Microsoft.EntityFrameworkCore.EntityState>) [0x00038] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.687 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction (Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode,bool) [0x0003f] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.687 EFCoreTest.iOS[337:13033] critical:   at (wrapper unknown) object.gsharedvt_out () <0x000db>
2018-10-14 09:59:36.687 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph<TState_GSHAREDVT> (Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode,TState_GSHAREDVT,System.Func`3<Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode, TState_GSHAREDVT, bool>) [0x00003] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.687 EFCoreTest.iOS[337:13033] critical:   at (wrapper unknown) object.gsharedvt_in () <0x000db>
2018-10-14 09:59:36.687 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry,Microsoft.EntityFrameworkCore.EntityState,bool) [0x00028] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.688 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.DbContext.SetEntityState (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry,Microsoft.EntityFrameworkCore.EntityState) [0x00016] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.688 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.DbContext.SetEntityState<TEntity_REF> (TEntity_REF,Microsoft.EntityFrameworkCore.EntityState) [0x0000f] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.688 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.DbContext.Add<TEntity_REF> (TEntity_REF) [0x00012] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.688 EFCoreTest.iOS[337:13033] critical:   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1<TEntity_REF>.Add (TEntity_REF) [0x00000] in <9b2250d1fb7644b98af1ab5ed79e762f#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.688 EFCoreTest.iOS[337:13033] critical:   at EFCoreTest.MainPage/<Test>d__2.MoveNext () [0x00110] in /Users/gagik/Downloads/EFCoreTest/EFCoreTest/MainPage.xaml.cs:40
2018-10-14 09:59:36.689 EFCoreTest.iOS[337:13033] critical:   at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start<TStateMachine_REF> (TStateMachine_REF&) [0x0002c] in <7d5a05cfcb09432d8cc656b9d781e54b#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.689 EFCoreTest.iOS[337:13033] critical:   at EFCoreTest.MainPage.Test () [0x0002a] in <3deb7a24ad65446fa9b18ee64ba6d37b#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.689 EFCoreTest.iOS[337:13033] critical:   at EFCoreTest.MainPage.OnAppearing () [0x00008] in /Users/gagik/Downloads/EFCoreTest/EFCoreTest/MainPage.xaml.cs:24
2018-10-14 09:59:36.691 EFCoreTest.iOS[337:13033] critical:   at Xamarin.Forms.Page.SendAppearing () [0x00024] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:316
2018-10-14 09:59:36.691 EFCoreTest.iOS[337:13033] critical:   at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidAppear (bool) [0x00025] in <02d849b2e21741169c7b5bbc798a23d0#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.691 EFCoreTest.iOS[337:13033] critical:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <7d5a05cfcb09432d8cc656b9d781e54b#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.691 EFCoreTest.iOS[337:13033] critical:   at <unknown> <0xffffffff>
2018-10-14 09:59:36.692 EFCoreTest.iOS[337:13033] critical:   at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00007>
2018-10-14 09:59:36.693 EFCoreTest.iOS[337:13033] critical:   at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:79
2018-10-14 09:59:36.693 EFCoreTest.iOS[337:13033] critical:   at UIKit.UIApplication.Main (string[],string,string) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:63
2018-10-14 09:59:36.693 EFCoreTest.iOS[337:13033] critical:   at EFCoreTest.iOS.Application.Main (string[]) [0x00001] in /Users/gagik/Downloads/EFCoreTest/EFCoreTest.iOS/Main.cs:17
2018-10-14 09:59:36.693 EFCoreTest.iOS[337:13033] critical:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <7d5a05cfcb09432d8cc656b9d781e54b#D5284A72-BBAF-2A6A-D43B-BF5066397725>:0
2018-10-14 09:59:36.693 EFCoreTest.iOS[337:13033] critical: 

Expected Behavior

dbContext.JobSetups.Add(js); should successfully add the item into the DB context

Actual Behavior

dbContext.JobSetups.Add(js); throws an exception

Environment

=== Visual Studio Community 2017 for Mac ===

Version 7.6.9 (build 22)
Installation UUID: 21f35cb0-ffca-4f2b-b96d-fc41cb3325af
Runtime:
	Mono 5.12.0.309 (2018-02/39d89a335c8) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)

	Package version: 512000309

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.1.2
	2.1.1
	2.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.302/Sdks
SDK Versions:
	2.1.302
	2.1.301
	2.1.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.12.0/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

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

=== Apple Developer Tools ===

Xcode 10.0 (14320.25)
Build 10A255

=== Xamarin.Android ===

Version: 9.0.0.20 (Visual Studio Community)
Android SDK: /Users/gagik/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)
		8.0 (API level 26)
		8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 27.0.1
SDK Build Tools Version: 28.0.0

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

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

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Xamarin.Mac ===

Version: 5.0.0.0 (Visual Studio Community)
Hash: b40230c0
Branch: 
Build date: 2018-09-27 11:41:37-0400

=== Xamarin.iOS ===

Version: 12.0.0.15 (Visual Studio Community)
Hash: 84552a46
Branch: xcode10
Build date: 2018-09-17 21:54:33-0400

=== Build Information ===

Release ID: 706090022
Git revision: 0a0ba3c4593e9adb1c6ff6324e641036146af376
Build date: 2018-10-05 16:38:51+00
Build branch: release-7.6
Xamarin extensions: f7856b13f2c03a58e08381d3a5970bba18f5c7d7

=== Operating System ===

Mac OS X 10.14.0
Darwin 18.0.0 Darwin Kernel Version 18.0.0
    Wed Aug 22 20:13:40 PDT 2018
    root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64

=== Enabled user installed extensions ===

NuGet Package Explorer 0.2
NuGet Package Management Extensions 0.12.6
Straight8's SpecFlow Intergration 1.11.0.0
Internet of Things (IoT) development (Preview) 7.5


Build Logs

https://gist.github.com/kyurkchyan/37c377f8a0545837ebd9fe7d3311ade4

Example Project (If Possible)

EFCoreTest 2.zip

@spouliot
Copy link
Contributor

Thanks for the test case. I can reproduce the issue. It appears to be a limit (or a bug) in the AOT compiler. I'll move the issue to the mono runtime team for investigation/fix.

@spouliot
Copy link
Contributor

https://github-issue-mover.appspot.com seems down right now.
c.c. @vargaz until it's moved

@spouliot spouliot added bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS labels Oct 15, 2018
@spouliot spouliot added this to the Future milestone Oct 15, 2018
vargaz added a commit to vargaz/mono that referenced this issue Oct 16, 2018
@kyurkchyan
Copy link
Author

Hey @spouliot appreciate quick response! Good that we found an issue :) Are there any plans for the fix? Cause this is a major issue for us right now and makes our app completely unusable on iOS devices.

@spouliot
Copy link
Contributor

@kyurkchyan the fix will need some time to be tested/backported to a mono that will be released inside XI. A possible workaround would be to use a class (not a struct) to minimize the nullable fields (you're going over an AOT limit), e.g. by using a string.

@vargaz
Copy link
Contributor

vargaz commented Oct 18, 2018

In this case, the workaround is to use non-nullable fields as much as possible.

@vargaz
Copy link
Contributor

vargaz commented Oct 18, 2018

Reopen until the fix is in xamarin.ios.

@akoeplinger akoeplinger reopened this Oct 19, 2018
lewurm pushed a commit to lewurm/mono that referenced this issue Oct 19, 2018
… dyncalls. (mono#11186)

* [arm64] Remove the limitation on the number of nullable arguments for dyncalls.

Fixes xamarin/xamarin-macios#4984.

* [amd64] Remove the limitation on the number of nullable arguments for dyncalls.

* [jit] Add tests for dyncalls with lots of nullable arguments.
@kyurkchyan
Copy link
Author

@vargaz @spouliot Thanks for quick responses. This same issue is present even without nullable fields. I was able to reproduce this same issue with this class

public class ConversionFactors : BaseEntity
{
   
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public Guid ID { get; set; }

    public double Dollyload { get; set; }
    public double Tallyload { get; set; }
    public double Trailerload { get; set; }
    public double HundredWeight { get; set; }
    public double Pallet { get; set; }
    public double Piece { get; set; }
    public double Rack { get; set; }
    public double Vault { get; set; }
    public double SquareFoot { get; set; }
}

The interesting thing is as soon as I make the SquareFoot nullable everything works fine for this class. The sample that I posted was an optimistic workaround I tried after discovering that making a nullable field fixes the issue. However, it didn't for that big class. The original JobSetup class doesn't have any nullable fields.

@vargaz
Copy link
Contributor

vargaz commented Oct 19, 2018

Is the error message the same with the class above ?

@kyurkchyan
Copy link
Author

So,

When using the JobSetup class I get an exception which I've already put into the initial comment - buffer_offset <= 256

With ConversionFactors I get the following exception

2018-10-19 18:49:18.729 EFCoreTest.iOS[1684:173302] error: * Assertion: should not be reached at ../../../../../mono/mini/mini-arm64-gsharedvt.c:121
2018-10-19 18:49:18.729 EFCoreTest.iOS[1684:173302] critical: Stacktrace:

2018-10-19 18:49:18.729 EFCoreTest.iOS[1684:173302] critical:   at <unknown> <0xffffffff>
2018-10-19 18:49:18.730 EFCoreTest.iOS[1684:173302] critical:   at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) <0x00007>
2018-10-19 18:49:18.730 EFCoreTest.iOS[1684:173302] critical:   at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:661
2018-10-19 18:49:18.730 EFCoreTest.iOS[1684:173302] critical:   at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x0007a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:652
2018-10-19 18:49:18.731 EFCoreTest.iOS[1684:173302] critical:   at System.Reflection.MonoCMethod.Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:680
2018-10-19 18:49:18.731 EFCoreTest.iOS[1684:173302] critical:   at System.Reflection.ConstructorInfo.Invoke (object[]) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62
2018-10-19 18:49:18.731 EFCoreTest.iOS[1684:173302] critical:   at System.Linq.Expressions.Interpreter.NewInstruction.Run (System.Linq.Expressions.Interpreter.InterpretedFrame) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/NewInstruction.cs:35
2018-10-19 18:49:18.732 EFCoreTest.iOS[1684:173302] critical:   at System.Linq.Expressions.Interpreter.Interpreter.Run (System.Linq.Expressions.Interpreter.InterpretedFrame) [0x00015] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/Interpreter.cs:63
2018-10-19 18:49:18.732 EFCoreTest.iOS[1684:173302] critical:   at System.Linq.Expressions.Interpreter.LightLambda.Run1<T0_REF, TRet_REF> (T0_REF) [0x0001c] in <41fdc0bc3c7345aebac34baf698c1a1e#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.732 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry/OriginalValues..ctor (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry) [0x00012] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.733 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.EnsureOriginalValues () [0x0000f] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.733 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntrySubscriber.SnapshotAndSubscribe (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry) [0x00010] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.733 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.StartTracking (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry) [0x0009b] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.734 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState,Microsoft.EntityFrameworkCore.EntityState,bool) [0x00161] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.734 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetEntityState (Microsoft.EntityFrameworkCore.EntityState,bool,System.Nullable`1<Microsoft.EntityFrameworkCore.EntityState>) [0x00038] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.734 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.PaintAction (Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode,bool) [0x0003f] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.735 EFCoreTest.iOS[1684:173302] critical:   at (wrapper unknown) object.gsharedvt_out () <0x000db>
2018-10-19 18:49:18.735 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityEntryGraphIterator.TraverseGraph<TState_GSHAREDVT> (Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode,TState_GSHAREDVT,System.Func`3<Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntryGraphNode, TState_GSHAREDVT, bool>) [0x00003] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.735 EFCoreTest.iOS[1684:173302] critical:   at (wrapper unknown) object.gsharedvt_in () <0x000db>
2018-10-19 18:49:18.736 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.EntityGraphAttacher.AttachGraph (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry,Microsoft.EntityFrameworkCore.EntityState,bool) [0x00028] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.736 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.DbContext.SetEntityState (Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry,Microsoft.EntityFrameworkCore.EntityState) [0x00016] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.736 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.DbContext.SetEntityState<TEntity_REF> (TEntity_REF,Microsoft.EntityFrameworkCore.EntityState) [0x0000f] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.737 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.DbContext.Add<TEntity_REF> (TEntity_REF) [0x00012] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.737 EFCoreTest.iOS[1684:173302] critical:   at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1<TEntity_REF>.Add (TEntity_REF) [0x00000] in <9b2250d1fb7644b98af1ab5ed79e762f#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.737 EFCoreTest.iOS[1684:173302] critical:   at EFCoreTest.MainPage/<Test>d__2.MoveNext () [0x0011a] in /Users/gagik/Downloads/EFCoreTest/EFCoreTest/MainPage.xaml.cs:54
2018-10-19 18:49:18.738 EFCoreTest.iOS[1684:173302] critical:   at System.Runtime.CompilerServices.AsyncVoidMethodBuilder.Start<TStateMachine_REF> (TStateMachine_REF&) [0x0002c] in <7d5a05cfcb09432d8cc656b9d781e54b#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.738 EFCoreTest.iOS[1684:173302] critical:   at EFCoreTest.MainPage.Test () [0x0002a] in <b5cfcdbba2a647b5a86a76d9231c4738#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.738 EFCoreTest.iOS[1684:173302] critical:   at EFCoreTest.MainPage.OnAppearing () [0x00008] in /Users/gagik/Downloads/EFCoreTest/EFCoreTest/MainPage.xaml.cs:25
2018-10-19 18:49:18.738 EFCoreTest.iOS[1684:173302] critical:   at Xamarin.Forms.Page.SendAppearing () [0x00024] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:316
2018-10-19 18:49:18.739 EFCoreTest.iOS[1684:173302] critical:   at Xamarin.Forms.Platform.iOS.PageRenderer.ViewDidAppear (bool) [0x00025] in <02d849b2e21741169c7b5bbc798a23d0#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.739 EFCoreTest.iOS[1684:173302] critical:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <7d5a05cfcb09432d8cc656b9d781e54b#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.739 EFCoreTest.iOS[1684:173302] critical:   at <unknown> <0xffffffff>
2018-10-19 18:49:18.740 EFCoreTest.iOS[1684:173302] critical:   at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00007>
2018-10-19 18:49:18.740 EFCoreTest.iOS[1684:173302] critical:   at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:79
2018-10-19 18:49:18.740 EFCoreTest.iOS[1684:173302] critical:   at UIKit.UIApplication.Main (string[],string,string) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:63
2018-10-19 18:49:18.740 EFCoreTest.iOS[1684:173302] critical:   at EFCoreTest.iOS.Application.Main (string[]) [0x00001] in /Users/gagik/Downloads/EFCoreTest/EFCoreTest.iOS/Main.cs:17
2018-10-19 18:49:18.741 EFCoreTest.iOS[1684:173302] critical:   at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <7d5a05cfcb09432d8cc656b9d781e54b#C0372FF3-2C91-4528-9C22-44601B8C73B4>:0
2018-10-19 18:49:18.741 EFCoreTest.iOS[1684:173302] critical: 
Native stacktrace:

As you can see this is a different type of exception. As soon as I remove the last property SquareFoot or make it nullable the ConversionFactors works just fine. I can assume that the last property is the verge of the threshold.
Another observation, If I make all of the properties of JobSetup non-nullable I will get the same type of exception as with ConversionFactors stack trace above.

I can assume we have 2 distinct exceptions

  1. One which happens with a lot of non-nullable properties.
  2. And the one which happens with lot of nullable properties.

Correct me if I'm wrong.

@vargaz
Copy link
Contributor

vargaz commented Oct 19, 2018

So thats a different bug, will look into that too.

akoeplinger pushed a commit to mono/mono that referenced this issue Oct 19, 2018
…uments for dyncalls. (#11241)

* [arm64] Remove the limitation on the number of nullable arguments for dyncalls.

Fixes xamarin/xamarin-macios#4984.

* [amd64] Remove the limitation on the number of nullable arguments for dyncalls.

* [jit] Add tests for dyncalls with lots of nullable arguments.

* fix merge conflict
akoeplinger pushed a commit to mono/mono that referenced this issue Oct 19, 2018
…uments for dyncalls. (#11240)

* [arm64] Remove the limitation on the number of nullable arguments for dyncalls.

Fixes xamarin/xamarin-macios#4984.

* [amd64] Remove the limitation on the number of nullable arguments for dyncalls.

* [jit] Add tests for dyncalls with lots of nullable arguments.

* fix merge conflict
akoeplinger pushed a commit to mono/mono that referenced this issue Oct 19, 2018
…uments for dyncalls (#11266)

* [arm64] Remove the limitation on the number of nullable arguments for dyncalls. (#11186)

* [arm64] Remove the limitation on the number of nullable arguments for dyncalls.

Fixes xamarin/xamarin-macios#4984.

* [amd64] Remove the limitation on the number of nullable arguments for dyncalls.

* [jit] Add tests for dyncalls with lots of nullable arguments.

* fix merge conflict
@spouliot
Copy link
Contributor

This keeps getting closed by other PR :(
but in this case the bump was merged (to master) so I'm not re-opening (just noting)

@kyurkchyan
Copy link
Author

@spouliot is there a way for me to track when will this get released?

@rolfbjarne rolfbjarne modified the milestones: Future, d16-0 Nov 6, 2018
@rolfbjarne
Copy link
Member

@kyurkchyan this fix will be included in our d16-0 release, which is scheduled for some time next year (probably late March/early April).

@kyurkchyan
Copy link
Author

@rolfbjarne this is a very serious issue for us, we basically can't ship EF core based app. Do you think there's a workaround for this? Otherwise we will have to spend a lot of time and resources to move the current code from EF core to something else.

@rolfbjarne
Copy link
Member

@kyurkchyan so the second issue you reported (#4984 (comment)) is not yet fixed. I've opened mono/mono#11613 to track this issue (otherwise we'll most likely lose track of it).

Unfortunately there are no official preview releases with this fix yet (first one is planned for early December), but you can try a package from our master branch if you wish (go here: https://github.com/xamarin/xamarin-macios/commits/master, click on the green checkmark for one of the top commits, and download the xamarin.ios*.pkg that shows up).

Also I don't know any workaround except tweaking the fields of your classes until the crashes go away :/ Avoid many nullable fields (which is the first bug), but there's obviously a second issue as well which is not related to nullable fields (and since it's not fixed we don't know yet what's causing it).

@kyurkchyan
Copy link
Author

@rolfbjarne thanks for the suggestions. Unfortunately the package didn't solve the issue. :( I'll have to find workarounds or switch EfCore to something else at all.

jonpryor pushed a commit to dotnet/android that referenced this issue Dec 6, 2018
Bumps to mono/api-snapshot@b99fc87c.
Bumps to mono/bockbuild@5af573e7.
Bumps to mono/boringssl@41221b45.
Bumps to mono/corefx@23d0b584.
Bumps to mono/corert@af496fc1.
Bumps to dotnet/linker@7af03ce0.
Bumps to mono/NUnitLite@00e259a4.
Bumps to mono/reference-assemblies@93258263.
Bumps to mono/roslyn-binaries@249709fa.
Bumps to mono/xunit-binaries@bb583470.

	$ git diff --shortstat b63e5378..23f2024a      # mono 
	 1630 files changed, 50926 insertions(+), 92212 deletions(-)

Fixes: mono/mono#6352
Fixes: mono/mono#6947
Fixes: mono/mono#6992
Fixes: mono/mono#7615
Fixes: mono/mono#8340
Fixes: mono/mono#8407
Fixes: mono/mono#8575
Fixes: mono/mono#8627
Fixes: mono/mono#8707
Fixes: mono/mono#8766
Fixes: mono/mono#8848
Fixes: mono/mono#8866
Fixes: mono/mono#8935
Fixes: mono/mono#9010
Fixes: mono/mono#9023
Fixes: mono/mono#9031
Fixes: mono/mono#9033
Fixes: mono/mono#9106
Fixes: mono/mono#9109
Fixes: mono/mono#9155
Fixes: mono/mono#9179
Fixes: mono/mono#9232
Fixes: mono/mono#9234
Fixes: mono/mono#9262
Fixes: mono/mono#9277
Fixes: mono/mono#9292
Fixes: mono/mono#9318
Fixes: mono/mono#9318
Fixes: mono/mono#9332
Fixes: mono/mono#9407
Fixes: mono/mono#9421
Fixes: mono/mono#9505
Fixes: mono/mono#9542
Fixes: mono/mono#9581
Fixes: mono/mono#9623
Fixes: mono/mono#9684
Fixes: mono/mono#9750
Fixes: mono/mono#9753
Fixes: mono/mono#9772
Fixes: mono/mono#9839
Fixes: mono/mono#9869
Fixes: mono/mono#9921
Fixes: mono/mono#9943
Fixes: mono/mono#9947
Fixes: mono/mono#9973
Fixes: mono/mono#9996
Fixes: mono/mono#10000
Fixes: mono/mono#10031
Fixes: mono/mono#10035
Fixes: mono/mono#10227
Fixes: mono/mono#10243
Fixes: mono/mono#10303
Fixes: mono/mono#10448
Fixes: mono/mono#10483
Fixes: mono/mono#10488
Fixes: mono/mono#10863
Fixes: mono/mono#11123
Fixes: mono/mono#11138
Fixes? mono/mono#11146
Fixes: mono/mono#11202
Fixes: mono/mono#11378
Fixes: mono/mono#11479
Fixes: mono/mono#11613
Fixes: #1951
Fixes: xamarin/xamarin-macios#4347
Fixes: xamarin/xamarin-macios#4617
Fixes: xamarin/xamarin-macios#4984
@swoolcock swoolcock mentioned this issue Dec 29, 2018
10 tasks
jonpryor pushed a commit to dotnet/android that referenced this issue Apr 24, 2019
Bumps to mono/api-snapshot@ae01378
Bumps to mono/reference-assemblies@e5173a5
Bumps to mono/bockbuild@d30329d
Bumps to mono/boringssl@3d87996
Bumps to mono/corefx@72f7d76
Bumps to mono/corert@1b7d4a1
Bumps to mono/helix-binaries@7e893ea
Bumps to mono/illinker-test-assets@f21ff68
Bumps to dotnet/linker@13d864e
Bumps to mono/llvm@1aaaaa5 [mono]
Bumps to mono/llvm@2c2cffe [xamarin-android]
Bumps to mono/NUnitLite@0029561
Bumps to mono/roslyn-binaries@0bbc9b4
Bumps to mono/xunit-binaries@8f6e62e

	$ git diff --shortstat 886c4901..e66c7667      # mono
        3597 files changed, 350850 insertions(+), 91128 deletions(-)
	$ git diff --shortstat 349752c464c5fc93b32e7d45825f2890c85c8b7d..2c2cffedf01e0fe266b9aaad2c2563e05b750ff4
	 240 files changed, 18562 insertions(+), 6581 deletions(-)

Context: https://github.com/dotnet/coreclr/issues/22046

Fixes: CVE 2018-8292 on macOS
Fixes: http://work.devdiv.io/737323
Fixes: https://github.com/dotnet/corefx/issues/33965
Fixes: dotnet/standard#642
Fixes: mono/mono#6997
Fixes: mono/mono#7326
Fixes: mono/mono#7517
Fixes: mono/mono#7750
Fixes: mono/mono#7859
Fixes: mono/mono#8360
Fixes: mono/mono#8460
Fixes: mono/mono#8766
Fixes: mono/mono#8922
Fixes: mono/mono#9418
Fixes: mono/mono#9507
Fixes: mono/mono#9951
Fixes: mono/mono#10024
Fixes: mono/mono#10030
Fixes: mono/mono#10038
Fixes: mono/mono#10448
Fixes: mono/mono#10735
Fixes: mono/mono#10735
Fixes: mono/mono#10737
Fixes: mono/mono#10743
Fixes: mono/mono#10834
Fixes: mono/mono#10837
Fixes: mono/mono#10838
Fixes: mono/mono#10863
Fixes: mono/mono#10945
Fixes: mono/mono#11020
Fixes: mono/mono#11021
Fixes: mono/mono#11021
Fixes: mono/mono#11049
Fixes: mono/mono#11091
Fixes: mono/mono#11095
Fixes: mono/mono#11123
Fixes: mono/mono#11138
Fixes: mono/mono#11146
Fixes: mono/mono#11202
Fixes: mono/mono#11214
Fixes: mono/mono#11317
Fixes: mono/mono#11326
Fixes: mono/mono#11378
Fixes: mono/mono#11385
Fixes: mono/mono#11478
Fixes: mono/mono#11479
Fixes: mono/mono#11488
Fixes: mono/mono#11489
Fixes: mono/mono#11527
Fixes: mono/mono#11529
Fixes: mono/mono#11596
Fixes: mono/mono#11603
Fixes: mono/mono#11613
Fixes: mono/mono#11623
Fixes: mono/mono#11663
Fixes: mono/mono#11681
Fixes: mono/mono#11684
Fixes: mono/mono#11693
Fixes: mono/mono#11697
Fixes: mono/mono#11779
Fixes: mono/mono#11809
Fixes: mono/mono#11858
Fixes: mono/mono#11895
Fixes: mono/mono#11898
Fixes: mono/mono#11898
Fixes: mono/mono#11965
Fixes: mono/mono#12182
Fixes: mono/mono#12193
Fixes: mono/mono#12218
Fixes: mono/mono#12235
Fixes: mono/mono#12263
Fixes: mono/mono#12307
Fixes: mono/mono#12331
Fixes: mono/mono#12362
Fixes: mono/mono#12374
Fixes: mono/mono#12402
Fixes: mono/mono#12421
Fixes: mono/mono#12461
Fixes: mono/mono#12479
Fixes: mono/mono#12479
Fixes: mono/mono#12552
Fixes: mono/mono#12603
Fixes: mono/mono#12747
Fixes: mono/mono#12831
Fixes: mono/mono#12843
Fixes: mono/mono#12881
Fixes: mono/mono#13030
Fixes: mono/mono#13284
Fixes: mono/mono#13297
Fixes: mono/mono#13455
Fixes: mono/mono#13460
Fixes: mono/mono#13478
Fixes: mono/mono#13479
Fixes: mono/mono#13522
Fixes: mono/mono#13607
Fixes: mono/mono#13610
Fixes: mono/mono#13610
Fixes: mono/mono#13639
Fixes: mono/mono#13672
Fixes: mono/mono#13834
Fixes: mono/mono#13878
Fixes: mono/mono#6352
Fixes: mono/monodevelop#6898
Fixes: xamarin/maccore#1069
Fixes: xamarin/maccore#1407
Fixes: xamarin/maccore#604
Fixes: xamarin/xamarin-macios#4984
Fixes: xamarin/xamarin-macios#5289
Fixes: xamarin/xamarin-macios#5363
Fixes: xamarin/xamarin-macios#5381
Fixes: https://issuetracker.unity3d.com/issues/editor-crashes-with-g-logv-when-entering-play-mode-with-active-flowcanvas-script
@ghost ghost locked as resolved and limited conversation to collaborators May 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix iOS Issues affecting iOS
Projects
None yet
Development

No branches or pull requests

5 participants