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

SQLiteConnection.CreateTable() fails on iOS 15 #1070

Open
ptabatt opened this issue Sep 30, 2021 · 2 comments
Open

SQLiteConnection.CreateTable() fails on iOS 15 #1070

ptabatt opened this issue Sep 30, 2021 · 2 comments

Comments

@ptabatt
Copy link

ptabatt commented Sep 30, 2021

Steps to reproduce:

  1. Create several models with the table, primarykey, autoincrement, maxlength, unique and attributes.
  2. Call Sqllite.CreateTable() on them.
  3. Call Sqllite.CreateTable() on them again.

Expected result:
Second CreateTable() should succeed because it executes "create if not exists"

Actual result:
{System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) void :invoke_callvirt_void_LocalConfig_int (CMMSdg.Plant.MVPCapture.Core.Model.LocalConfig,int)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.

at SQLite.FastColumnSetter+<>c__DisplayClass2_02[ObjectType,ColumnMemberType].<CreateTypedSetterDelegate>b__0 (System.Object o, SQLitePCL.sqlite3_stmt stmt, System.Int32 i) [0x00023] in <01c96d411fe34bd5940c99a56515582b>:0 at SQLite.SQLiteCommand+<ExecuteDeferredQuery>d__121[T].MoveNext () [0x00218] in <01c96d411fe34bd5940c99a56515582b>:0
at System.Collections.Generic.List1[T].AddEnumerable (System.Collections.Generic.IEnumerable1[T] enumerable) [0x00059] in <218435b0f6654ac1ab0cdd176f26b9bd>:0
at System.Collections.Generic.List1[T]..ctor (System.Collections.Generic.IEnumerable1[T] collection) [0x00062] in <218435b0f6654ac1ab0cdd176f26b9bd>:0
at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x00018] in <8e6764529e4c4797b1ffdaa92a5f1151>:0 at SQLite.SQLiteCommand.ExecuteQuery[T] () [0x0001c] in <01c96d411fe34bd5940c99a56515582b>:0 at SQLite.TableQuery1[T].GetEnumerator () [0x00013] in <01c96d411fe34bd5940c99a56515582b>:0
at System.Linq.Enumerable+SelectEnumerableIterator2[TSource,TResult].ToList () [0x00006] in <8e6764529e4c4797b1ffdaa92a5f1151>:0 at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable1[T] source) [0x0001f] in <8e6764529e4c4797b1ffdaa92a5f1151>:0
at CMMSdg.Plant.MVPCapture.Core.DataAccess.SQLiteImpl.AbstractDAO`1[T].ListQuery () [0x00042] in <16561a8bce61472698ac8a6c6992bca9>:0
at CMMSdg.Plant.MVPCapture.Core.DataAccess.SQLiteImpl.LocalConfigDAOImpl.List () [0x00001] in C:\Projects\Files\MobilePlatformProd\Sln.MobilePlatform\CMMSdg.Plant.MVPCapture.Core.StdLib\DataAccess\SQLiteImpl\LocalConfigDAOImpl.cs:13
at CMMSdg.Plant.MVPCapture.Core.DataStore.DatabaseBuilder.BuildDatabase () [0x002bf] in C:\Projects\Files\MobilePlatformProd\Sln.MobilePlatform\CMMSdg.Plant.MVPCapture.Core.StdLib\DataStore\DatabaseBuilder.cs:81 }

Using sqlite-net-pcl version 1.8.116

This is just one example, I have come across, but the "Attempting to JIT compile method X while running in aot-only mode" is appearing all over the place in my project.

@matthewrdev
Copy link

I've also started to see this in an iOS app since upgrading to v1.8.116.

We've chosen to downgrade to 1.7 for the meantime.

This is the full stack trace for the error:

System.ExecutionEngineException: Attempting to JIT compile method '(wrapper delegate-invoke) void <Module>:invoke_callvirt_void_MyModel_DateTimeOffset (MyApp.Data.MyModel,System.DateTimeOffse at SQLite.FastColumnSetter+<>c__DisplayClass2_0`2[ObjectType,ColumnMemberType].<CreateTypedSetterDelegate>b__0 (System.Object)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information.
 t o, SQLitePCL.sqlite3_stmt stmt, System.Int32 i) <0x10798d5a0 + 0x00187> in <01c96d411fe34bd5940c99a56515582b#81c42bf1ea900da11161537a6968fdf4>:0 
  at SQLite.SQLiteCommand+<ExecuteDeferredQuery>d__12`1[T].MoveNext () <0x1079b7c8c + 0x0031b> in <01c96d411fe34bd5940c99a56515582b#81c42bf1ea900da11161537a6968fdf4>:0 
  at System.Collections.Generic.List`1[T].AddEnumerable (System.Collections.Generic.IEnumerable`1[T] enumerable) <0x1048eef34 + 0x000b3> in <218435b0f6654ac1ab0cdd176f26b9bd#81c42bf1ea900da11161537a6968fdf4>:0 
  at System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) <0x1048eba04 + 0x0018f> in <218435b0f6654ac1ab0cdd176f26b9bd#81c42bf1ea900da11161537a6968fdf4>:0 
  at System.Linq.Enfdaa92a5f1151#81c42bf1ea900da11161537a6968fdf4>:0 
  at SQLite.SQLiteCommand.ExecuteQuery[T] () <0x1079b62d0 + 0x0006f> in <0umerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) <0x104e004b0 + 0x0008f> in <8e6764529e4c4797b1f1c96d411fe34bd5940c99a56515582b#81c42bf1ea900da11161537a6968fdf4>:0 
  at SQLite.SQLiteConnection.Query[T] (System.String query, System.Object[] args) <0x1079acfdc + 0x00033> in <01c96d411fe34bd5940c99a56515582b#81c42bf1ea900da11161537a6968fdf4>:0 
  at SQLite.SQLiteConnection.Find[T] (System.Object pk) <0x1079ad43c + 0x0008f> in <01c96d411fe34bd5940c99a56515582b#81c42bf1etionWithLock conn) <0x1079c5370 + 0x00043> in <01c96d411fe34bd5940c99a56515582b#81c42bf1ea900da11161537a6968fdf4>:0 
  at SQLa900da11161537a6968fdf4>:0 
  at SQLite.SQLiteAsyncConnection+<>c__DisplayClass68_0`1[T].<FindAsync>b__0 (SQLite.SQLiteConnecite.SQLiteAsyncConnection+<>c__DisplayClass32_0`1[T].<ReadAsync>b__0 () <0x1079c4564 + 0x0006b> in <01c96d411fe34bd5940c99a56515582b#81c42bf1ea900da11161537a6968fdf4>:0 
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () <0x1047e934c + 0x000b7> in <218435b0f6654ac1ab0cdd176f26b9bd#81c42bf1ea900da11161537a6968fdf4>:0 
  at System.Threading.Tasks.Task.Execute () <0x1047ee524 + 0x0001f> in <218435b0f6654ac1ab0cdd176f26b9bd#81c42bf1ea900da11161537a6968fdf4>:0

In our case, the JIT'ing appears to be happening against our DateTimeOffset typed columns.

@thedee
Copy link

thedee commented Dec 18, 2021

This seems to be a similar issue as #1067.

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

No branches or pull requests

3 participants