-
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
App crashes on launch (inconsistently) #10393
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Thanks for the detailed investigation. The crash could indeed be a symptom of a race condition. I'll take a look this week and let you know what I find. |
@tsahi-deri Could you test out my fix to see if it fixes the crash for you? Basically, just overwrite |
@dconeybe Thanks for the quick fix. I will embed you fix as you described and will test it for a couple of days. As I mentioned in the issue description it not reproduce any launch. |
@dconeybe I just want to make sure I did everything correctly.
Then I rebuild my project only, should I rebuild the Firebase SDK in the path above? |
Shoot, I don't know about using Swift Package Manager. I only know CocoaPods. You'll have to figure out how to do this with SPM on your own. What I'm going to do is go ahead and merge the fix in #10403. It at least fixes one Thread Sanitizer issue. The fix will then be included in the next release of the SDK. I'm not convinced that this particular race condition is contributing to any crashes though. You mentioned that "Many times the app crashes instantly after tapping the app icon.". Can you capture some of these crash logs and post them? With specific examples of the crash it may help debug the root cause. |
Hey @tsahi-deri. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Hey @dconeybe, after updating to Firebase SDK version 10.2.0 and using the app for a while, I still facing some launch crashes. Below, are some of the crash logs that I captured. Translated Report (Full Report Below)Incident Identifier: 05B28B63-F07C-456D-A725-7A9E4FD5B395 Date/Time: 2022-11-28 00:15:14.4104 +0200 Exception Type: EXC_BAD_ACCESS (SIGABRT) Application Specific Information:
|
@tsahi-deri The "good" news is that none of those crashes in the updated stack traces appear to be related to Firestore. So perhaps the race condition fix #10403 (released in 10.2.0) fixes the initial crash that you reported. The updated stack traces all seem to be coming from Crashlytics. This could either be a bug in crashlytics or, sometimes, crashlytics is not actually the cause of the crash and its stack traces shadow the original crash. Also, the thread sanitizer output adds a lot of noise. Could you reproduce the crashes and attach the crash logs with two changes:
|
@dconeybe No problem. |
@tsahi-deri I'm suggesting removing Crashlytics completely from your application. Removing the run script is not sufficient as the run script is only used to capture dSYMs/cSYMs and does not impact the app at runtime. The steps to remove Crashlytics depend on how your app is built (CocoaPods, SPM, framework copied in, etc). I don't have specific guidance on that because I'm not familiar with your application's structure. But I am quite sure that the Crashlytics stack traces are obfuscating the root issue, so it would be very helpful to remove Crashlytics from the equation. |
@tsahi-deri If you still would like some support with this problem, please open a new issue and feel free to tag me in it. |
Description
As part of our app launch sequence we use Firestore in order to fetch some app configuration/settings, followed by some other API calls to our backend (fetch user information etc.)
Many times the app crashes instantly after tapping the app icon.
While debugging it, some of the crashes just stops on
UIApplicaiotnMain()
, and others stops on a random Firebase SDK code (see screenshot below) and the thread that crashed is related to Firebase.Since all the crashes are
EXC_BAD_ACCESS
, and it inconsistently I suspect it a race data issue. Recently I enabled Thread Sanitizer on Diagnostics settings in order to audit threading issues in the code (see output below).The issue reproduce using Firebase SDK versions 9.3.0, 9.4.*, 9.5.0, 9.6.0 and 10.0.0.
Exception
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: UNKNOWN_0xD at 0x0000000000000000
Reproducing the issue
Firebase SDK Version
10.0.0
Xcode Version
13.3.1
Installation Method
Swift Package Manager
Firebase Product(s)
Analytics, Authentication, Crashlytics, DynamicLinks, Firestore, Performance
Targeted Platforms
iOS
Relevant Log Output
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippetIf using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetReplace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered: