Skip to content

Firestore fails to load root certificates on 32-bit devices #2177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
agordeev opened this issue Dec 11, 2018 · 26 comments
Closed

Firestore fails to load root certificates on 32-bit devices #2177

agordeev opened this issue Dec 11, 2018 · 26 comments
Assignees

Comments

@agordeev
Copy link

agordeev commented Dec 11, 2018

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 10
  • Firebase SDK version: 5.14.0
  • Firebase Component: Unsure (Auth, Core, Database, Firestore, Messaging, Storage, etc)

[REQUIRED] Step 3: Describe the problem

I've updated Firebase from 5.11.0 to 5.14.0 using pod update. After fixing this compile issue:

error: Resource "...../Build/Products/Debug-iphonesimulator/FirebaseFirestore/gRPCCertificates-Firestore.bundle" not found. Run 'pod install' to update the copy resources script

by running pod install I finally got my project running. However, it got immediately crashed with the following error message in Console:

FIRESTORE INTERNAL ASSERTION FAILED: Could not load root certificates from the bundle. SSL cannot work. (expected path)

@lucasanovaes
Copy link

lucasanovaes commented Dec 11, 2018

I’m having the same issue, using the same Xcode and firebase SDK version.

Looking into the crash log, I noticed that only 32bit devices are being affected (iPhone 5, 5c and 4s)

I have more than 1k users affected. Any additional information, please contact me.

Edit: I’m integrating manually (not using cocoapods or carthage)

@lucasanovaes
Copy link

Take a loot at: c1c7506

This is a commit made yesterday. Probably related to it. (expected to be released with version 5.15.0)

@wilhuff
Copy link
Contributor

wilhuff commented Dec 11, 2018

@agordeev The assertion error indicates that something still isn't quite right in your build setup because the SDK can't find the resources at run-time. What version of CocoaPods are you using?

Note that at this point we know Firestore 0.15.0 and 0.16.0 are subject to a race condition on gRPC shutdown (#2138) so for the moment I'd advise that you hold off upgrading past Firestore 0.14.0 (Firebase 5.12.0) until Firestore 0.16.1 lands. However, any work you do to get your build working won't be wasted--no packaging has changed in this latest release.

@lucasanovaes Regarding the instructions in c1c7506, they apply retroactively back to Firestore 0.15.0 (Firebase 5.13.1). The upcoming Firestore 0.16.1 (Firebase 5.15.0) will continue to work with those instructions.

@lucasanovaes (part 2) I'm not aware of any differences in the product that would support 32-bit platforms differently than 64-bit. Both should work. Is it possible that you're somehow copying resources only a limited set of targets?

I'm currently working on getting a simulator setup for an iPhone 5 with iOS 10.3.1. Which versions are you using?

@wilhuff wilhuff self-assigned this Dec 11, 2018
@wilhuff
Copy link
Contributor

wilhuff commented Dec 11, 2018

FYI I'm unable to reproduce the crash on startup with a simulated iPhone 5.

I'm running Xcode 10.0, with iOS 10.3.1. I'm building with CocoaPods 1.5.3.

@agordeev
Copy link
Author

I used CocoaPods 1.5.3 and 1.6.0.beta.2. Both produce the same result

@paulb777
Copy link
Member

@agordeev Try doing pod deintegrate and deleting the xcworkspace. I've seen instances of corrupted workspaces in projects that have gone back and forth between CocoaPods 1.5.x and 1.6.x.

@agordeev
Copy link
Author

agordeev commented Dec 12, 2018

@paulb777 Thanks for your suggestion but that didn't help. After installing all the pods and cleaning/rebuilding I still get

error: Resource "...../Build/Products/Debug-iphonesimulator/FirebaseFirestore/gRPCCertificates-Firestore.bundle" not found. Run 'pod install' to update the copy resources script.

After few tries to build the project it succeeds but the app still crashes

@lucasanovaes
Copy link

@wilhuff We are having this crash on 32bit devices only on release distributions. (AppStore and Testflight).

I can't simulate this crash on debug mode using an iPhone C (32bit)

@wilhuff
Copy link
Contributor

wilhuff commented Dec 12, 2018

@lucasanovaes I'm at a loss for how to debug this further. Even after archiving an app I can see the gRPCCertificates-Firestore.bundle in the root of the .app as expected.

This is the code that loads the bundle:

https://github.com/firebase/firebase-ios-sdk/blob/master/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder_apple.mm#L37

can you see anything in there that is a 64-bit only call?

@lucasanovaes
Copy link

@wilhuff No. Apparently there is no difference.

I don't know if the Crashlytics code can help some way...but:


# Organization: XXX
# Platform: ios
# Application: XXX
# Version: 452.1 (1)
# Bundle Identifier: XXX
# Issue #: 18270
# Issue ID: 5c07c9e0f8b88c2963a11178
# Session ID: 26d929e085a74ef0800d5c5975cc870e_DNE_0_v2
# Date: 2018-12-12T16:43:00Z
# OS Version: 9.3.5 (13G36)
# Device: iPhone 4s
# RAM Free: 4.9%
# Disk Free: 8%

#10. Crashed: com.twitter.crashlytics.ios.exception
0  Easy                           0x4235a1 CLSProcessRecordAllThreads + 815876
1  Easy                           0x4235a1 CLSProcessRecordAllThreads + 815876
2  Easy                           0x423499 CLSProcessRecordAllThreads + 815612
3  Easy                           0x4168cd CLSHandler + 763440
4  Easy                           0x421e97 __CLSExceptionRecord_block_invoke + 809978
5  libdispatch.dylib              0x2163180f _dispatch_client_callout + 22
6  libdispatch.dylib              0x2163d01d _dispatch_barrier_sync_f_invoke + 56
7  Easy                           0x42188b CLSExceptionRecord + 808430
8  Easy                           0x4216b3 CLSExceptionRecordNSException + 807958
9  Easy                           0x4212b5 CLSTerminateHandler() + 806936
10 libc++abi.dylib                0x21250e17 std::__terminate(void (*)()) + 78
11 libc++abi.dylib                0x212505f5 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 110
12 libobjc.A.dylib                0x2125eeeb objc_exception_throw + 250
13 CoreFoundation                 0x21ac37f1 +[NSException raise:format:] + 102
14 Foundation                     0x222a7583 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 86
15 Easy                           0xa645db firebase::firestore::util::internal::Fail(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 749152
16 Easy                           0xa6470f firebase::firestore::util::internal::Fail(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) + 749460
17 Easy                           0xa5ff21 firebase::firestore::remote::LoadGrpcRootCertificate() + 731046
18 Easy                           0xa5df3d firebase::firestore::remote::GrpcConnection::CreateChannel() const + 722882
19 Easy                           0xa5dd0f firebase::firestore::remote::GrpcConnection::EnsureActiveStub() + 722324
20 Easy                           0xa5e797 firebase::firestore::remote::GrpcConnection::CreateStream(absl::string_view, firebase::firestore::auth::Token const&, firebase::firestore::remote::GrpcStreamObserver*) + 725020
21 Easy                           0xa789db firebase::firestore::remote::WriteStream::CreateGrpcStream(firebase::firestore::remote::GrpcConnection*, firebase::firestore::auth::Token const&) + 32932
22 Easy                           0xa731ad firebase::firestore::remote::Stream::ResumeStartWithCredentials(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&) + 10358
23 Easy                           0xa745bd std::__1::__function::__func<firebase::firestore::remote::Stream::RequestCredentials()::$_0::operator()(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&) const::'lambda'(), std::__1::allocator<firebase::firestore::remote::Stream::RequestCredentials()::$_0::operator()(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&) const::'lambda'()>, void ()>::operator()() + 15494
24 Easy                           0x9bdcd3 firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) + 66904
25 Easy                           0x9c5baf firebase::firestore::util::internal::DispatchAsync(NSObject<OS_dispatch_queue>*, std::__1::function<void ()>&&)::$_0::__invoke(void*) + 99380
26 libdispatch.dylib              0x2163e423 _dispatch_queue_drain$VARIANT$mp + 1758
27 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
28 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain + 1560
29 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3 + 96
30 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread + 1024
31 libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

--

Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x21ac391b __exceptionPreprocess
1  libobjc.A.dylib                0x2125ee17 objc_exception_throw
2  CoreFoundation                 0x21ac37f1 +[NSException raise:format:]
3  Foundation                     0x222a7583 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
4  Easy                           0xa645db firebase::firestore::util::internal::Fail(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
5  Easy                           0xa6470f firebase::firestore::util::internal::Fail(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*)
6  Easy                           0xa5ff21 firebase::firestore::remote::LoadGrpcRootCertificate()
7  Easy                           0xa5df3d firebase::firestore::remote::GrpcConnection::CreateChannel() const
8  Easy                           0xa5dd0f firebase::firestore::remote::GrpcConnection::EnsureActiveStub()
9  Easy                           0xa5e797 firebase::firestore::remote::GrpcConnection::CreateStream(absl::string_view, firebase::firestore::auth::Token const&, firebase::firestore::remote::GrpcStreamObserver*)
10 Easy                           0xa789db firebase::firestore::remote::WriteStream::CreateGrpcStream(firebase::firestore::remote::GrpcConnection*, firebase::firestore::auth::Token const&)
11 Easy                           0xa731ad firebase::firestore::remote::Stream::ResumeStartWithCredentials(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&)
12 Easy                           0xa745bd std::__1::__function::__func<firebase::firestore::remote::Stream::RequestCredentials()::$_0::operator()(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&) const::'lambda'(), std::__1::allocator<firebase::firestore::remote::Stream::RequestCredentials()::$_0::operator()(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&) const::'lambda'()>, void ()>::operator()()
13 Easy                           0x9bdcd3 firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&)
14 Easy                           0x9c5baf firebase::firestore::util::internal::DispatchAsync(NSObject<OS_dispatch_queue>*, std::__1::function<void ()>&&)::$_0::__invoke(void*)
15 libdispatch.dylib              0x2163e423 _dispatch_queue_drain$VARIANT$mp
16 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp
17 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain
18 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3
19 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread
20 libsystem_pthread.dylib        0x217f5718 start_wqthread

#0. com.apple.main-thread
0  libsystem_kernel.dylib         0x2173a920 semaphore_wait_trap + 8
1  libdispatch.dylib              0x2164294b _dispatch_semaphore_wait_slow + 190
2  libxpc.dylib                   0x21815633 xpc_connection_send_message_with_reply_sync + 178
3  Security                       0x21e59bff securityd_message_with_reply_sync + 122
4  Security                       0x21e59db9 securityd_send_sync_and_do + 48
5  Security                       0x21e69abb __SecItemCopyMatching_block_invoke_2 + 166
6  Security                       0x21e6aacd __SecItemAuthDoQuery_block_invoke + 212
7  Security                       0x21e6883b SecItemAuthDo + 218
8  Security                       0x21e693e9 SecItemAuthDoQuery + 372
9  Security                       0x21e69a11 __SecItemCopyMatching_block_invoke + 96
10 Security                       0x21e68465 SecOSStatusWith + 16
11 Security                       0x21e69985 SecItemCopyMatching + 364
12 Easy                           0x299605 +[PNKeychain searchWithQuery:fetchData:completionBlock:] (PNKeychain.m:292)
13 Easy                           0x2990cd +[PNKeychain valueForKey:withCompletionBlock:] (PNKeychain.m:211)
14 Easy                           0x2a7bd7 __46-[PNPublishSequence loadFromPersistentStorage]_block_invoke (PNPublishSequence.m:298)
15 Easy                           0x29e647 _pn_lock_async (PNLockSupport.m:121)
16 Easy                           0x2a7b5b -[PNPublishSequence loadFromPersistentStorage] (PNPublishSequence.m:299)
17 Easy                           0x2a7a57 -[PNPublishSequence initForClient:] (PNPublishSequence.m:268)
18 Easy                           0x2a780d +[PNPublishSequence sequenceForClient:] (PNPublishSequence.m:235)
19 Easy                           0x2bc959 -[PubNub initWithConfiguration:callbackQueue:] (PubNub+Core.m:278)
20 Easy                           0x2bc6fb +[PubNub clientWithConfiguration:callbackQueue:] (PubNub+Core.m:252)
21 Easy                           0x59beb -[ETPubNubManager setupPubNub] (ETPubNubManager.m:50)
22 Easy                           0x59b4b -[ETPubNubManager init] (ETPubNubManager.m:43)
23 Easy                           0x59af1 __32+[ETPubNubManager sharedManager]_block_invoke (ETPubNubManager.m:33)
24 libdispatch.dylib              0x2163180f _dispatch_client_callout + 22
25 libdispatch.dylib              0x21643173 dispatch_once_f$VARIANT$mp + 62
26 Easy                           0x59ac9 +[ETPubNubManager sharedManager] (once.h:84)
27 Easy                           0x9e0ed -[ETSubscribePubNubManager subscribeOnRideChannelAction:] (ETSubscribePubNubManager.m:40)
28 Easy                           0x10e19b ETRideManager.subscribePubnubChannels() (<compiler-generated>)
29 Easy                           0x10e5a5 @objc ETRideManager.resetCurrentRide() + 1688997
30 Easy                           0x77d35 -[ETRideViewController rideDidUpdate:withError:] (ETRideViewController.m:166)
31 Easy                           0x77cc5 __32-[ETRideViewController callTaxi]_block_invoke (ETRideViewController.m:161)
32 Easy                           0x1661e7 $SyXlSgSo7NSErrorCSgIeyByy_ypSgs5Error_pSgIegng_TR (<compiler-generated>)
33 Easy                           0x10cccd $S8EasyTaxi13ETRideManagerC18processOngoingRideyyyypSg_s5Error_pSgtcF (ETRideManager.swift:115)
34 Easy                           0x10e07d $S8EasyTaxi13ETRideManagerC9beginRide04withF7Request_ySo0cH2VOC_yypSg_s5Error_pSgtctFTo (<compiler-generated>)
35 Easy                           0x77c41 -[ETRideViewController callTaxi] (ETRideViewController.m:153)
36 Easy                           0x77adb -[ETRideViewController proceedWithRide] (ETRideViewController.m:140)
37 Easy                           0x77905 -[ETRideViewController viewDidLoad] (ETRideViewController.m:115)
38 Easy                           0x89cd7b NRMA__voidParamHandler (NRMAMethodProfiler.m:711)
39 Easy                           0x89ca3f NRMA__blk_voidParamHandler (NRMAMethodProfiler.m:692)
40 UIKit                          0x2603ed8b -[UIViewController loadViewIfRequired] + 1026
41 UIKit                          0x2603e971 -[UIViewController view] + 24
42 UIKit                          0x260fb9a5 -[UINavigationController _startTransition:fromViewController:toViewController:] + 220
43 UIKit                          0x260fb55f -[UINavigationController _startDeferredTransitionIfNeeded:] + 834
44 UIKit                          0x260fb1b5 -[UINavigationController __viewWillLayoutSubviews] + 52
45 UIKit                          0x260fb12b -[UILayoutContainerView layoutSubviews] + 214
46 UIKit                          0x2603aa73 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 714
47 QuartzCore                     0x240d2bcd -[CALayer layoutSublayers] + 128
48 QuartzCore                     0x240ce375 CA::Layer::layout_if_needed(CA::Transaction*) + 348
49 QuartzCore                     0x240ce209 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 16
50 QuartzCore                     0x240cd6d1 CA::Context::commit_transaction(CA::Transaction*) + 368
51 QuartzCore                     0x240cd3a5 CA::Transaction::commit() + 520
52 QuartzCore                     0x240c6b2b CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 138
53 CoreFoundation                 0x21a856c9 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
54 CoreFoundation                 0x21a839cd __CFRunLoopDoObservers + 280
55 CoreFoundation                 0x219d3249 CFRunLoopRunSpecific + 552
56 CoreFoundation                 0x219d3015 CFRunLoopRunInMode + 108
57 UIKit                          0x260acc3d -[UIApplication _run] + 524
58 UIKit                          0x260a7189 UIApplicationMain + 144
59 Easy                           0x696ab main (main.m:17)
60 (Missing)                      0x2167b873 (Missing)

#1. io.adjust.ActivityQueue
0  libsystem_kernel.dylib         0x2173a920 semaphore_wait_trap + 8
1  libsystem_platform.dylib       0x217ef3a5 _os_semaphore_wait + 12
2  libdispatch.dylib              0x2163cd4b _dispatch_barrier_sync_f_slow + 370
3  Easy                           0x1ac697 -[UIDevice(ADJAdditions) adjFbAttributionId] (UIDevice+ADJAdditions.m:107)
4  Easy                           0x196f35 -[ADJDeviceInfo initWithSdkPrefix:] (ADJDeviceInfo.m:39)
5  Easy                           0x196dab +[ADJDeviceInfo deviceInfoWithSdkPrefix:] (ADJDeviceInfo.m:25)
6  Easy                           0x189da1 -[ADJActivityHandler initI:preLaunchActionsArray:] (ADJActivityHandler.m:653)
7  Easy                           0x187d11 __52-[ADJActivityHandler initWithConfig:savedPreLaunch:]_block_invoke_2 (ADJActivityHandler.m:204)
8  Easy                           0x1ab317 __42+[ADJUtil launchInQueue:selfInject:block:]_block_invoke (ADJUtil.m:1266)
9  libdispatch.dylib              0x21631823 _dispatch_call_block_and_release + 10
10 libdispatch.dylib              0x2163e423 _dispatch_queue_drain$VARIANT$mp + 1758
11 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
12 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain + 1560
13 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3 + 96
14 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread + 1024
15 libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#2. com.apple.libdispatch-manager
0  libsystem_kernel.dylib         0x217502f8 kevent_qos + 24
1  libdispatch.dylib              0x21645d61 _dispatch_mgr_invoke + 256
2  libdispatch.dylib              0x21645abf _dispatch_mgr_thread$VARIANT$mp + 38

#3. Thread
0  libsystem_kernel.dylib         0x2174f864 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x217f5b35 _pthread_wqthread + 1036
2  libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#4. WebThread
0  libsystem_kernel.dylib         0x2174ea08 __psynch_mutexwait + 24
1  libsystem_pthread.dylib        0x217f9877 _pthread_mutex_lock_wait + 74
2  libsystem_pthread.dylib        0x217f99ff _pthread_mutex_lock_slow + 230
3  WebCore                        0x251a10ab _WebTryThreadLock(bool) + 98
4  WebCore                        0x251a1035 WebRunLoopLock(__CFRunLoopObserver*, unsigned long, void*) + 36
5  CoreFoundation                 0x21a856c9 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 20
6  CoreFoundation                 0x21a839cd __CFRunLoopDoObservers + 280
7  CoreFoundation                 0x21a83eff __CFRunLoopRun + 1214
8  CoreFoundation                 0x219d3229 CFRunLoopRunSpecific + 520
9  CoreFoundation                 0x219d3015 CFRunLoopRunInMode + 108
10 WebCore                        0x2519f8cf RunWebThread(void*) + 422
11 libsystem_pthread.dylib        0x217f785b _pthread_body + 138
12 libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
13 libsystem_pthread.dylib        0x217f5724 thread_start + 8

#5. com.apple.CoreLocation.ConnectionClient.0x147e4ef0.events
0  libsystem_kernel.dylib         0x2173a938 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x2164290b _dispatch_semaphore_wait_slow + 126
2  CoreLocation                   0x27a0f5e1 (null) + 664
3  CoreLocation                   0x27a153cd (null) + 1056
4  CoreLocation                   0x27a520c7 (null) + 63142
5  CoreLocation                   0x27a4fa1b (null) + 53242
6  CoreLocation                   0x27a4f901 (null) + 52960
7  CoreLocation                   0x27a50d53 (null) + 58162
8  libxpc.dylib                   0x218146b9 _xpc_connection_call_event_handler + 40
9  libxpc.dylib                   0x21812c2f _xpc_connection_mach_event + 1698
10 libdispatch.dylib              0x21647087 _dispatch_mach_msg_invoke$VARIANT$mp + 514
11 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
12 libdispatch.dylib              0x21647633 _dispatch_mach_invoke$VARIANT$mp + 410
13 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
14 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
15 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
16 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
17 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain + 1560
18 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3 + 96
19 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread + 1024
20 libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#6. com.google.firebase.firestore.rpc
0  libsystem_kernel.dylib         0x2173de94 poll + 8
1  Easy                           0x97880d pollset_work(grpc_pollset*, grpc_pollset_worker**, long long) + 42318
2  Easy                           0x97a567 pollset_work(grpc_pollset*, grpc_pollset_worker**, long long) + 49832
3  Easy                           0x97234b cq_next(grpc_completion_queue*, gpr_timespec, void*) + 16524
4  Easy                           0x971a9b grpc_completion_queue_next + 14300
5  Easy                           0x9b9531 grpc::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec) + 48566
6  Easy                           0x9b8845 grpc::CompletionQueue::Next(void**, bool*) + 45258
7  Easy                           0x9c077b firebase::firestore::remote::Datastore::PollGrpcQueue() + 77824
8  Easy                           0x9c5baf firebase::firestore::util::internal::DispatchAsync(NSObject<OS_dispatch_queue>*, std::__1::function<void ()>&&)::$_0::__invoke(void*) + 99380
9  libdispatch.dylib              0x2163e423 _dispatch_queue_drain$VARIANT$mp + 1758
10 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
11 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain + 1560
12 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3 + 96
13 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread + 1024
14 libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#7. com.apple.CoreLocation.ConnectionClient.0x14704c70.events
0  libsystem_kernel.dylib         0x2173a938 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x2164290b _dispatch_semaphore_wait_slow + 126
2  CoreLocation                   0x27a0f5e1 (null) + 664
3  CoreLocation                   0x27a153cd (null) + 1056
4  CoreLocation                   0x27a520c7 (null) + 63142
5  CoreLocation                   0x27a4fa1b (null) + 53242
6  CoreLocation                   0x27a4f901 (null) + 52960
7  CoreLocation                   0x27a50d53 (null) + 58162
8  libxpc.dylib                   0x218146b9 _xpc_connection_call_event_handler + 40
9  libxpc.dylib                   0x21812c2f _xpc_connection_mach_event + 1698
10 libdispatch.dylib              0x21647087 _dispatch_mach_msg_invoke$VARIANT$mp + 514
11 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
12 libdispatch.dylib              0x21647633 _dispatch_mach_invoke$VARIANT$mp + 410
13 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
14 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
15 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
16 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
17 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain + 1560
18 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3 + 96
19 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread + 1024
20 libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#8. Thread
0  libsystem_kernel.dylib         0x2174f864 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x217f5b35 _pthread_wqthread + 1036
2  libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#9. com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0x2173a8d0 mach_msg_trap + 20
1  libsystem_kernel.dylib         0x2173a6d5 mach_msg + 40
2  CoreFoundation                 0x21a85ac5 __CFRunLoopServiceMachPort + 136
3  CoreFoundation                 0x21a83e4d __CFRunLoopRun + 1036
4  CoreFoundation                 0x219d3229 CFRunLoopRunSpecific + 520
5  CoreFoundation                 0x219d3015 CFRunLoopRunInMode + 108
6  CFNetwork                      0x220249f7 +[NSURLConnection(Loader) _resourceLoadLoop:] + 486
7  Foundation                     0x222ed4a5 __NSThread__start__ + 1148
8  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
9  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
10 libsystem_pthread.dylib        0x217f5724 thread_start + 8

#10. Crashed: com.twitter.crashlytics.ios.exception
0  Easy                           0x4235a1 CLSProcessRecordAllThreads + 815876
1  Easy                           0x4235a1 CLSProcessRecordAllThreads + 815876
2  Easy                           0x423499 CLSProcessRecordAllThreads + 815612
3  Easy                           0x4168cd CLSHandler + 763440
4  Easy                           0x421e97 __CLSExceptionRecord_block_invoke + 809978
5  libdispatch.dylib              0x2163180f _dispatch_client_callout + 22
6  libdispatch.dylib              0x2163d01d _dispatch_barrier_sync_f_invoke + 56
7  Easy                           0x42188b CLSExceptionRecord + 808430
8  Easy                           0x4216b3 CLSExceptionRecordNSException + 807958
9  Easy                           0x4212b5 CLSTerminateHandler() + 806936
10 libc++abi.dylib                0x21250e17 std::__terminate(void (*)()) + 78
11 libc++abi.dylib                0x212505f5 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*) + 110
12 libobjc.A.dylib                0x2125eeeb objc_exception_throw + 250
13 CoreFoundation                 0x21ac37f1 +[NSException raise:format:] + 102
14 Foundation                     0x222a7583 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 86
15 Easy                           0xa645db firebase::firestore::util::internal::Fail(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) + 749152
16 Easy                           0xa6470f firebase::firestore::util::internal::Fail(char const*, char const*, int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*) + 749460
17 Easy                           0xa5ff21 firebase::firestore::remote::LoadGrpcRootCertificate() + 731046
18 Easy                           0xa5df3d firebase::firestore::remote::GrpcConnection::CreateChannel() const + 722882
19 Easy                           0xa5dd0f firebase::firestore::remote::GrpcConnection::EnsureActiveStub() + 722324
20 Easy                           0xa5e797 firebase::firestore::remote::GrpcConnection::CreateStream(absl::string_view, firebase::firestore::auth::Token const&, firebase::firestore::remote::GrpcStreamObserver*) + 725020
21 Easy                           0xa789db firebase::firestore::remote::WriteStream::CreateGrpcStream(firebase::firestore::remote::GrpcConnection*, firebase::firestore::auth::Token const&) + 32932
22 Easy                           0xa731ad firebase::firestore::remote::Stream::ResumeStartWithCredentials(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&) + 10358
23 Easy                           0xa745bd std::__1::__function::__func<firebase::firestore::remote::Stream::RequestCredentials()::$_0::operator()(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&) const::'lambda'(), std::__1::allocator<firebase::firestore::remote::Stream::RequestCredentials()::$_0::operator()(firebase::firestore::util::StatusOr<firebase::firestore::auth::Token> const&) const::'lambda'()>, void ()>::operator()() + 15494
24 Easy                           0x9bdcd3 firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) + 66904
25 Easy                           0x9c5baf firebase::firestore::util::internal::DispatchAsync(NSObject<OS_dispatch_queue>*, std::__1::function<void ()>&&)::$_0::__invoke(void*) + 99380
26 libdispatch.dylib              0x2163e423 _dispatch_queue_drain$VARIANT$mp + 1758
27 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
28 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain + 1560
29 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3 + 96
30 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread + 1024
31 libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#11. com.apple.CoreLocation.ConnectionClient.0x15843130.events
0  libsystem_kernel.dylib         0x2173a938 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x2164290b _dispatch_semaphore_wait_slow + 126
2  CoreLocation                   0x27a0f5e1 (null) + 664
3  CoreLocation                   0x27a153cd (null) + 1056
4  CoreLocation                   0x27a520c7 (null) + 63142
5  CoreLocation                   0x27a4fa1b (null) + 53242
6  CoreLocation                   0x27a4f901 (null) + 52960
7  CoreLocation                   0x27a50d53 (null) + 58162
8  libxpc.dylib                   0x218146b9 _xpc_connection_call_event_handler + 40
9  libxpc.dylib                   0x21812c2f _xpc_connection_mach_event + 1698
10 libdispatch.dylib              0x21647087 _dispatch_mach_msg_invoke$VARIANT$mp + 514
11 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
12 libdispatch.dylib              0x21647633 _dispatch_mach_invoke$VARIANT$mp + 410
13 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
14 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
15 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
16 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
17 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain + 1560
18 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3 + 96
19 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread + 1024
20 libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#12. com.apple.CoreLocation.ConnectionClient.0x1585a8c0.events
0  libsystem_kernel.dylib         0x2173a938 semaphore_timedwait_trap + 8
1  libdispatch.dylib              0x2164290b _dispatch_semaphore_wait_slow + 126
2  CoreLocation                   0x27a0f5e1 (null) + 664
3  CoreLocation                   0x27a153cd (null) + 1056
4  CoreLocation                   0x27a520c7 (null) + 63142
5  CoreLocation                   0x27a4fa1b (null) + 53242
6  CoreLocation                   0x27a4f901 (null) + 52960
7  CoreLocation                   0x27a50d53 (null) + 58162
8  libxpc.dylib                   0x218146b9 _xpc_connection_call_event_handler + 40
9  libxpc.dylib                   0x21812c2f _xpc_connection_mach_event + 1698
10 libdispatch.dylib              0x21647087 _dispatch_mach_msg_invoke$VARIANT$mp + 514
11 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
12 libdispatch.dylib              0x21647633 _dispatch_mach_invoke$VARIANT$mp + 410
13 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
14 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
15 libdispatch.dylib              0x2163df95 _dispatch_queue_drain$VARIANT$mp + 592
16 libdispatch.dylib              0x2163da61 _dispatch_queue_invoke$VARIANT$mp + 284
17 libdispatch.dylib              0x216405e9 _dispatch_root_queue_drain + 1560
18 libdispatch.dylib              0x2163ffcd _dispatch_worker_thread3 + 96
19 libsystem_pthread.dylib        0x217f5b29 _pthread_wqthread + 1024
20 libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#13. com.apple.CFSocket.private
0  libsystem_kernel.dylib         0x2174eeec __select + 20
1  CoreFoundation                 0x21a8af13 __CFSocketManager + 566
2  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
3  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
4  libsystem_pthread.dylib        0x217f5724 thread_start + 8

#14. Thread
0  libsystem_kernel.dylib         0x2174e998 __psynch_cvwait + 24
1  libsystem_pthread.dylib        0x217f6ded _pthread_cond_wait + 536
2  libsystem_pthread.dylib        0x217f7c99 pthread_cond_wait + 40
3  libc++.1.dylib                 0x211f486d std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 36
4  Easy                           0xb83227 NewRelic::WorkQueue::task_thread() + 95430
5  Easy                           0xb835fb std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >::__execute() + 96410
6  Easy                           0xb83483 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >::*)(), std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >*> >(void*) + 96034
7  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
8  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
9  libsystem_pthread.dylib        0x217f5724 thread_start + 8

#15. Thread
0  libsystem_kernel.dylib         0x2174e998 __psynch_cvwait + 24
1  libsystem_pthread.dylib        0x217f6ded _pthread_cond_wait + 536
2  libsystem_pthread.dylib        0x217f7c99 pthread_cond_wait + 40
3  libc++.1.dylib                 0x211f486d std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 36
4  Easy                           0xb83227 NewRelic::WorkQueue::task_thread() + 95430
5  Easy                           0xb835fb std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >::__execute() + 96410
6  Easy                           0xb83483 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >::*)(), std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >*> >(void*) + 96034
7  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
8  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
9  libsystem_pthread.dylib        0x217f5724 thread_start + 8

#16. Thread
0  libsystem_kernel.dylib         0x2174e998 __psynch_cvwait + 24
1  libsystem_pthread.dylib        0x217f6ded _pthread_cond_wait + 536
2  libsystem_pthread.dylib        0x217f7c99 pthread_cond_wait + 40
3  libc++.1.dylib                 0x211f486d std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 36
4  Easy                           0xb83227 NewRelic::WorkQueue::task_thread() + 95430
5  Easy                           0xb835fb std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >::__execute() + 96410
6  Easy                           0xb83483 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >::*)(), std::__1::__async_assoc_state<void, std::__1::__async_func<void (NewRelic::WorkQueue::*)(), NewRelic::WorkQueue*> >*> >(void*) + 96034
7  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
8  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
9  libsystem_pthread.dylib        0x217f5724 thread_start + 8

#17. Thread
0  libsystem_kernel.dylib         0x2174f864 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x217f5b35 _pthread_wqthread + 1036
2  libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#18. Thread
0  libsystem_kernel.dylib         0x2174f864 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x217f5b35 _pthread_wqthread + 1036
2  libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#19. com.twitter.crashlytics.ios.MachExceptionServer
0  libsystem_kernel.dylib         0x2173a8d0 mach_msg_trap + 20
1  libsystem_kernel.dylib         0x2173a6d5 mach_msg + 40
2  Easy                           0x4122df CLSMachExceptionServer + 745538
3  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
4  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
5  libsystem_pthread.dylib        0x217f5724 thread_start + 8

#20. JavaScriptCore::Marking
0  libsystem_kernel.dylib         0x2174e998 __psynch_cvwait + 24
1  libsystem_pthread.dylib        0x217f6ded _pthread_cond_wait + 536
2  libsystem_pthread.dylib        0x217f7c99 pthread_cond_wait + 40
3  libc++.1.dylib                 0x211f486d std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 36
4  JavaScriptCore                 0x24d7a505 JSC::GCThread::waitForNextPhase() + 104
5  JavaScriptCore                 0x24d7a56f JSC::GCThread::gcThreadMain() + 58
6  JavaScriptCore                 0x24b8b881 WTF::threadEntryPoint(void*) + 148
7  JavaScriptCore                 0x24b8b7df WTF::wtfThreadEntryPoint(void*) + 14
8  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
9  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
10 libsystem_pthread.dylib        0x217f5724 thread_start + 8

#21. AFNetworking
0  libsystem_kernel.dylib         0x2173a8d0 mach_msg_trap + 20
1  libsystem_kernel.dylib         0x2173a6d5 mach_msg + 40
2  CoreFoundation                 0x21a85ac5 __CFRunLoopServiceMachPort + 136
3  CoreFoundation                 0x21a83e4d __CFRunLoopRun + 1036
4  CoreFoundation                 0x219d3229 CFRunLoopRunSpecific + 520
5  CoreFoundation                 0x219d3015 CFRunLoopRunInMode + 108
6  Foundation                     0x2221c045 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 268
7  Foundation                     0x2226aa4d -[NSRunLoop(NSRunLoop) run] + 80
8  Easy                           0x16f42f +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:164)
9  Foundation                     0x222ed4a5 __NSThread__start__ + 1148
10 libsystem_pthread.dylib        0x217f785b _pthread_body + 138
11 libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
12 libsystem_pthread.dylib        0x217f5724 thread_start + 8

#22. Thread
0  libsystem_kernel.dylib         0x2174f864 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x217f5b35 _pthread_wqthread + 1036
2  libsystem_pthread.dylib        0x217f5718 start_wqthread + 8

#23. Thread
0  libsystem_kernel.dylib         0x2174e998 __psynch_cvwait + 24
1  libsystem_pthread.dylib        0x217f6ded _pthread_cond_wait + 536
2  libsystem_pthread.dylib        0x217f7c99 pthread_cond_wait + 40
3  Easy                           0x8c8ecf leveldb::(anonymous namespace)::PosixEnv::BGThreadWrapper(void*) + 316986
4  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
5  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
6  libsystem_pthread.dylib        0x217f5724 thread_start + 8

#24. Thread
0  libsystem_kernel.dylib         0x2174e998 __psynch_cvwait + 24
1  libsystem_pthread.dylib        0x217f6ded _pthread_cond_wait + 536
2  libsystem_pthread.dylib        0x217f7c99 pthread_cond_wait + 40
3  Easy                           0x9ad519 gpr_cv_wait + 171096
4  Easy                           0x97b32f GrpcExecutor::ThreadMain(void*) + 53360
5  Easy                           0x9b1383 grpc_core::(anonymous namespace)::ThreadInternalsPosix::ThreadInternalsPosix(char const*, void (*)(void*), void*, bool*)::'lambda'(void*)::__invoke(void*) + 15368
6  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
7  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
8  libsystem_pthread.dylib        0x217f5724 thread_start + 8

#25. Thread
0  libsystem_kernel.dylib         0x2174e998 __psynch_cvwait + 24
1  libsystem_pthread.dylib        0x217f6ded _pthread_cond_wait + 536
2  libsystem_pthread.dylib        0x217f7cd9 pthread_cond_timedwait + 44
3  Easy                           0x9ad50f gpr_cv_wait + 171086
4  Easy                           0x9b37e7 timer_thread(void*) + 24684
5  Easy                           0x9b1383 grpc_core::(anonymous namespace)::ThreadInternalsPosix::ThreadInternalsPosix(char const*, void (*)(void*), void*, bool*)::'lambda'(void*)::__invoke(void*) + 15368
6  libsystem_pthread.dylib        0x217f785b _pthread_body + 138
7  libsystem_pthread.dylib        0x217f77cf _pthread_start + 110
8  libsystem_pthread.dylib        0x217f5724 thread_start + 8

@wilhuff
Copy link
Contributor

wilhuff commented Dec 12, 2018

@paulb777 ARC guarantees that path is initialized to nil. The assertion we're seeing here is that path is nil when it shouldn't be--if it were random data then we wouldn't try to re-assign it at any point and we would have failed on line 63.

@lucasanovaes The Crashlytics data really only confirms what we know, that LoadGrpcRootCertificate is failing. One interesting bit of data is that this is particular crash is from an iPhone 4S running iOS 9.3.5, but even with that as my target I can't reproduce.

How are you manually integrating Firestore into your project? Did you build a separate FirebaseFirestore framework? Is gRPCCertificates-Firestore.bundle a part of that framework or did you add it to your app separately? I ask because one line 53 we ask for the bundle containing FSTFirestore.class and then search within that bundle. The assertion on line 54 isn't firing so the bundle is found but we're just not finding roots.pem within the bundle in this configuration.

What happens if you change line 53 to bundle = [NSBundle mainBundle];?

@wilhuff
Copy link
Contributor

wilhuff commented Dec 12, 2018

While we haven't been able to observe this, our hypothesis is that it's possible for the certificate file to be outside the Firestore framework and that we need to also fall back on the main bundle when searching #2183 implements a possible fix, though I'm still not sure why this would be the case on 32-bit devices but not 64.

@var-const
Copy link
Contributor

@agordeev We would need more information to figure out what is happening here. Can you please locate roots.pem and gRPCCertificates-Firestore.bundle in your project tree and post screenshots? roots.pem should be in Pods workspace under Pods/FirebaseFirestore/Resources. gRPCCertificates-Firestore.bundle should be in Pods workspace under Products. I wonder if these files make it into the project and if they are physically present on disk.

After few tries to build the project it succeeds but the app still crashes

Did you have to make any modifications to make the project build, or did it simply build successfully after several retries?

screen shot 2018-12-12 at 4 25 10 pm

@agordeev
Copy link
Author

agordeev commented Dec 13, 2018

Yes, they are both there:

screenshot 2018-12-13 at 08 51 51

screenshot 2018-12-13 at 08 51 35

Did you have to make any modifications to make the project build, or did it simply build successfully after several retries?

I didn't do any modifications, just built the project again and it worked. What I noticed is the build fails during the first building after Clean Build Folder. The second build goes fine.

By the way, the app doesn't print error message to console. I'm getting it with assigning po $arg1 action to exception breakpoint

@agordeev
Copy link
Author

Further debugging shown that [bundle pathForResource:@"gRPCCertificates.bundle/roots" ofType:@"pem"] returns nil (grpc_root_certificate_finder_apple.mm:45). Line 55 returns nil as well.

I also couldn't find gRPCCertificates-Firestore.bundle nor gRPCCertificates within my app package built

@lucasanovaes
Copy link

@wilhuff I'm following the exactly instructions on Readme inside firebase frameworks folder. https://firebase.google.com/download/ios?hl=pt-br

FYI, I did the integration using carthage and released a new version using Testflight (Firebase 5.14.0) and the same crash only on 32bit devices.

I'm going to make the suggested change bundle = [NSBundle mainBundle]; and post here ASAP.

@var-const
Copy link
Contributor

@agordeev After fiddling around with a test project, I found out I could get the project into a state where even if I restore all the settings to their original state, it results in a broken build. I understand that you didn't touch the settings, but perhaps the pod update somehow led to a similar state. Can you try deleting Pods directory, Podfile.lock, and XCode's Derived Data, and then do a clean build to see if it helps?

@agordeev
Copy link
Author

@var-const thanks for your suggestion. Unfortunately, that didn't help and I still experience the issue :-/
Cleaning out Pods doesn't help

@AlexisBarreyat
Copy link

Still having the same issue on 32bits device version 10.3.3 using Firebase 5.15.0

@ch3n
Copy link

ch3n commented Dec 24, 2018

same here.
the problem is the library can not find ssl cert for grpc
solution: under Carthage/build/ios/FirebaseFirestore.framework, there is a file called gRPCCertificates-Firestore.bundle, drag it into Xcode project

@walsht
Copy link

walsht commented Dec 30, 2018

@ch3n Thank you... that worked for me.

@festrs
Copy link

festrs commented Jan 6, 2019

@ch3n Thank you worked here too!

@rawnly
Copy link

rawnly commented Jan 12, 2019

@ch3n Thank you! Worked for me too!

@var-const
Copy link
Contributor

@agordeev I think I would need more information to tackle this issue. Can you email me at varconst at google.com? Then we can go from there.

@wilhuff wilhuff removed their assignment Jan 22, 2019
@var-const
Copy link
Contributor

Because there hasn't been any activity for some time, I'll close this issue. If you still experience the issue, feel free to reopen or message me at the address provided above.

@andoma93
Copy link

Still crashing here, @ch3n workaround worked for me. Thanks you!

@wilhuff wilhuff changed the title FIRESTORE INTERNAL ASSERTION FAILED: Could not load root certificates from the bundle. SSL cannot work. Firestore fails to load root certificates on 32-bit devices Feb 13, 2019
@firebase firebase locked and limited conversation to collaborators Oct 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests