firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.69k stars 1.49k forks source link

Completion_queue_impl crash on login & app launch #3200

Closed lukegeiger closed 5 years ago

lukegeiger commented 5 years ago

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Instant crashing on gRPC, after upgrading firebase, not sure how to best debug this one. Would appreciate some guidance!

Steps to reproduce:

I am getting an instant crash after updating firebase from 6.0.0 to 6.2.0 inside completion_queue_impl.h (gRPC) on line 178. The instant crash happens upon logging into Firebase, and then thereafter upon app launch.

Relevant Code:

This is the function in which the SIGBART Crash happens

  bool Next(void** tag, bool* ok) {
    return (AsyncNextInternal(tag, ok,
                              ::grpc::g_core_codegen_interface->gpr_inf_future(
                                  GPR_CLOCK_REALTIME)) != SHUTDOWN);
  }

I have enabled debug mode, and here is the log I receive up to the point before crashing. Also this seems to be only an issue on a real device. My simulators work fine.

2019-06-17 11:25:37.867190-0400 <AppName>[399:15819]  - <AppMeasurement>[I-ACS036002] Analytics screen reporting is enabled. Call +[FIRAnalytics setScreenName:setScreenClass:] to set the screen name or override the default screen class name. To disable screen reporting, set the flag FirebaseScreenReportingEnabled to NO (boolean) in the Info.plist
2019-06-17 11:25:38.105864-0400 <AppName>[399:15822] 6.2.0 - [Firebase/Performance][I-PRF900002] Session Id generated - 1a294db6216e4b259d6c4681a4a81f46
2019-06-17 11:25:38.108885-0400 <AppName>[399:15822] 6.2.0 - [Firebase/Core][I-COR000001] Configuring the default app.
2019-06-17 11:25:38.109246-0400 <AppName>[399:15822] 6.2.0 - [Firebase/Core][I-COR000033] Data Collection flag is not set.
2019-06-17 11:25:38.109715-0400 <AppName>[399:15824] 6.2.0 - [GULReachability][I-REA902003] Monitoring the network status
2019-06-17 11:25:38.116164-0400 <AppName>[399:15823] 6.2.0 - [Firebase/Analytics][I-ACS024000] Debug mode is on
2019-06-17 11:25:38.118780-0400 <AppName>[399:15819] 6.2.0 - [Firebase/Analytics][I-ACS005000] The AdSupport Framework is not currently linked. Some features will not function properly. Learn more at http://goo.gl/9vSsPb
2019-06-17 11:25:38.119579-0400 <AppName>[399:15819] 6.2.0 - [Firebase/Analytics][I-ACS023007] Analytics v.60001000 started
2019-06-17 11:25:38.119656-0400 <AppName>[399:15819] 6.2.0 - [Firebase/Analytics][I-ACS023008] To disable debug logging set the following application argument: -noFIRAnalyticsDebugEnabled (see http://goo.gl/RfcP7r)
2019-06-17 11:25:38.119766-0400 <AppName>[399:15819] 6.2.0 - [Firebase/Analytics][I-ACS023009] Debug logging enabled
2019-06-17 11:25:38.119853-0400 <AppName>[399:15819] 6.2.0 - [GULReachability][I-REA902003] Monitoring the network status
2019-06-17 11:25:38.121255-0400 <AppName>[399:15819] 6.2.0 - [Firebase/InAppMessagingDisplay][I-FID100010] Got notification for kFIRAppReadyToConfigureSDKNotification. Setting display component on headless SDK.
2019-06-17 11:25:38.121865-0400 <AppName>[399:15819] 6.2.0 - [Firebase/InAppMessaging][I-IAM290001] Setting a non-nil message display component
2019-06-17 11:25:38.129992-0400 <AppName>[399:15842] 6.2.0 - [GoogleUtilities/AppDelegateSwizzler][I-SWZ001008] Successfully created App Delegate Proxy automatically. To disable the proxy, set the flag GoogleUtilitiesAppDelegateProxyEnabled to NO (Boolean) in the Info.plist
2019-06-17 11:25:38.130219-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM170001] Got notification for kFIRAppReadyToConfigureSDKNotification
2019-06-17 11:25:38.130634-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM170002] Auto bootstrap Firebase in-app messaging SDK
2019-06-17 11:25:38.130919-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM170005] Not running in simulator. Use regular clearcut uploading strategy.
2019-06-17 11:25:38.131030-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM310001] Persistent file path for activity log data is /var/mobile/Containers/Data/Application/884E1D75-4B3E-480C-BED8-A0316AFD6DD3/Library/Caches/firebase-iam-activity-log-cache
2019-06-17 11:25:38.131159-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
    acct = "com.google.iid.checkin-account";
    class = genp;
    gena = "com.google.iid";
    "m_Limit" = "m_LimitAll";
    "r_Attributes" = 1;
    "r_Data" = 1;
    svce = "com.google.iid.checkin-service";
}
2019-06-17 11:25:38.131266-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM230001] Persistent file path for clearcut log records is /var/mobile/Containers/Data/Application/884E1D75-4B3E-480C-BED8-A0316AFD6DD3/Library/Caches/firebase-iam-clearcut-retry-records
2019-06-17 11:25:38.131712-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM230002] Loaded 0 clearcut log records from file in 0.001196 seconds
2019-06-17 11:25:38.133073-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM260006] Next upload attempt scheduled in 0 seconds
2019-06-17 11:25:38.133557-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM260001] FIRIAMClearcutUploader created with strategy as min wait time in seconds:300;max wait time in seconds:43200;failure backoff time in seconds:3600;batch send size:50
2019-06-17 11:25:38.133681-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM290001] SDK is in mode of Newly Installed and has seen 1 fetches.
2019-06-17 11:25:38.133746-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM230005] Returning 0 clearcut retry records from popStillValidRecords
2019-06-17 11:25:38.133933-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM260007] No clearcut records to be uploaded
2019-06-17 11:25:38.134016-0400 <AppName>[399:15842] 6.2.0 - [Firebase/InAppMessaging][I-IAM300010] Detected 0 custom URL schemes from environment
2019-06-17 11:25:38.164005-0400 <AppName>[399:15831] 6.2.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
    atag = <636f6d2e 676f6f67 6c652e69 69642d7c 4b7c>;
    class = keys;
    "r_Ref" = 1;
    type = 42;
}
2019-06-17 11:25:38.164520-0400 <AppName>[399:15824] [NetworkInfo] Could not successfully update network info for descriptor <CTServiceDescriptor 0x2836f1be0, domain=1, instance=2> during initialization.
2019-06-17 11:25:38.165890-0400 <AppName>[399:15836] 6.2.0 - [Firebase/InstanceID][I-IID023000] Info is not found in Keychain. OSStatus: -25300. Keychain query: {
    atag = <636f6d2e 676f6f67 6c652e69 69642d7c 507c>;
    class = keys;
    "r_Ref" = 1;
    type = 42;
}
2019-06-17 11:25:38.165977-0400 <AppName>[399:15824] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x2836f1c60, domain=1, instance=1>
2019-06-17 11:25:38.165990-0400 <AppName>[399:15836] 6.2.0 - [Firebase/InstanceID][I-IID009000] No keypair info is found with tag com.google.iid-|K|
2019-06-17 11:25:38.166111-0400 <AppName>[399:15836] 6.2.0 - [Firebase/InstanceID][I-IID009006] There's no legacy keypair so no need to do migration.
2019-06-17 11:25:38.166481-0400 <AppName>[399:15824] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x2836f1be0, domain=1, instance=2>
2019-06-17 11:25:38.168782-0400 <AppName>[399:15831] 6.2.0 - [Firebase/Performance][I-PRF100009] Recording trace: _p
2019-06-17 11:25:38.172509-0400 <AppName>[399:15824] 6.2.0 - [Firebase/InstanceID][I-IID014004] Invalidating cached token for 346248976049 (*) due to app version change.
2019-06-17 11:25:38.172581-0400 <AppName>[399:15824] 6.2.0 - [Firebase/InstanceID][I-IID014012] Invalidating cached token for 346248976049 (*) due to token is no longer fresh.
2019-06-17 11:25:38.172622-0400 <AppName>[399:15824] 6.2.0 - [Firebase/Messaging][I-FCM002000] FIRMessaging library version 4.0.2
2019-06-17 11:25:38.172855-0400 <AppName>[399:15831] 6.2.0 - [GULReachability][I-REA902003] Monitoring the network status
2019-06-17 11:25:38.175204-0400 <AppName>[399:15831] 6.2.0 - [Firebase/Messaging][I-FCM001000] FIRMessaging Remote Notifications proxy enabled, will swizzle remote notification receiver handlers. If you'd prefer to manually integrate Firebase Messaging, add "FirebaseAppDelegateProxyEnabled" to your Info.plist, and set it to NO. Follow the instructions at:
https://firebase.google.com/docs/cloud-messaging/ios/client#method_swizzling_in_firebase_messaging
to ensure proper integration.
2019-06-17 11:25:38.178179-0400 <AppName>[399:15742] [NetworkInfo] Could not successfully update network info for descriptor <CTServiceDescriptor 0x2836f7840, domain=1, instance=2> during initialization.
2019-06-17 11:25:38.179079-0400 <AppName>[399:15742] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x2836f78e0, domain=1, instance=1>
2019-06-17 11:25:38.179326-0400 <AppName>[399:15742] [NetworkInfo] Signal strength query returned error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied", descriptor: <CTServiceDescriptor 0x2836f7840, domain=1, instance=2>
2019-06-17 11:25:38.193525-0400 <AppName>[399:15824] 6.2.0 - [Firebase/Firestore][I-FST000001] Initializing. Current user: qPezCzVa4MUiYCD8grjKSV9NYnL2
2019-06-17 11:25:38.194137-0400 <AppName>[399:15742] [Graphics] UIColor created with component values far outside the expected range. Set a breakpoint on UIColorBreakForOutOfRangeColorComponents to debug. This message will only be logged once.
2019-06-17 11:25:38.200027-0400 <AppName>[399:15742] [Crashlytics] Version 3.13.1 (140)
2019-06-17 11:25:38.200102-0400 <AppName>[399:15742] [Crashlytics] Running on iPhone11,2, 12.3.1 (16F203)
2019-06-17 11:25:38.202346-0400 <AppName>[399:15742] [Crashlytics:Crash] Last launch failed: this may indicate a crash shortly after app launch.
2019-06-17 11:25:38.202358-0400 <AppName>[399:15841] 6.2.0 - [Firebase/Firestore][I-FST000001] Committing transaction: <LevelDbTransaction Start LevelDB: 0 changes (0 bytes):>
morganchen12 commented 5 years ago

Can you share the stack trace of the crash?

rsgowman commented 5 years ago

Hi @lukegeiger,

If you're able to, we'd still appreciate if you can share the stack trace. (A minimal project that reproduces the issue would be even better!)

However, one additional thing you could try is to downgrade from firebase 6.2.0 to 6.1.0. As you can see from our release notes (https://firebase.google.com/support/release-notes/ios) we upgraded gRPC during that interval, so it's possible that something changed in gRPC that's causing trouble. If that does fix the issue for you, then it might indicate a problem with that release of gRPC (or our usage of it).

lukegeiger commented 5 years ago

Hey guys, sorry for delay here. I actually can't reproduce the issue anymore. What I did was actually have to reset my devices settings and do then a fresh install... Upgrading path now also seems to be fine. Sorry for the confusion, after tracking down some similarly titles issues some people mentioned it could have been due to not unsubscribing from active listeners on firestore collection? Which I was doing while testing out a new feature. I'll post back again if it starts happening. Thanks for the responses though guys.