firebase-ios-sdk: Crash in -[FIRMessagingRmq2PersistentStore openDatabase:] caused by Messaging setup

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 8.3.3
  • Firebase SDK version: 4.0.4
  • Library version: 4.0.4
  • Firebase Product: Messaging

[REQUIRED] Step 3: Describe the problem

Since the migration to Firebase SDK v4 I’m facing intermittent (2-3% DAU) EXC_BREAKPOINT crashes in [FIRMessagingRmq2PersistentStore openDatabase:]

Steps to reproduce:

Code is setup as in https://github.com/firebase/quickstart-ios/blob/master/messaging/MessagingExampleSwift/AppDelegate.swift

Running on main thread:

FirebaseApp.configure()
Messaging.messaging().delegate = self
Messaging.messaging().shouldEstablishDirectChannel = false

Relevant Code:

Relevant threads in stack trace:

#0. Crashed: com.apple.main-thread
0  MyApp                          0x1006ae45c -[FIRMessagingRmq2PersistentStore openDatabase:] + 4302365788
1  MyApp                          0x1006ad770 -[FIRMessagingRmq2PersistentStore initWithDatabaseName:] + 4302362480
2  MyApp                          0x1006b016c -[FIRMessagingRmqManager initWithDatabaseName:] + 4302373228
3  MyApp                          0x1006977a8 -[FIRMessaging setupRmqManager] + 4302272424
4  MyApp                          0x100697144 -[FIRMessaging start] + 4302270788
5  MyApp                          0x100696e28 __25+[FIRMessaging messaging]_block_invoke + 4302269992
6  libswiftCoreData.dylib         0x1806629a0 (Missing)
7  libswiftCoreData.dylib         0x1806636cc (Missing)
8  MyApp                          0x100696dac +[FIRMessaging messaging] + 4302269868
9  MyApp                          0x100696798 +[FIRMessaging(FIRApp) didReceiveConfigureSDKNotification:] + 4302268312
10 libswiftCoreData.dylib         0x1817455f4 (Missing)
11 libswiftCoreData.dylib         0x181744d08 (Missing)
12 libswiftCoreData.dylib         0x181744a84 (Missing)
13 libswiftCoreData.dylib         0x1817b37a8 (Missing)
14 libswiftCoreData.dylib         0x18168895c (Missing)
15 libswiftCoreData.dylib         0x18219b970 (Missing)
16 MyApp                          0x10066915c +[FIRApp sendNotificationsToSDKs:] + 4302082396
17 MyApp                          0x1006680fc +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 4302078204
18 MyApp                          0x100667d90 +[FIRApp configure] + 4302077328
19 MyApp                          0x1000d5944 specialized AppManager.handleFinishLaunching(application : UIApplication, launchOptions : [UIApplicationLaunchOptionsKey : Any]?) -> Bool (AppManager.swift:48)
20 MyApp                          0x1000d2018 AppManager.handleFinishLaunching(application : UIApplication, launchOptions : [UIApplicationLaunchOptionsKey : Any]?) -> Bool (AppManager.swift)
21 MyApp                          0x10038e2e8 specialized AppDelegate.application(UIApplication, didFinishLaunchingWithOptions : [UIApplicationLaunchOptionsKey : Any]?) -> Bool (AppDelegate.swift:36)
22 MyApp                          0x10038cc88 @objc AppDelegate.application(UIApplication, didFinishLaunchingWithOptions : [UIApplicationLaunchOptionsKey : Any]?) -> Bool (AppDelegate.swift)
23 UIKit                          0x18794de48 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 380
24 UIKit                          0x187b5a37c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3452
25 UIKit                          0x187b5fe24 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1684
26 UIKit                          0x187b748b0 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3147 + 48
27 UIKit                          0x187b5d0b8 -[UIApplication workspaceDidEndTransaction:] + 168
28 FrontBoardServices             0x183354884 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
29 FrontBoardServices             0x1833546f0 -[FBSSerialQueue _performNext] + 176
30 FrontBoardServices             0x183354aa0 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
31 libswiftCoreData.dylib         0x18175942c (Missing)
32 libswiftCoreData.dylib         0x181758d9c (Missing)
33 libswiftCoreData.dylib         0x1817569a8 (Missing)
34 libswiftCoreData.dylib         0x181686da4 (Missing)
35 UIKit                          0x187946fc8 -[UIApplication _run] + 652
36 UIKit                          0x187941c9c UIApplicationMain + 208
37 MyApp                          0x10038ddb8 main (AppDelegate.swift:12)
38 libswiftCoreData.dylib         0x18069559c (Missing)
#2. FIRAMonitorQueue
0  libswiftCoreData.dylib         0x1807a3e70 (Missing)
1  libswiftCoreData.dylib         0x180872070 (Missing)
2  libswiftCoreData.dylib         0x1802156dc (Missing)
3  libswiftCoreData.dylib         0x1802155cc (Missing)
4  libswiftCoreData.dylib         0x180220478 (Missing)
5  MyApp                          0x1006429f4 -[FIRAMonitor saveMonitoringDataToUserDefaultsOnMonitorQueue] + 4301924852
6  libswiftCoreData.dylib         0x1806629e0 (Missing)
7  libswiftCoreData.dylib         0x1806629a0 (Missing)
8  libswiftCoreData.dylib         0x180670ad4 (Missing)
9  libswiftCoreData.dylib         0x1806662cc (Missing)
10 libswiftCoreData.dylib         0x180672a50 (Missing)
11 libswiftCoreData.dylib         0x1806727d0 (Missing)
12 libswiftCoreData.dylib         0x18086b100 (Missing)
13 libswiftCoreData.dylib         0x18086acac (Missing)
#6. FIRAnalyticsQueue
0  MyApp                          0x100632000 -[FIRAMeasurement initWithOptions:] + 4301856768
1  MyApp                          0x100631310 __55+[FIRAMeasurement initializeSharedInstanceWithOptions:]_block_invoke + 4301853456
2  libswiftCoreData.dylib         0x1806629a0 (Missing)
3  libswiftCoreData.dylib         0x1806636cc (Missing)
4  MyApp                          0x10063127c +[FIRAMeasurement initializeSharedInstanceWithOptions:] + 4301853308
5  MyApp                          0x100648888 __47+[FIRAnalytics startWithConfiguration:options:]_block_invoke_2 + 4301949064
6  libswiftCoreData.dylib         0x1806629e0 (Missing)
7  libswiftCoreData.dylib         0x1806629a0 (Missing)
8  libswiftCoreData.dylib         0x180670ad4 (Missing)
9  libswiftCoreData.dylib         0x1806662cc (Missing)
10 libswiftCoreData.dylib         0x180672a50 (Missing)
11 libswiftCoreData.dylib         0x1806727d0 (Missing)
12 libswiftCoreData.dylib         0x18086b100 (Missing)
13 libswiftCoreData.dylib         0x18086acac (Missing)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 32 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Hi Riz, thanks for the followup.

I searched all of our available device logs for the token rmq and didn’t find it. However, this doesn’t mean it’s not there if the device is crashing before the logs have a chance to be sent to the server. So I’m afraid this is unhelpful for you.

I’m not sure how to create a public link to a specific crash session (I do see the share link for the whole issue, just not for a specific instance of the issue). However here’s a full text readout of one of the crash incidents from the downloadable text file (attached).

Thanks for your help and let me know if there’s anything else I can provide.

com.getnearly.nearly_issue_62_crash_5a3d436e87374294a266c502bf5ddaa3_3ed831fc98c311e7b8e356847afe9799_0_v2.txt

We’re not using Core Data.

On Fri, Sep 8, 2017 at 6:19 PM Riz notifications@github.com wrote:

Is anyone here using Core Data for other aspects of their app? Wondering if it’s related to this SO post: https://stackoverflow.com/questions/39335386/did-ios10-remove-the-ability-to-read-a-sqlite-database-from-the-bundle

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-ios-sdk/issues/199#issuecomment-328227036, or mute the thread https://github.com/notifications/unsubscribe-auth/AAl2Gpln0PprfM-DKIx2OwYG1DLKF8iqks5sgb1rgaJpZM4O4xwW .