firebase-ios-sdk: App crashes on [APMSqliteStore executeSQLStatement:error:] with _os_unfair_lock_unowned_abort (b/171430214)
[REQUIRED] Step 1: Describe your environment
- Xcode version: 11.4.1
- Firebase SDK version: 6.23.0. Using following POD declaration pod Firebase/Crashlytics pod Firebase/Analytics
- Firebase Component: FirebaseCrashlytics FirebaseAnalytics
- Component version: FirebaseCrashlytics (4.0.0) FirebaseAnalytics (6.4.2)
- Installation method: CocoaPods
[REQUIRED] Step 2: Describe the problem
We have integrated Firebase Crashlytics in our iOS app. We are getting crashes on Firebase console which has reference to Firebase SDK. Please look at the following crash report
crashReport.txt
Steps to reproduce:
We are not able to reproduce it. We are getting it on Firebase Crashlytics console
Relevant Code:
Don’t know what causing this crash
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 33 (11 by maintainers)
We are also experiencing this crash on 7.11. It’s currently our most commonly occurring crash. 😔
@paulb777 @maksymmalyhin We ran into the same problem,We used SDK version 7.6.0
Podfile
Podfile.lock
Stack trace
Has happened hundreds of times in the app
We ran into the same issue on SDK ~v7.11~ v8.1.1 It is our number one crash. 😦
Podfile.lock
Stack trace
@taschik We were able to work around this issue though I can’t say it was easy - I found this comment https://github.com/firebase/firebase-ios-sdk/issues/8024#issuecomment-860848817 Basically, it sounds like it’s caused by a conflict with sharing SQLite amongst Firebase and other code/SDKs that don’t clean up after themselves properly.
I referred the comment to one of our third party SDK providers and they were able to make the same code change mentioned in there, and that fixed the crashes (no updates to Firebase). It sounds like Firebase being mentioned in the crash logs is actually a red herring.
So basically, I had a punt as to which third party SDKs might be using SQLite, and sent them a “hail Mary” bug report which actually worked. Sorry I don’t have a more definitive workaround.
It’s getting to the point where I’m actively looking to rip out Firebase Remote Config because of the unacceptably high crash rate.
More than 20% of customers upgraded and not a single crash so far. I am afraid there is a serious issue in 6.34.0 because with that i had 10s of crashes in a day and in random places having “APMSqliteStore” stuff in common 😦
Same problem, had to rollback also…
Crashed: com.google.fira.worker 0 libsystem_platform.dylib 0x1e9828dc0 _os_unfair_lock_unowned_abort + 36 1 libsystem_platform.dylib 0x1e9826f94 _os_unfair_lock_unlock_slow + 132 2 libsqlite3.dylib 0x1bc2064e4 sqlite3_snprintf + 4128 3 libsqlite3.dylib 0x1bc205fd8 sqlite3_snprintf + 2836 4 libsqlite3.dylib 0x1bc2673d4 sqlite3_free_table + 47776 5 libsqlite3.dylib 0x1bc2c527c sqlite3_sourceid + 86368 6 libsqlite3.dylib 0x1bc2c4c60 sqlite3_sourceid + 84804 7 libsqlite3.dylib 0x1bc269f4c sqlite3_free_table + 58904 8 libsqlite3.dylib 0x1bc248cec sqlite3_step + 35256 9 libsqlite3.dylib 0x1bc24046c sqlite3_step + 312 10 xxxx 0x10438422c -[APMSqliteStore executeSQLStatement:error:] + 4303716908 11 xxxxx 0x104382898 -[APMSqliteStore updateRecord:inTableWithName:columnName:columnValue:error:] + 4303710360 12 xxxxx 0x10434c99c -[APMDatabase updateDataType:inTableWithName:columnName:columnValue:error:] + 4303489436 13 xxxxx 0x104341158 -[APMDatabase updateDailyCounts:error:] + 4303442264 14 xxxxx 0x10435a57c __42-[APMMeasurement writeEventOnWorkerQueue:]_block_invoke.1277 + 4303545724 15 xxxxx 0x104383a60 -[APMSqliteStore performTransactionWithError:block:] + 4303714912 16 xxxxx 0x1043401a4 -[APMDatabase performTransaction:] + 4303438244 17 xxxxx 0x10435980c -[APMMeasurement writeEventOnWorkerQueue:] + 4303542284 18 xxxxx 0x104358f7c -[APMMeasurement handleEventOnWorkerQueue:] + 4303540092 19 xxxxxx 0x1043581fc __27-[APMMeasurement logEvent:]_block_invoke + 4303536636 20 xxxxx 0x10436db48 __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 4303625032 21 libdispatch.dylib 0x1a3c1d298 _dispatch_call_block_and_release + 24 22 libdispatch.dylib 0x1a3c1e280 _dispatch_client_callout + 16 23 libdispatch.dylib 0x1a3bfa4fc _dispatch_lane_serial_drain$VARIANT$armv81 + 568 24 libdispatch.dylib 0x1a3bfafe8 _dispatch_lane_invoke$VARIANT$armv81 + 404 25 libdispatch.dylib 0x1a3c04808 _dispatch_workloop_worker_thread + 692 26 libsystem_pthread.dylib 0x1e98385a4 _pthread_wqthread + 272 27 libsystem_pthread.dylib 0x1e983b874 start_wqthread + 8