Just lately our app began logging crash stories brought on by a impasse in SQLite.
Exception Kind: EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Cause: RUNNINGBOARD 0xdead10cc
That crash happens within the iPhone/iPad model of our app. We use the system’s built-in SQLite library and open database with the next settings:
int err = sqlite3_open_v2(db_path, &db, SQLITE_OPEN_CREATE | SQLITE_OPEN_READWRITE | SQLITE_OPEN_FULLMUTEX, nil);
All crash stories point out that app freezes at some non-main thread doing the next:
Thread 2 title:
Thread 2:
0 libsystem_kernel.dylib 0x00000001ea5fcd9c pread + 8 (:-1)
1 libsqlite3.dylib 0x00000001d065a228 seekAndRead + 96 (sqlite3.c:41646)
2 libsqlite3.dylib 0x00000001d05d3078 unixRead + 208 (sqlite3.c:41738)
3 libsqlite3.dylib 0x00000001d05e5e60 readDbPage + 180 (sqlite3.c:64270)
4 libsqlite3.dylib 0x00000001d0663ca8 getPageNormal + 488 (sqlite3.c:66892)
5 libsqlite3.dylib 0x00000001d066f388 getAndInitPage + 100 (sqlite3.c:76131)
6 libsqlite3.dylib 0x00000001d06705f8 moveToLeftmost + 136 (sqlite3.c:79298)
7 libsqlite3.dylib 0x00000001d05f93b4 sqlite3VdbeExec + 5000 (sqlite3.c:102042)
8 libsqlite3.dylib 0x00000001d05f75b4 sqlite3_step + 984 (sqlite3.c:94140)
Some crash stories have this stack:
Thread 3 title:
Thread 3:
0 libsystem_kernel.dylib 0x00000001df2adc88 fsync + 8 (:-1)
1 libsqlite3.dylib 0x00000001c52c7d18 unixSync + 212 (sqlite3.c:42244)
2 libsqlite3.dylib 0x00000001c52d0560 syncJournal + 576 (sqlite3.c:65600)
3 libsqlite3.dylib 0x00000001c52c78a4 sqlite3PagerCommitPhaseOne + 392 (sqlite3.c:67879)
4 libsqlite3.dylib 0x00000001c52b871c sqlite3BtreeCommitPhaseOne + 172 (sqlite3.c:78021)
5 libsqlite3.dylib 0x00000001c52b81ec vdbeCommit + 688 (sqlite3.c:90610)
6 libsqlite3.dylib 0x00000001c5290998 sqlite3VdbeHalt + 1320 (sqlite3.c:91020)
7 libsqlite3.dylib 0x00000001c52b29b4 sqlite3VdbeExec + 43400 (sqlite3.c:99633)
8 libsqlite3.dylib 0x00000001c52a75b4 sqlite3_step + 984 (sqlite3.c:94140)
And even this:
Thread 4 title:
Thread 4:
0 libsqlite3.dylib 0x00000001eb90ef18 accessPayload + 312 (sqlite3.c:78866)
1 libsqlite3.dylib 0x00000001eb8f4634 sqlite3VdbeMemFromBtree + 200 (sqlite3.c:87070)
2 libsqlite3.dylib 0x00000001eb8e9e24 sqlite3VdbeExec + 40440 (sqlite3.c:98870)
3 libsqlite3.dylib 0x00000001eb8df5b4 sqlite3_step + 984 (sqlite3.c:94140)
These are excerpts from totally different crash logs. And these logs haven’t any different calls to SQLite lib.
Sadly, we can not reproduce the crash on debug builds and haven’t any steps to breed or by any means.
However we’re assured that the crash does not rely upon the question being executed as a result of it happens all through numerous locations within the app, performing read-only and modification queries.
Can somebody please assist us to resolve this situation or give us a clue the place to seek out the reply? Please let me know if there’s something I can add to assist examine the difficulty.
I admire any assist you’ll be able to present.