I keep getting crashes when performing -mostly reads by the looks of it- from a SQLite3 database when there are a number of threads doing database stuff at the same time.
I'm using SQLite3 which is supposed to be serialized (and therefore thread safe) by default.
Unfortunately debug doesn't throw an error. The application just closes and I get an output in the application output that says where the problem lies but doesn't give any indication of what went wrong (at least that I can tell).
Also the crash can happen at any database operation. It isn't the same method each time.
Here's an example from the application output.
[mono-rt] Stacktrace:
[mono-rt]
[mono-rt] at <unknown> <0xffffffff>
[mono-rt] at (wrapper managed-to-native) SQLite.SQLite3.Prepare2 (intptr,string,int,intptr&,intptr) <IL 0x0003c, 0xffffffff>
[mono-rt] at SQLite.SQLite3.Prepare2 (intptr,string) <IL 0x0000f, 0x000a3>
[mono-rt] at SQLite.SQLiteCommand.Prepare () <IL 0x00011, 0x0008f>
[mono-rt] at SQLite.SQLiteCommand/<ExecuteDeferredQuery>d__0`1.MoveNext () <IL 0x0003f, 0x0014f>
[mono-rt] at System.Collections.Generic.List`1.AddEnumerable (System.Collections.Generic.IEnumerable`1<T>) <IL 0x0001b, 0x0018f>
[mono-rt] at System.Collections.Generic.List`1..ctor (System.Collections.Generic.IEnumerable`1<T>) <IL 0x00031, 0x0015b>
[mono-rt] at System.Linq.Enumerable.ToList<TSource> (System.Collections.Generic.IEnumerable`1<TSource>) <IL 0x00007, 0x00077>
[mono-rt] at SQLite.SQLiteCommand.ExecuteQuery<T> () <IL 0x0001c, 0x000cf>
[mono-rt] at SQLite.TableQuery`1.GetEnumerator () <IL 0x00013, 0x000a7>
[mono-rt] at System.Collections.Generic.List`1.AddEnumerable (System.Collections.Generic.IEnumerable`1<T>) <IL 0x00001, 0x00083>
[mono-rt] at System.Collections.Generic.List`1..ctor (System.Collections.Generic.IEnumerable`1<T>) <IL 0x00031, 0x0015b>
[mono-rt] at System.Linq.Enumerable.ToList<TSource> (System.Collections.Generic.IEnumerable`1<TSource>) <IL 0x00007, 0x00077>
[mono-rt] at Mobile_Time_Clock.ClockEntry/Find.ByEmployeeGUID (SQLite.SQLiteConnection,System.Guid) [0x0001a] in g:\Dropbox\Mobile Time Clock\Android Apps\Mobile Time Clock\Mobile Time Clock\Mobile Time Clock\Resources\Classes\Database\ClockEntry.cs:135
[mono-rt] at Mobile_Time_Clock.Employee.MostRecentClockEntryOnDevice (SQLite.SQLiteConnection) [0x00001] in g:\Dropbox\Mobile Time Clock\Android Apps\Mobile Time Clock\Mobile Time Clock\Mobile Time Clock\Resources\Classes\Database\Employee.cs:274
[mono-rt] at Mobile_Time_Clock.ClockEntry.Clean (SQLite.SQLiteConnection) [0x00068] in g:\Dropbox\Mobile Time Clock\Android Apps\Mobile Time Clock\Mobile Time Clock\Mobile Time Clock\Resources\Classes\Database\ClockEntry.cs:77
[mono-rt] at Mobile_Time_Clock.ClockEntry.Sync (SQLite.SQLiteConnection,System.DateTime) [0x00166] in g:\Dropbox\Mobile Time Clock\Android Apps\Mobile Time Clock\Mobile Time Clock\Mobile Time Clock\Resources\Classes\Database\ClockEntry.cs:354
[GCMBaseIntentService] Releasing Wakelock
[mono-rt] at Mobile_Time_Clock.QrScannerActivity.<ClockEmployeeInOrOut>b__8 () [0x00001] in g:\Dropbox\Mobile Time Clock\Android Apps\Mobile Time Clock\Mobile Time Clock\Mobile Time Clock\QrScannerActivity.cs:375
[mono-rt] at System.Threading.Thread.StartInternal () <IL 0x00021, 0x000e3>
[mono-rt] at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <IL 0x0004e, 0xffffffff>
[mono-rt]
[mono-rt] =================================================================
[mono-rt] Got a SIGSEGV while executing native code. This usually indicates
[mono-rt] a fatal error in the mono runtime or one of the native libraries
[mono-rt] used by your application.
[mono-rt] =================================================================
[mono-rt]