ShakeS
Shake
Aug 3

SQLite conflicts with Firebase

We have been seeing a large amount of crashes coming through related to SQLite. Initially, I thought these were the fault of Firebase Remote Config, however, a number of issues on their GitHub repo seem to suggest this is a red herring, and is actually caused by third party SDKs that also use SQLite. As one example issue, a user has found that their crashes were solved by updating a third party library - https://github.com/firebase/firebase-ios-sdk/issues/8024#iss… There's others here from other third party SDKs - https://github.com/mParticle/mparticle-apple-sdk/issues/118 https://github.com/firebase/firebase-ios-sdk/issues/6039 I understand this is kind of vague but Shake is really the only other SDK we use (we have a pretty small number of dependencies) which could potentially cause these kinds of issues. Looks like it may be lock related - is it possible to investigate this? Crashed: com.google.fira.worker 0 libsystem_platform.dylib 0x1f694120c _os_unfair_lock_unowned_abort + 36 1 libsystem_platform.dylib 0x1f693f25c _os_unfair_lock_unlock_slow + 136 2 libsqlite3.dylib 0x1c4b48630 sqlite3_snprintf + 4268 3 libsqlite3.dylib 0x1c4b48108 sqlite3_snprintf + 2948 4 libsqlite3.dylib 0x1c4ba7cfc sqlite3_free_table + 45792 5 libsqlite3.dylib 0x1c4b9cc40 sqlite3_free_table + 548 6 libsqlite3.dylib 0x1c4b64334 sqlite3_finalize + 7488 7 libsqlite3.dylib 0x1c4b83224 sqlite3_step + 9396 8 libsqlite3.dylib 0x1c4b80e9c sqlite3_step + 300 9 Airwallex 0x1025c3910 -[APMSqliteStore executeSQLStatement:error:] + 4367038736 10 Airwallex 0x1025c3880 -[APMSqliteStore executeSQL:error:] + 4367038592 11 Airwallex 0x1025c0c5c -[APMSqliteStore ensureTableWithName:createSQL:requiredColumnNames:addOnColumns:error:] + 4367027292 12 Airwallex 0x1025bfee0 -[APMSqliteStore ensureTableWithName:elementaryColumnInfo:addOnColumnInfo:error:] + 4367023840 13 Airwallex 0x1025c07e4 -[APMSqliteStore ensureTableWithName:elementaryColumnInfo:addOnColumnInfo:modifyColumnInfo:error:] + 4367026148 14 Airwallex 0x102541e24 -[APMDatabase ensureAllTables] + 4366507556 15 Airwallex 0x1025407fc -[APMDatabase initializeDatabaseResourcesWithContext:databasePath:error:] + 4366501884 16 Airwallex 0x1025366fc -[APMDatabase initWithDatabaseName:persistedConfig:error:] + 4366460668 17 Airwallex 0x102571000 __47-[APMMeasurement startMeasurementOnWorkerQueue]_block_invoke + 4366700544 18 Airwallex 0x102570978 -[APMMeasurement startMeasurementOnWorkerQueue] + 4366698872 19 Airwallex 0x102570184 -[APMMeasurement setEnabledOnWorkerQueue:] + 4366696836 20 Airwallex 0x102570064 __29-[APMMeasurement setEnabled:]_block_invoke + 4366696548 21 Airwallex 0x1025b84f8 __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 4366992632 22 libdispatch.dylib 0x1aa9cda84 _dispatch_call_block_and_release + 32 23 libdispatch.dylib 0x1aa9cf81c _dispatch_client_callout + 20 24 libdispatch.dylib 0x1aa9d7004 _dispatch_lane_serial_drain + 620 25 libdispatch.dylib 0x1aa9d7c00 _dispatch_lane_invoke + 404 26 libdispatch.dylib 0x1aa9e24bc _dispatch_workloop_worker_thread + 764 27 libsystem_pthread.dylib 0x1f69467a4 _pthread_wqthread + 276 28 libsystem_pthread.dylib 0x1f694d74c start_wqthread + 8
CompletedCompleted

Sep 21, 2021

We've released [15.0.0](https://shakebugs.com/docs/ios/ios-releases#1500), so don't forget to upgrade and check it out :)

Sep 25, 2021

Filip Belakon: We're using Flutter, so we don't have this quite yet, but it looks great! Good job guys! :)

Aug 4, 2021

Jarrod Robins Hi Jarrod, Thank you for the detailed report. I've taken a look at the log file and the links you've posted. Not sure what causes this issue, but Shake codebase at the moment has the same lines / SQL statements that were causing the crash linked in this issue -> https://github.com/firebase/firebase-ios-sdk/issues/8024#iss… We'll try reproducing the issue, and deleting the mentioned code lines.