-
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
Firestore -> grpc crash after upgrading to iOS 18 SDK / XCode 16 #14018
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
crashlytics doesn't depend on grpc |
|
I'm seeing lots of this too. |
In all of our crash reports, we see the offending thread looks like this (also attached): #0 0x0000000104b29208 in grpc_event_engine::experimental::MemoryAllocator::MakeSlice(grpc_event_engine::experimental::MemoryRequest) at .../ios/Pods/gRPC-Core/include/grpc/event_engine/memory_allocator.h:137 |
Looking forward to an update here, as this is impacting our users. |
Hi folks, The team tried to reproduce on our side but didn't get a successful sample so far. We would be appreciate if we can get a repo for this issue to help use investigate. |
For us it repros for few users so we cannot get a repro, but for those users they hit it multiple times. |
We are not able to reproduce it in debugging. It only happens on deployed devices. It is far more common on an iPhone 13, and very difficult to reproduce on an iPhone 14. My guess right now is that it is trying to allocate memory when coming back from sleep before iOS is allowing it to do so. I may add some delays to the code just to try testing my theory. We are able to build and deploy changes and replicate the error via test flight, but I only get the crash report, no legitimate debug information. |
Looking at my crash reports it seems like this always happens when the app is running in the background. I've personally seen the crash happen on my device, and it often happens after a few minutes after the app has been backgrounded. Maybe Firestore is trying to do something just as iOS is putting the app to sleep? |
Here's one that is similar but different:
|
I don't know if this is helpful at all, but if I build the app and run it with "flutter run", in debug mode, the app will not crash at all. But if I run it with the --release flag, the app fires up and I can get it to crash within a few seconds. I can get it to crash by opening a file_picker dialog and switching the app to the background, to the foreground, over and over... it usually crashes the 3rd or 4th time it comes back to the foreground. Unfortunately, because it only crashes in release mode, I don't get any debug information or stack trace or anything useful. I'll keep trying to find a way to get more information. We are not able to release any updates to our product until this is resolved, so we're quite dependent on finding a fix! |
same crash cocoapods 1.16.2 xcodeproj 1.27.0 |
Cocoapods 1.16.2 ve xcodeproj 1.27.0'a yükselttikten sonra, bu hatalar daha önce pod dosyasına eklediğimiz ['CLANG_CXX_LANGUAGE_STANDARD'] = 'gnu++14' öğesini kaldırmadığım için mi oluşuyor? |
I'm going to pass on any information I can collect - hopefully some of it is useful. I attached to the didChangeAppLifecycleState. The crash always occurs in the AppLifecycleState.inactive state (while going from paused to hidden to inactive, before it gets to resumed). My current theory is that there are stream events being processed when the app is coming out of the hidden state... iOS now doesn't like it when memory is allocated for those stream changes during the inactive state - so we need to wait until we get into the resumed state before processing the stream updates. I don't know all of the details around the streams or the interactions with gRPC or what's going on, but I'm hoping sharing these details will help someone who does. |
It seems the listener in FLTQuerySnapshotStreamHandler.m is where the issue begins. Is it possible to wait for the applicationState to be UIApplicationStateActive before it tries allocating the memory?
|
More information! I had a Stream that was loading 430 items from a Firebase datastore. When I updated the query for that stream to only pull 3, all of the crashes went away. Perhaps trying to allocate memory for 430 items is exceeding what iOS is willing to give it? I'm going to see what I can do to reduce the calls to get that object.... but, check for streams returning large sets of data. |
same error with gRPC, could not read json file |
Still seeing this in my crash logs, including with 11.4.2. |
We have been able to get this as well on our staging environment during testing. #0 0x0000000101fd4470 in grpc_event_engine::experimental::MemoryAllocator::MakeSlice(grpc_event_engine::experimental::MemoryRequest) at /Users/philipp/code/sequel/apps/mobile-app/ios/Pods/gRPC-Core/include/grpc/event_engine/memory_allocator.h:137 iOS 18.1 (22B83) |
Maybe this would be useful? Crashes occur in 11% of users.
|
Hi @superphil0 , Thank you for this additional information! Our team try to use this way to reproduce the problem but didn't find any clue, could you please let us know which function calling in your app you suspect might lead to problem? |
I am not sure, I suspect it's an observable / firestore listen |
I am experiencing the same issue. We have several firestore listens. My guess would also be that it's a firestore listen causing this issue. Here's a crashlog from Crashlytics, hope it's helpful. Happy to provide more info: Crashed: Thread 0
|
This seems likely to be an issue with Firestore listeners to me, too. I'm seeing it on App foreground as well. |
Running into this as well. Trending issue in crashlytics. I'm using Flutter and it started happening after upgrading the flutter firestore dep from v5.4.4 to v5.5.0. I'm not sure what firebase-ios-sdk version change that corresponds to.
|
Hi Google teams any updates here? Lots of crashes, haven't seen an update from you in a week. Here is another stacktrace that looks different, but I am assuming it is the issue.
|
For the reported crashes, besides the stack trace, was there similar crash addresses like |
HannahShiSFB is from the grpc-c++ team to help investigate this issue. For developers following this ticket, could you help with this question? |
@HannahShiSFB Yes. In the last 7 days I had 21 crashes, and all 21 were like you asked:
|
@HannahShiSFB I've had 819 such crashes over the last 7 days: |
@HannahShiSFB Yes, all crashes also have:
for me as well. |
Can confirm, they're all: |
I'm also experiencing this issue—appears to be related to iOS 18. Any updates here? |
We are experiencing the same issue on iOS, using the latest Unity SDK 12.5.0, and we had the same issue with older versions too. This is definitely something that would be amazing to be able to solve, our app heavily relies on listeners and it's causing crashes for a lot of users unfortunately. According to some reports, the app seems to be often crashing when foregrounding the app, but it's not the only situation in which the app crashes. Are there maybe any workarounds or solutions we could do to make this work until the issue is fully addressed? Thanks! |
@HannahShiSFB our crashes only have
and the stacktrace is very similar to the ones already posted above. |
Would any of you provide a reproducible example? |
Hi Google can you please properly resource this issue? It's affecting the main Firebase iOS SDK which is part of the firebase service offering we pay a lot of money for, and depend upon. This issue has been open two months now. |
It is quite difficult to provide a reproducible example simply because it doesn't seem to always happen, but often enough where it's really affecting the users. In our case as I mentioned before, we are using the Unity SDK, which would make it even more difficult to make a good example. But from what we gathered, there could be a fairly good chance of reproducing the issue by doing following steps (This is definitely not a guarantee and it might not work, but its similar to when the issue seems to happen the most in our case):
I am aware that this might seem a little overboard, but this is approximately the situation that we seem to be getting the most crashes at. I wish we would have more info to give but it really seems difficult to get a good grasp on when exactly this triggers. |
Description
This started getting reported via our crashlytics reporting after we moved to XCode 16 / iOS 18 SDK. The build in question uses iOS 18.1 SDK. It uses Firestore, which brings in grpc, which appears to be having this crash.
Reproducing the issue
We cannot reproduce the issue, it occurs in production builds in the wild.
Firebase SDK Version
11.4.2
Xcode Version
16.1
Installation Method
CocoaPods
Firebase Product(s)
Firestore
Targeted Platforms
iOS
Relevant Log Output
No response
If using Swift Package Manager, the project's Package.resolved
Expand
Package.resolved
snippetReplace this line with the contents of your Package.resolved.
If using CocoaPods, the project's Podfile.lock
Expand
Podfile.lock
snippetThe text was updated successfully, but these errors were encountered: