firebase / firebase-ios-sdk

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

Crash in FIRMutableDictonary #529

Closed jlaws closed 5 years ago

jlaws commented 6 years ago

Describe the environment

Xcode version: 9.2 Firebase (4.7.0)

Issue is in code from this POD: FirebaseCore (4.0.12)

Other Firebase PODs installed: FirebaseABTesting (1.0.0) FirebaseAnalytics (4.0.5) FirebaseAuth (4.4.0) FirebaseDatabase (4.1.2) FirebaseDynamicLinks (2.3.0) FirebaseInstanceID (2.0.7) FirebaseMessaging (2.0.7) FirebasePerformance (1.0.7) FirebaseRemoteConfig (2.1.0) FirebaseStorage (2.1.0) FirebaseSwizzlingUtilities (1.0.0)

Describe the problem

The app crashes shortly after launch on a cold start. It happens every 1/5 cold starts. No user interaction, just starting the app and seeing what happens.

Here is the crashing stack trace:

Thread 17 Queue : FIRMutableDictionary (serial)
#0  0x00000001139b627a in object_setClass ()
#1  0x00000001145e7bf1 in -[NSObject(NSObject) __dealloc_zombie] ()
#2  0x00000001139cca2e in objc_object::sidetable_release(bool) ()
#3  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#4  0x0000000116fb743c in _dispatch_client_callout ()
#5  0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#6  0x0000000116fc02df in _dispatch_queue_invoke ()
#7  0x0000000116fbc07d in _dispatch_queue_override_invoke ()
#8  0x0000000116fc31f9 in _dispatch_root_queue_drain ()
#9  0x0000000116fc2e97 in _dispatch_worker_thread3 ()
#10 0x000000011747a1ca in _pthread_wqthread ()
#11 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.root.background-qos (Thread 14) Queue : com.apple.root.background-qos (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010841c916 in -[FIRMutableDictionary removeObjectForKey:] ()
#2  0x000000010841d65b in __77-[FIRNetwork postURL:payload:queue:usingBackgroundSession:completionHandler:]_block_invoke_2 ()
#3  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#4  0x0000000116fb743c in _dispatch_client_callout ()
#5  0x0000000116fc3499 in _dispatch_root_queue_drain ()
#6  0x0000000116fc2e97 in _dispatch_worker_thread3 ()
#7  0x000000011747a1ca in _pthread_wqthread ()
#8  0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0  0x0000000116fc096b in _dispatch_root_queue_push ()
#1  0x000000010841d5b3 in __77-[FIRNetwork postURL:payload:queue:usingBackgroundSession:completionHandler:]_block_invoke ()
#2  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#3  0x0000000116fb743c in _dispatch_client_callout ()
#4  0x0000000116fc26f0 in _dispatch_main_queue_callback_4CF ()
#5  0x0000000114529ee9 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#6  0x00000001144ee592 in __CFRunLoopRun ()
#7  0x00000001144ed9b9 in CFRunLoopRunSpecific ()
#8  0x00000001181dd9c6 in GSEventRunModal ()
#9  0x000000010ff9c5e8 in UIApplicationMain ()
#10 0x0000000107d14a77 in main at /Users/joe/git/kratos/App/ClientAppDelegate.swift:18
#11 0x0000000117033d81 in start ()
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x00000001084214dd in -[FIRNetworkURLSession callCompletionHandler:withResponse:data:error:] ()
#2  0x000000010841fbce in -[FIRNetworkURLSession URLSession:task:didCompleteWithError:] ()
#3  0x00000001084f2e81 in __InstrumentURLSessionTaskDidCompleteWithError_block_invoke ()
#4  0x000000010a8c6abf in __51-[NSURLSession delegate_task:didCompleteWithError:]_block_invoke.207 ()
#5  0x000000010cbaa9b7 in __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ ()
#6  0x000000010cbaa81a in -[NSBlockOperation main] ()
#7  0x000000010cba8cd6 in -[__NSOperationInternal _start:] ()
#8  0x0000000116fb743c in _dispatch_client_callout ()
#9  0x0000000116fbcaf4 in _dispatch_block_invoke_direct ()
#10 0x0000000116fb743c in _dispatch_client_callout ()
#11 0x0000000116fbcaf4 in _dispatch_block_invoke_direct ()
#12 0x0000000116fbc884 in dispatch_block_perform ()
#13 0x000000010cba4ce4 in __NSOQSchedule_f ()
#14 0x0000000116fb743c in _dispatch_client_callout ()
#15 0x0000000116fc26f0 in _dispatch_main_queue_callback_4CF ()
#16 0x0000000114529ee9 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#17 0x00000001144ee592 in __CFRunLoopRun ()
#18 0x00000001144ed9b9 in CFRunLoopRunSpecific ()
#19 0x00000001181dd9c6 in GSEventRunModal ()
#20 0x000000010ff9c5e8 in UIApplicationMain ()
#21 0x0000000107d14a77 in main at /Users/joe/git/kratos/App/ClientAppDelegate.swift:18
#22 0x0000000117033d81 in start ()
Enqueued from com.apple.NSURLSession-work (Thread 17) Queue : com.apple.NSURLSession-work (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010cb76334 in __NSOQSchedule ()
#2  0x000000010cba462b in __addOperations ()
#3  0x000000010a76d1c3 in -[NSURLSession delegate_task:didCompleteWithError:] ()
#4  0x000000010a71144f in -[__NSCFLocalSessionTask _task_onqueue_didFinish] ()
#5  0x000000010a7110c3 in -[__NSCFLocalSessionTask connection:didFinishLoadingWithError:] ()
#6  0x000000010a71100d in __51-[__NSCFURLLocalSessionConnection _task_sendFinish]_block_invoke ()
#7  0x000000010a710f8c in -[__NSCFURLLocalSessionConnection _task_sendFinish] ()
#8  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#9  0x0000000116fb743c in _dispatch_client_callout ()
#10 0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#11 0x0000000116fc02df in _dispatch_queue_invoke ()
#12 0x0000000116fbc07d in _dispatch_queue_override_invoke ()
#13 0x0000000116fc31f9 in _dispatch_root_queue_drain ()
#14 0x0000000116fc2e97 in _dispatch_worker_thread3 ()
#15 0x000000011747a1ca in _pthread_wqthread ()
#16 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.main-thread (Thread 1) Queue : com.apple.main-thread (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010a702428 in -[__NSCFURLSessionConnection withWorkQueueAsync:] ()
#2  0x000000010a70e4a6 in -[__NSCFURLLocalSessionConnection afterDelegateWithTick:] ()
#3  0x000000010a70f58a in __48-[__NSCFURLLocalSessionConnection _tick_running]_block_invoke_2 ()
#4  0x000000010cbaa9b7 in __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ ()
#5  0x000000010cbaa81a in -[NSBlockOperation main] ()
#6  0x000000010cba8cd6 in -[__NSOperationInternal _start:] ()
#7  0x0000000116fb743c in _dispatch_client_callout ()
#8  0x0000000116fbcaf4 in _dispatch_block_invoke_direct ()
#9  0x0000000116fb743c in _dispatch_client_callout ()
#10 0x0000000116fbcaf4 in _dispatch_block_invoke_direct ()
#11 0x0000000116fbc884 in dispatch_block_perform ()
#12 0x000000010cba4ce4 in __NSOQSchedule_f ()
#13 0x0000000116fb743c in _dispatch_client_callout ()
#14 0x0000000116fc26f0 in _dispatch_main_queue_callback_4CF ()
#15 0x0000000114529ee9 in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#16 0x00000001144ee592 in __CFRunLoopRun ()
#17 0x00000001144ed9b9 in CFRunLoopRunSpecific ()
#18 0x00000001181dd9c6 in GSEventRunModal ()
#19 0x000000010ff9c5e8 in UIApplicationMain ()
#20 0x0000000107d14a77 in main at /Users/joe/git/kratos/App/ClientAppDelegate.swift:18
#21 0x0000000117033d81 in start ()
Enqueued from com.apple.NSURLSession-work (Thread 17) Queue : com.apple.NSURLSession-work (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010cb76334 in __NSOQSchedule ()
#2  0x000000010cba462b in __addOperations ()
#3  0x000000010a76d038 in -[NSURLSession delegate_dataTask:didReceiveData:completionHandler:] ()
#4  0x000000010a70f4d0 in -[__NSCFLocalSessionTask _task_onqueue_didReceiveDispatchData:completionHandler:] ()
#5  0x000000010a70f28e in -[__NSCFLocalSessionTask connection:didReceiveData:completion:] ()
#6  0x000000010a70f1ba in __48-[__NSCFURLLocalSessionConnection _tick_running]_block_invoke ()
#7  0x000000010a70f0b8 in -[__NSCFURLLocalSessionConnection _tick_running] ()
#8  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#9  0x0000000116fb743c in _dispatch_client_callout ()
#10 0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#11 0x0000000116fc02df in _dispatch_queue_invoke ()
#12 0x0000000116fc31f9 in _dispatch_root_queue_drain ()
#13 0x0000000116fc2e97 in _dispatch_worker_thread3 ()
#14 0x000000011747a1ca in _pthread_wqthread ()
#15 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 17) Queue : com.apple.NSURLSession-work (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010a702428 in -[__NSCFURLSessionConnection withWorkQueueAsync:] ()
#2  0x000000010a70e4a6 in -[__NSCFURLLocalSessionConnection afterDelegateWithTick:] ()
#3  0x000000010a70e448 in __61-[__NSCFURLLocalSessionConnection _didReceiveResponse:sniff:]_block_invoke_2 ()
#4  0x000000010a7b2c72 in __67-[__NSCFLocalSessionTask connection:didReceiveResponse:completion:]_block_invoke_2 ()
#5  0x000000010a70e229 in -[__NSCFLocalDataTask _onqueue_didReceiveResponse:completion:] ()
#6  0x000000010a7b2c2b in __67-[__NSCFLocalSessionTask connection:didReceiveResponse:completion:]_block_invoke ()
#7  0x000000010a70def2 in -[__NSCFLocalSessionTask connection:didReceiveResponse:completion:] ()
#8  0x000000010a70de1f in __61-[__NSCFURLLocalSessionConnection _didReceiveResponse:sniff:]_block_invoke ()
#9  0x000000010a70d598 in -[__NSCFURLLocalSessionConnection _didReceiveResponse:sniff:] ()
#10 0x000000010a76b630 in -[__NSCFURLLocalSessionConnection _tick_sniffNow] ()
#11 0x000000010a70ea60 in -[__NSCFURLLocalSessionConnection _didFinishWithError:] ()
#12 0x000000010a70d119 in ___ZN25SessionConnectionLoadable21withLoaderClientAsyncEU13block_pointerFvP21LoaderClientInterfaceE_block_invoke ()
#13 0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#14 0x0000000116fb743c in _dispatch_client_callout ()
#15 0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#16 0x0000000116fc02df in _dispatch_queue_invoke ()
#17 0x0000000116fc31f9 in _dispatch_root_queue_drain ()
#18 0x0000000116fc2e97 in _dispatch_worker_thread3 ()
#19 0x000000011747a1ca in _pthread_wqthread ()
#20 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.NSURLSession-work (Thread 17) Queue : com.apple.NSURLSession-work (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010a702428 in -[__NSCFURLSessionConnection withWorkQueueAsync:] ()
#2  0x000000010a70d0f6 in SessionConnectionLoadable::withLoaderClientAsync(void (LoaderClientInterface*) block_pointer) ()
#3  0x000000010a71c6c5 in URLConnectionLoader::protocolDidFinishLoading() ()
#4  0x000000010a7077d4 in ___ZNK25URLConnectionInstanceData18withWorkQueueAsyncEU13block_pointerFvvE_block_invoke ()
#5  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#6  0x0000000116fb743c in _dispatch_client_callout ()
#7  0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#8  0x0000000116fc02df in _dispatch_queue_invoke ()
#9  0x0000000116fc31f9 in _dispatch_root_queue_drain ()
#10 0x0000000116fc2e97 in _dispatch_worker_thread3 ()
#11 0x000000011747a1ca in _pthread_wqthread ()
#12 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.CFNetwork.LoaderQ (Thread 4) Queue : com.apple.CFNetwork.LoaderQ (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010a7077b9 in URLConnectionInstanceData::withWorkQueueAsync(void () block_pointer) const ()
#2  0x000000010a71bae3 in non-virtual thunk to URLConnectionLoader_Classic::protocolDidFinishLoading() ()
#3  0x000000010a75bdb1 in URLProtocol::sendDidFinishLoading() ()
#4  0x000000010a75b2c6 in HTTPProtocol::endEncountered() ()
#5  0x000000010a75983a in HTTPProtocol::handleStreamEvent(__CFHTTPMessage*, dispatch_data_s*, CFStreamError const*) ()
#6  0x000000010a74d427 in ___ZNK18QCoreSchedulingSet12performAsyncEU13block_pointerFvvE_block_invoke ()
#7  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#8  0x0000000116fb743c in _dispatch_client_callout ()
#9  0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#10 0x0000000116fc02df in _dispatch_queue_invoke ()
#11 0x0000000116fbf683 in _dispatch_queue_serial_drain ()
#12 0x0000000116fc02df in _dispatch_queue_invoke ()
#13 0x0000000116fc1316 in _dispatch_root_queue_drain_deferred_item ()
#14 0x0000000116fca5ff in _dispatch_kevent_worker_thread ()
#15 0x000000011747a057 in _pthread_wqthread ()
#16 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.CFNetwork.HTTP2.HTTP2Stream (Thread 17) Queue : com.apple.CFNetwork.HTTP2.HTTP2Stream (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010a74d3f2 in QCoreSchedulingSet::performAsync(void () block_pointer) const ()
#2  0x000000010a876832 in HTTP2Stream::_onqueue_notifyStreamClosed() ()
#3  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#4  0x0000000116fb743c in _dispatch_client_callout ()
#5  0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#6  0x0000000116fc02df in _dispatch_queue_invoke ()
#7  0x0000000116fc31f9 in _dispatch_root_queue_drain ()
#8  0x0000000116fc2e97 in _dispatch_worker_thread3 ()
#9  0x000000011747a1ca in _pthread_wqthread ()
#10 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.CFNetwork.Connection (Thread 4) Queue : com.apple.CFNetwork.Connection (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010a876a6e in HTTP2Stream::closeStreamWithErrorCode(int) ()
#2  0x000000010a7a5e43 in cf_nghttp2_on_frame_recv_callback(nghttp2_session*, nghttp2_frame const*, void*) ()
#3  0x00000001177b87d3 in nghttp2_session_on_data_received ()
#4  0x00000001177b9ffd in nghttp2_session_mem_recv ()
#5  0x00000001177baf82 in nghttp2_session_recv ()
#6  0x000000010a7fcc62 in HTTP2Connection::_onqueue_performRead() ()
#7  0x000000010a7f8b8b in HTTP2Connection::_onqueue_scheduleIO() ()
#8  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#9  0x0000000116fb743c in _dispatch_client_callout ()
#10 0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#11 0x0000000116fc02df in _dispatch_queue_invoke ()
#12 0x0000000116fbf683 in _dispatch_queue_serial_drain ()
#13 0x0000000116fc02df in _dispatch_queue_invoke ()
#14 0x0000000116fc1316 in _dispatch_root_queue_drain_deferred_item ()
#15 0x0000000116fca5ff in _dispatch_kevent_worker_thread ()
#16 0x000000011747a057 in _pthread_wqthread ()
#17 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.CFNetwork.Connection (Thread 4) Queue : com.apple.CFNetwork.Connection (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010a8aa7de in TCPIOConnection::readCompleted(unsigned long, unsigned long, dispatch_data_s*, int, void (dispatch_data_s*, CFStreamError) block_pointer) ()
#2  0x000000010a91d13b in ___ZL27ConnectionProtocolReadInnerP11nw_protocoljjbxU13block_pointerFvP15dispatch_data_s13CFStreamErrorEU13block_pointerFvP16nw_frame_array_sS3_E_block_invoke.32 ()
#3  0x0000000116fb63f7 in _dispatch_call_block_and_release ()
#4  0x0000000116fb743c in _dispatch_client_callout ()
#5  0x0000000116fbf95b in _dispatch_queue_serial_drain ()
#6  0x0000000116fc02df in _dispatch_queue_invoke ()
#7  0x0000000116fbf683 in _dispatch_queue_serial_drain ()
#8  0x0000000116fc02df in _dispatch_queue_invoke ()
#9  0x0000000116fc1316 in _dispatch_root_queue_drain_deferred_item ()
#10 0x0000000116fca5ff in _dispatch_kevent_worker_thread ()
#11 0x000000011747a057 in _pthread_wqthread ()
#12 0x0000000117479c4d in start_wqthread ()
Enqueued from com.apple.network.connections (Thread 4) Queue : com.apple.network.connections (serial)
#0  0x0000000116fc0e05 in _dispatch_queue_push ()
#1  0x000000010a91ad96 in ConnectionProtocolReadInner(nw_protocol*, unsigned int, unsigned int, bool, long long, void (dispatch_data_s*, CFStreamError) block_pointer, void (nw_frame_array_s*, CFStreamError) block_pointer) ()
#2  0x000000010a91cb1f in ___ZL36ConnectionProtocolEnqueueReadRequestP11nw_protocoljjbxU13block_pointerFvP15dispatch_data_s13CFStreamErrorEU13block_pointerFvP16nw_frame_array_sS3_E_block_invoke ()
#3  0x000000010a91a7e0 in ConnectionProtocolServiceReads(nw_protocol*) ()
#4  0x000000010a91b801 in ConnectionProtocolInputAvailable(nw_protocol*, nw_protocol*) ()
#5  0x00000001177e5107 in nw_boringssl_read ()
#6  0x00000001177e6133 in nw_protocol_boringssl_input_available ()
#7  0x00000001176c4a81 in nw_socket_update_input_source ()
#8  0x0000000116fb743c in _dispatch_client_callout ()
#9  0x0000000116fbd856 in _dispatch_continuation_pop ()
#10 0x0000000116fc89b4 in _dispatch_source_invoke ()
#11 0x0000000116fbf683 in _dispatch_queue_serial_drain ()
#12 0x0000000116fc02df in _dispatch_queue_invoke ()
#13 0x0000000116fc1316 in _dispatch_root_queue_drain_deferred_item ()
#14 0x0000000116fca5ff in _dispatch_kevent_worker_thread ()
#15 0x000000011747a057 in _pthread_wqthread ()
#16 0x0000000117479c4d in start_wqthread ()
paulb777 commented 6 years ago

Are you able to reproduce with fewer Firebase pods in use to narrow down the scope? In particular, I'm wondering if this crash is dependent upon FirebasePerformance like #486.

jlaws commented 6 years ago

I haven't seen the issue again today, so it may be dependent on receiving corrupt or incomplete data from the server. If/when it starts happening again I will remove Firebase PODs to try and isolate it. Thanks Paul!

ryanwilson commented 6 years ago

@jlaws also, if there are any non-Firebase pods in use that would be helpful too!

jlaws commented 6 years ago

Here is a list of all the pods I use:

AKNumericFormatter (0.0.2) ASValueTrackingSlider (0.12.1) AnimatedCollectionViewLayout (0.3.0) BFPaperCheckbox (2.1.0) BLKFlexibleHeightBar (1.0.2) Bolts (1.8.4) Cache (4.1.2) Charts (3.0.4) Crashlytics (3.9.3) DKImagePickerController (3.8.1) DZNSegmentedControl (1.3.3) DateTools (2.0.0) FBSDKCoreKit (4.28.0) FBSDKLoginKit (4.28.0) FBSDKShareKit (4.28.0) Fabric (1.7.2) FacebookCore (0.3.0) FacebookLogin (0.3.0) FacebookShare (0.3.0) Firebase (4.7.0) FirebaseABTesting (1.0.0) FirebaseAnalytics (4.0.5) FirebaseAuth (4.4.0) FirebaseCore (4.0.12) FirebaseDatabase (4.1.2) FirebaseDynamicLinks (2.3.0) FirebaseInstanceID (2.0.7) FirebaseMessaging (2.0.7) FirebasePerformance (1.0.7) FirebaseRemoteConfig (2.1.0) FirebaseStorage (2.1.0) FirebaseSwizzlingUtilities (1.0.0) FontAwesome.swift (1.3.2) GTMOAuth2 (1.1.5) GTMSessionFetcher (1.1.12) Gifu (2.0.0) GoogleSignIn (4.1.1) GoogleToolboxForMac (2.1.3) Hue (3.0.1) IGListKit (3.1.1) IQKeyboardManagerSwift (5.0.6) Imaginary (3.0.2) Instructions (1.1.0) Ji (2.1.0) KeychainAccess (3.1.0) Lightbox (2.1.1) MBProgressHUD (0.9.2) MDFInternationalization (1.0.3) MDFTextAccessibility (1.2.0) MaterialComponents (40.1.1) Mixpanel-swift (2.2.2) NextGrowingTextView (1.2.2) OAuthSwift (1.2.0) PPBadgeViewSwift (2.0.0) PromiseKit (4.5.0) Protobuf (3.5.0) RMActionController (1.3.1) RMDateSelectionViewController (2.3.1) RMPickerViewController (2.3.1) ReadabilityKit (0.7.1) Realm (3.0.2) RealmSwift (3.0.2) RxSwift (4.0.0) SCLAlertView (0.7.0) Siren (3.1.7) SkyFloatingLabelTextField (3.4.0) SlackTextViewController (1.9.6) StringScore (0.0.1) SwiftyStoreKit (0.11.0) Timepiece (1.3.1) TwitterCore (3.0.3) TwitterKit (3.2.2) leveldb-library (1.20) nanopb (0.3.8)

jlaws commented 6 years ago

Also, its happening again, trying to isolate it to a pod now

jlaws commented 6 years ago

It appears FirebasePerformance is the problematic pod. The problem disappears when FirebasePerformance is no longer part of my project. Luckily I don't really use any of the performance tools (yet) so I will leave it off for now.

paulb777 commented 6 years ago

@jlaws Thanks for narrowing it down!

The issue may be an duplicate of #486 which is being fixed in the next FirebasePerformance release. cc: @mikehaney24

mikehaney24 commented 6 years ago

We're not sure this is a duplicate issue (though we hope it's fixed next release). So, we're tracking this internally with b/70392677.

paulb777 commented 6 years ago

@jlaws Do you still see this with FirebasePerformance 1.1.0?

jlaws commented 6 years ago

Re-enabling the pod, will try it out for our next release and let you know

jlaws commented 6 years ago

Still causing the crash, removed the pod again

paulb777 commented 6 years ago

Thanks @jlaws! We'll investigate.

grinder81 commented 6 years ago

In my case, it's happening when I use along with AppDynamics. Doing more investigation. I'm using FirebaseAnalytics (4.0.3)

mikehaney24 commented 6 years ago

I'm showing a crash on start involving using AppDynamics with FirebaseAnalytics, stack trace looks like this:

#0  0x000000010d423642 in _object_set_associative_reference ()
#1  0x000000010c20e872 in -[UIApplication(instrumentation) ADEumInstrSetDelegate:] ()
#2  0x000000010c213341 in +[FIRAAppDelegateProxy createSubclassWithObject:] ()
#3  0x000000010c212bdb in +[FIRAAppDelegateProxy proxyOriginalDelegate:] ()
#4  0x000000010c2582ed in __38+[FIRAnalytics createAppDelegateProxy]_block_invoke ()

Do you see this anywhere in your app?

grinder81 commented 6 years ago

Yes, just disable Firebase method swizzling option, that will solve the problem.

mikehaney24 commented 6 years ago

Which option, specifically?

grinder81 commented 6 years ago

https://firebase.google.com/docs/cloud-messaging/ios/client Developers who prefer not to use swizzling can disable it by adding the flag FirebaseAppDelegateProxyEnabled in the app’s Info.plist file and setting it to NO (boolean value).

baolocdo commented 6 years ago

@mikehaney24 : The crash seems to be a different cause from FIRMutableDictionary, right? It looks like AppDynamics SDK swizzles the UIApplication class setDelegate: and causes the conflict.

mikehaney24 commented 6 years ago

Yeah, I suspect an AppDelegate swizzling conflict, and don't think it's related to FIRMutableDictionary. I have a test project that repros the issue, we can talk about it on Monday if you want!

On Sat, Feb 24, 2018 at 3:40 PM Alex Do notifications@github.com wrote:

@mikehaney24 https://github.com/mikehaney24 : The crash seems to be a different cause from FIRMutableDictionary, right? It looks like AppDynamics SDK swizzles the UIApplication class setDelegate: and causes the conflict.

— 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/529#issuecomment-368269277, or mute the thread https://github.com/notifications/unsubscribe-auth/ABCFgmxxo46jYxOidVYtvIvb6O68whACks5tYJ3WgaJpZM4Q1wJz .

baolocdo commented 6 years ago

We have created a bug internally. If it's not related to FIRMutableDictionary, we shouldn't discuss it here. We will discuss about the swizzling offline. I do think it's AppDynamics problem, not ours though if they swizzle setDelegate of UIApplication.

mikehaney24 commented 6 years ago

It looks like this crash may be rooted in AppDynamic's swizzling of setDelegate:, and I don't think we'll be able to do much about this. Does the original crash issue you were having go away if you remove AppDynamics? If so, it just might be the case that Google Analytics for Firebase and AppDynamics are incompatible at this time.

cyupa commented 6 years ago

I encountered the same issue, but after a couple of rebuilds, it "went away".

- Firebase/AdMob (5.0.1):
    - Firebase/Core
    - Google-Mobile-Ads-SDK (= 7.30.0)
  - Firebase/Core (5.0.1):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 5.0.0)
  - Firebase/CoreOnly (5.0.1):
    - FirebaseCore (= 5.0.1)
  - Firebase/Performance (5.0.1):
    - Firebase/Core
    - FirebasePerformance (= 2.0.0)
  - FirebaseAnalytics (5.0.0):
    - FirebaseCore (~> 5.0)
    - FirebaseInstanceID (~> 3.0)
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
    - nanopb (~> 0.3)
  - FirebaseAuth (5.0.0):
    - FirebaseCore (~> 5.0)
    - GTMSessionFetcher/Core (~> 1.1)
  - FirebaseCore (5.0.1):
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
  - FirebaseFirestore (0.12.1):
    - FirebaseCore (~> 5.0)
    - FirebaseFirestore/abseil-cpp (= 0.12.1)
    - gRPC-ProtoRPC (~> 1.0)
    - leveldb-library (~> 1.18)
    - Protobuf (~> 3.1)
  - FirebaseFirestore/abseil-cpp (0.12.1):
    - FirebaseCore (~> 5.0)
    - gRPC-ProtoRPC (~> 1.0)
    - leveldb-library (~> 1.18)
    - Protobuf (~> 3.1)
  - FirebaseInstanceID (3.0.0):
    - FirebaseCore (~> 5.0)
  - FirebaseMessaging (3.0.0):
    - FirebaseCore (~> 5.0)
    - FirebaseInstanceID (~> 3.0)
    - GoogleToolboxForMac/Logger (~> 2.1)
    - Protobuf (~> 3.1)
  - FirebasePerformance (2.0.0):
    - FirebaseAnalytics (~> 5.0)
    - FirebaseInstanceID (~> 3.0)
    - FirebaseSwizzlingUtilities/ISASwizzling (~> 2.0)
    - FirebaseSwizzlingUtilities/MethodSwizzling (~> 2.0)
    - GoogleToolboxForMac/Logger (~> 2.1)
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
    - GTMSessionFetcher/Core (~> 1.1)
    - Protobuf (~> 3.5)
  - FirebaseSwizzlingUtilities/ISASwizzling (2.0.0)
  - FirebaseSwizzlingUtilities/MethodSwizzling (2.0.0):
    - FirebaseCore (~> 5.0)
paulb777 commented 6 years ago

Closing due to lack of recent activity. Please reopen if still an issue.

paulb777 commented 6 years ago

@baolocdo @mikehaney24 I've seen this crash twice today in the Analytics quickstart that I just left running in the background.

The last thing in the log is

[Firebase/Performance][I-PRF100009] Recording network trace: https://app-measurement.com/a

baolocdo commented 6 years ago

Does it happen with Analytics + Perf or Analytics only? I suspect that there is some interaction with Perf that might cause the issue. I'll try to reproduce once I have some bandwidth. Thanks

paulb777 commented 6 years ago

I only see it with Analytics + Perf.

morganchen12 commented 6 years ago

note: the original stack trace in this issue is nearly identical to this stack trace.

Is this still an issue?

paulb777 commented 5 years ago

Closing for staleness.