-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Crashed: com.google.firebase.firestore grpc::SecureChannelCredentials::~SecureChannelCredentials() #11509
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @timobaehr, thank you for reporting this issue. Could you please provide a minimal reproducible app for us to debug it? Besides, you have mentioned that Firestore integration in your app is unchanged since years. I assume you are using crashlytics. Can we pin point the date that error started based on crashlytics? How often it is happening? Are only iOS 12 users are affected? |
Hi @milaGGL, unfortunately I cannot. I cannot reproduce the bug without iPhone 6 with 12.5.7. The bug was reported via Crashlytics only from my users with iOS 12.5.7. Nine users reported this bug 51 times. Crashes are reported between June, 20 and July, 5. Yesterday no user reported this issue but can happen that they didn't retry. |
@timobaehr, you have mentioned Firestore integration is unchanged since years, but the SDK version in the issue description is a very recent version(10.10.0). Have you upgraded the SDK in your app recently? |
@milaGGL I upgrade to latest versions from time to time. I meant the source code, not the version. June, 25 I updated the Flutter plugin from Expand
|
@timobaehr, You have updated Flutter on June 25th, but the problem began on June 20th, so Flutter update might not be the cause. With the given information, it is hard to debug the issue. My guess is, since there is no code change, a newly upgraded product might contain a bug, or maybe different products (Firestore, Flutter, iOS 12) have version discrepancies. If we can pin-point which product updates introduced the bug, we might be able to compare the version differences to identify the cause. |
I guess problem was introduced by EHW+ app version 1.9.53 (app was in sale since June 20, 08:35 am). Unfortunately I checked Crashlytics, the crash still appears with the latest version, starting with the app version 1.9.53. But I was able to reproduce the bug with a cloud device. It crashes at the point of the first access to FireBase. The onboarding of the app is without Firebase, then no crash happens. iPhone 7, iOS 12.1.4
|
Nice! Would you be able to provide us with a minimal reproducible app with repro steps? |
Here some code to reproduce the bug. I tested it on iOS 16 - no crash. On iPhone 7 with iOS 12.1 this example app crashes. Example is nearly similar to this one. Expand
|
Here to confirm that it's indeed a Firebase issue and not a Flutter issue. This started happening to an app I'm working on which is written in Swift. It's also affecting only iOS 12. |
Here for confirmation of the issue: firebase/flutterfire#11216 |
I bought a old iPhone 6 to debug. Strangely this is not happening in debug mode only in release (install via Testflight) |
Sorry. That's not the solution. I deleted the |
@timobaehr Dang. Okay you may need to downgrade Firestore to 10.9.0 then. We don't think it should cause problems. Otherwise, wait for the next release which will (likely) properly downgrade grpc. |
What are the lines in This causes a version error with other Firebase libraries (Crashlytics, Analytics, Auth):
|
Using Firestore 10.9.0 and gRPC 1.44 the app crashes shortly after startup. I'm running on iPhone 6S with iOS 12.3.1 and the issue is reproducible with debugger attached. Let me know if my setup can help pinpointing the issue |
@TheStalwart Are you using the recently-released Xcode 15? If yes, there is a known crash caused by linker changes in Xcode 15 and the workaround is to add |
@TheStalwart You will need to downgrade all of your firebase Podfile lines to 10.9.0, not just Firestore. Can you give that a try? Edit: Oops, I meant to mention @timobaehr, not @TheStalwart, in response to the previous comment #11509 (comment) |
Yes, i'm now migrating the project to Xcode 15. when building with Xcode 14 the issue was not present. Setting OTHER_LDFLAGS did not resolve the issue, the project crashes on the same line 57 of temporary_buffer.h. And yes, all Firebase pod versions are in sync and set to 10.9.0, with gRPC-C++ set to 1.44.0. |
Ok turns out i misread the workaround description. OTHER_LDFLAGS need to be set for Pods project in Xcode tree. When setting to just the root project, it's not inherited by Pods. Works for me now. |
@timobaehr (re #11509 (comment)) You will need to downgrade all of your firebase Podfile lines to 10.9.0, not just Firestore. Can you give that a try? |
Leave the cmake and swift package manager dependencies at 1.50 since they do not experience this crash. This is a workaround for a Firestore crash on iOS 12 with grpc 1.50.0 and newer: #11509
Update: The next release of the Firebase Apple SDK (planned for early October 2023) will downgrade the grpc dependency in CocoaPods builds back to 1.44.0 (see #11846). We will try upgrading grpc again once the "workaround" is merged into grpc and released. For now, however, this should unblock you if you're encountering this crash. |
For posterity, this bug is being tracked internally at Google by b/300501963. |
Fix a crash on older iOS versions due to problematic thread-local variable initialization. See firebase/firebase-ios-sdk#11509 Basically, there appears to be a bug in Xcode where it generates assembly for thread-local variable initialization that is susceptible to a crash. For example, on arm64 the generated assembly relies on registers like x8 and x10 being preserved by the thread-local variable initialization routine; however, in some cases this thread-local variable initialization calls functions like `ImageLoaderMachOCompressed::doBindFastLazySymbol` which clobber these registers, leaving their values indeterminate when the caller resumes. When those indeterminate values are later used as memory addresses they are invalid and result in a crash. This PR works around this bug by removing the `ScopedTimeCache` member variable from the `ExecCtx` class on iOS. This is a reasonable workaround because `ScopedTimeCache` is only a slight optimization for data centers that entirely doesn't matter for mobile. See https://github.com/dconeybe/TlsCrashIos12 for a demo of this crash. Googlers see b/300501963 for full details.
Using
The Flutter plugin was updated three days ago: If I try to enforce usint latest version and add these lines into Podfile
I'm getting
Am I doing something wrong? How can I upgrade to |
I had the same issue and fixed it by adding Edit: although the correct FirebaseSDKVersion was installed from the above variable, and having the |
I have tried everything from upgrading/downgrading Firebase pods (10.9.0 ... 10.16.0) to setting up OTHER_LDFLAGS, the app is always crashing in startup on iOS 13.6 but works fine in iOS 12.5/15.3/17, using Xcode 15.1. While running from Xcode, the app did not crash, but when I closed, cleared the app from the background, and relaunched it, it crashed only in iOS 13.6, What I am missing? |
I tried to reproduce the crash with 10.16.0. It's looking very good. I can confirm, Successfully tested on:
|
Just to note for others... you have to add |
Thanks a lot, it's working now. |
How did you guys managed to solve this?
I'm getting:
|
@osfunapps Remove |
@paulb777 Yeah tried this but Firestore code:
crashes in:
|
If it helps, these are my Firebase pods and versions:
|
@osfunapps That looks like #11829 |
Yeah @paulb777 you're right. Downgrading XCode is a temporary solution. Jesus how many of these bugs are out there |
Description
Users with old iPhones/iPads running under iOS 12 (v12.5.7) see a full app crash of the app with Firestore. Affected devices are e.g. iPhone 6, iPad Air
Reproducing the issue
Firebase SDK Version
10.10.0
Xcode Version
14.3.1
Installation Method
CocoaPods
Firebase Product(s)
Firestore
Targeted Platforms
iOS
Relevant Log Output
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetThe text was updated successfully, but these errors were encountered: