-
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) |
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: