invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.64k stars 2.21k forks source link

:fire: Crash in Firebase Firestore mutable_document.h - Line 191 EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000020 #5731

Closed casconed closed 3 years ago

casconed commented 3 years ago

Issue

Seeing an uptick in crashes since upgrading to RNFB 12.8.0.

Project Files

Javascript

Click To Expand

#### `package.json`: ```json { "name": "myproject", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "yarn prestorybook && react-native run-ios", "env:storybook": "shx echo \"export default 'storybook';\" > src/config/env.override.js", "env:dev": "shx echo \"export default 'development';\" > src/config/env.override.js", "env:stg": "shx echo \"export default 'staging';\" > src/config/env.override.js", "env:prod": "shx echo \"export default 'production';\" > src/config/env.override.js", "env:nooverride": "shx echo \"export default undefined;\" > src/config/env.override.js", "reinstall:modules": "rm -rf node_modules/ && yarn install", "reinstall:pods": "rm -rf ios/Pods && yarn pod-install", "reinstall:all": "yarn reinstall:modules && yarn reinstall:pods", "clean:cache": "watchman watch-del-all && rm -rf $TMPDIR/react-native*", "start": "react-native start", "start:clean": "yarn clean:cache && yarn reinstall:all && yarn start --reset-cache", "test": "jest --watchAll=true", "lint": "eslint . --ext .js,.jsx,.ts,.tsx", "lint:mobile": "eslint --cache 'src/**/*.{js,jsx,ts,tsx}' --max-warnings 0", "compile:mobile": "tsc --project ./tsconfig.json --noEmit", "lint:functions": "eslint 'functions/src/**/*.{js,ts}' --max-warnings 0", "compile:functions": "tsc --project ./functions/tsconfig.json --noEmit", "lint-compile": "yarn lint:mobile && yarn compile:mobile", "pretty": "prettier --write \"./**/*.{ts,tsx,js,jsx,json}\"", "prestorybook": "rnstl", "storybook": "start-storybook -p 7007", "pod-install": "cd ios && bundle exec pod install" }, "resolutions": { "@react-native-community/cli-debugger-ui": "4.7.0" }, "dependencies": { "@react-native-community/async-storage": "^1.11.0", "@react-native-community/blur": "^3.6.0", "@react-native-community/masked-view": "^0.1.10", "@react-native-community/push-notification-ios": "^1.8.0", "@react-native-community/viewpager": "^4.2.2", "@react-native-firebase/analytics": "12.8.0", "@react-native-firebase/app": "12.8.0", "@react-native-firebase/app-check": "^12.8.0", "@react-native-firebase/auth": "12.8.0", "@react-native-firebase/crashlytics": "12.8.0", "@react-native-firebase/dynamic-links": "12.8.0", "@react-native-firebase/firestore": "12.8.0", "@react-native-firebase/functions": "12.8.0", "@react-native-firebase/in-app-messaging": "12.8.0", "@react-native-firebase/messaging": "12.8.0", "@react-native-firebase/perf": "12.8.0", "@react-native-firebase/remote-config": "12.8.0", "@react-native-firebase/storage": "12.8.0", "@react-native-picker/picker": "^1.16.5", "@react-navigation/bottom-tabs": "^5.11.3", "@react-navigation/native": "5.7.0", "@react-navigation/stack": "5.7.0", "@types/amplitude-js": "^5.11.0", "@types/react-native-snap-carousel": "^3.8.2", "amplitude-js": "^7.1.1", "appcenter": "^4.0.0", "appcenter-analytics": "^4.0.0", "appcenter-crashes": "^4.0.0", "firebase": "^8.0.2", "firebase-tools": "^8.6.0", "lodash": "^4.17.19", "moment": "^2.27.0", "react": "^17.0.2", "react-native": "0.65.1", "react-native-adjust": "^4.29.4", "react-native-config": "^1.2.1", "react-native-confirmation-code-field": "^6.5.0", "react-native-context-menu-view": "^1.2.1", "react-native-device-info": "^6.0.4", "react-native-elements": "^3.4.2", "react-native-fast-image": "^8.3.7", "react-native-flipper": "^0.93.0", "react-native-fs": "^2.16.6", "react-native-gesture-handler": "^1.10.3", "react-native-get-random-values": "^1.4.0", "react-native-linear-gradient": "^2.5.6", "react-native-modal": "^11.5.6", "react-native-notifier": "^1.6.1", "react-native-reanimated": "^1.9.0", "react-native-responsive-fontsize": "^0.4.3", "react-native-safe-area-context": "^3.0.5", "react-native-screens": "^2.9.0", "react-native-snap-carousel": "^4.0.0-beta.6", "react-native-splash-screen": "^3.2.0", "react-native-status-bar-height": "^2.5.0", "react-native-svg": "^12.1.1", "react-native-swipe-list-view": "^3.2.3", "react-native-vector-icons": "^8.1.0", "react-native-viewpager-carousel": "^0.3.2", "react-native-webview": "^10.3.2", "react-redux": "^7.2.3", "react-test-renderer": "^16.13.1", "redux": "^4.0.5", "redux-devtools-extension": "^2.13.9", "redux-flipper": "^1.4.2", "redux-thunk": "^2.3.0", "rn-fetch-blob": "^0.12.0", "rxjs": "^6.6.3", "styled-components": "5.2.0", "uuid": "^8.2.0" }, "devDependencies": { "@babel/core": "^7.12.9", "@babel/runtime": "^7.12.5", "@react-native-community/eslint-config": "^2.0.0", "@storybook/addon-actions": "^5.3.19", "@storybook/addon-knobs": "^5.3.19", "@storybook/addon-links": "^5.3.19", "@storybook/addon-ondevice-knobs": "^5.3.19", "@storybook/addon-ondevice-notes": "^5.3.19", "@storybook/addons": "^5.3.19", "@storybook/react-native": "^5.3.19", "@storybook/react-native-server": "^5.3.19", "@types/jest": "^24.0.24", "@types/lodash": "^4.14.158", "@types/react-native": "^0.62.0", "@types/storybook__react": "^5.2.1", "@types/styled-components": "^5.1.0", "@types/uuid": "^8.0.0", "@typescript-eslint/eslint-plugin": "^3.3.0", "@typescript-eslint/parser": "^3.3.0", "babel-jest": "^26.6.3", "babel-loader": "^8.1.0", "babel-plugin-module-resolver": "^4.0.0", "eslint": "^7.14.0", "eslint-config-airbnb": "18.1.0", "eslint-import-resolver-typescript": "^2.0.0", "eslint-plugin-import": "^2.21.2", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-react": "^7.19.0", "eslint-plugin-react-hooks": "2.5.0", "husky": "^4.2.5", "jest": "^26.6.3", "lint-staged": "^10.2.11", "metro-react-native-babel-preset": "^0.66.0", "patch-package": "^6.2.2", "prettier": "^2.0.4", "react-dom": "16.11.0", "react-native-codegen": "^0.0.7", "react-native-storybook-loader": "^1.8.1", "react-native-testing-library": "^2.1.0", "shx": "^0.3.2", "typedoc": "^0.20.19", "typescript": "4.0.3" }, "config": { "react-native-storybook-loader": { "searchDir": [ "./src/components", "./src/screens", "./src/storybook" ], "pattern": "**/*.stories.tsx", "outputFile": "./src/storybook/storyLoader.js" } }, "jest": { "preset": "react-native", "moduleFileExtensions": [ "ts", "tsx", "js", "jsx", "json", "node" ], "setupFiles": [ "./node_modules/react-native-gesture-handler/jestSetup.js", "./jestSetup.ts" ], "setupFilesAfterEnv": [ "./src/__mocks__/firebaseMock.js" ], "moduleNameMapper": { "\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/src/__mocks__/fileMock.js", "\\.(css|less)$": "/src/__mocks__/styleMock.js" }, "testMatch": [ "/src/**/*.test.{ts,tsx}" ], "globals": { "window": {}, "navigator": {} }, "transformIgnorePatterns": [ "node_modules/(?!(@react-native|react-native|react-native-iphone-x-helper|react-native-linear-gradient|react-native-config|react-native-viewpager-carousel|@react-native-community/blur|react-native-mirror|react-native-event-listeners|@react-native-picker/picker|react-native-modal|react-native-animatable|react-native-swipe-list-view|react-native-confirmation-code-field|react-native-responsive-fontsize)/)" ] }, "husky": { "hooks": { "pre-commit": "yarn lint-compile && lint-staged", "pre-push": "yarn test --watchAll=false" } }, "lint-staged": { "./**/*.{js(x),ts(x)}": [ "eslint --fix --max-warnings 0" ], "./**/*.{json,md,yml}": [ "prettier --write" ] } } ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby platform :ios, '12.1' require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' # Post Install processing for Flipper def flipper_post_install(installer) file_name = Dir.glob("*.xcodeproj")[0] app_project = Xcodeproj::Project.open(file_name) app_project.native_targets.each do |target| target.build_configurations.each do |config| cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) ' unless cflags.include? '-DFB_SONARKIT_ENABLED=1' puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...' cflags << '-DFB_SONARKIT_ENABLED=1' end config.build_settings['OTHER_CFLAGS'] = cflags end app_project.save end installer.pods_project.save end # Post Install processing for iOSPhotoEditor def photo_editor_post_install(installer) installer.pods_project.targets.each do |target| if target.name.include?('iOSPhotoEditor') target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '5.4' end end end end target 'MyProject' do pod 'iOSPhotoEditor', :git => 'https://github.com/myproject/photo-editor', :commit => '443f05be4ff80a5ab3a303b88f786f8069bfc8f2' pod 'GoogleIDFASupport' pod 'FBSDKCoreKit' config = use_native_modules! use_react_native!( :path => config[:reactNativePath], # to enable hermes on iOS, change `false` to `true` and then install pods :hermes_enabled => true ) # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. use_flipper!( { 'Flipper' => '0.107.0', 'Flipper-Folly' => '2.6.9', 'Flipper-RSocket' => '1.4.3', 'Flipper-DoubleConversion' => '3.1.7', 'Flipper-Glog' => '0.3.9', 'Flipper-PeerTalk' => '0.0.4' }, configurations: ['Debug'] ) post_install do |installer| photo_editor_post_install(installer) react_native_post_install(installer) installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64' config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.1' end end end # Fix for RCT-Folly build error "Time.h:52:17: error: typedef redefinition with different types" # see https://github.com/facebook/flipper/issues/834 for details `sed -i -e $'s/__IPHONE_10_0/__IPHONE_13_1/' Pods/RCT-Folly/folly/portability/Time.h` end target 'ImageNotification' do pod 'Firebase/Messaging', '~> 8.7.0' end ``` #### `AppDelegate.m`: ```objc #import "AppDelegate.h" #import #import #import #import #import #import #import "RNSplashScreen.h" #import "ReactNativeConfig.h" #import #import #import #import "RNFBMessagingModule.h" #ifdef FB_SONARKIT_ENABLED #import #import #import #import #import #import static void InitializeFlipper(UIApplication *application) { FlipperClient *client = [FlipperClient sharedClient]; SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; [client addPlugin:[FlipperKitReactPlugin new]]; [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; [client start]; } #endif #if ENABLE_APP_CENTER && !DEBUG #import #import #import #endif #if ENABLE_APP_CENTER && !DEBUG static void InitializeAppCenter() { [AppCenterReactNative register]; [AppCenterReactNativeAnalytics registerWithInitiallyEnabled:true]; [AppCenterReactNativeCrashes registerWithAutomaticProcessing]; } #endif @implementation AppDelegate // Required to register for notifications -(void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings { [RNCPushNotificationIOS didRegisterUserNotificationSettings:notificationSettings]; } // Required for the register event. -(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { [RNCPushNotificationIOS didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; } // Required for the notification event. You must call the completion handler after handling the remote notification. -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; } // Required for the registrationError event. -(void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error { [RNCPushNotificationIOS didFailToRegisterForRemoteNotificationsWithError:error]; } // IOS 10+ Required for localNotification event -(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { [RNCPushNotificationIOS didReceiveNotificationResponse:response]; completionHandler(); } // IOS 4-10 Required for the localNotification event. -(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { [RNCPushNotificationIOS didReceiveLocalNotification:notification]; } //Called when a notification is delivered to a foreground app. -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler { completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert | UNNotificationPresentationOptionBadge); } - (void)applicationDidBecomeActive:(UIApplication *)application { [FBSDKAppEvents activateApp]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { #ifdef FB_SONARKIT_ENABLED InitializeFlipper(application); #endif #if ENABLE_APP_CENTER InitializeAppCenter(); #endif // Define UNUserNotificationCenter UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; center.delegate = self; RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"MyProject" initialProperties:nil]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; if ([FIRApp defaultApp] == nil) { NSString *resource = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"GoogleConfigurationFile"]; NSString *plistPath = [[NSBundle mainBundle] pathForResource:resource ofType:@"plist"]; FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:plistPath]; NSAssert(options != nil, @"Couldn't load FIR configuration file"); NSString *emulatorDatabaseURL = [ReactNativeConfig envFor:@"FIR_EMULATOR_DB_URL"]; if (emulatorDatabaseURL != nil) { options.databaseURL = emulatorDatabaseURL; } [FIRApp configureWithOptions:options]; NSString *functionsEmulatorOrigin = [ReactNativeConfig envFor:@"FIR_EMULATOR_FUNCTIONS_ORIGIN"]; if (functionsEmulatorOrigin != nil) { [[FIRFunctions functions] useFunctionsEmulatorOrigin:functionsEmulatorOrigin]; } } [RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootView]; [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; [FBSDKSettings setAdvertiserTrackingEnabled:YES]; [FBSDKSettings setAutoLogAppEventsEnabled:YES]; [FBSDKSettings setAdvertiserIDCollectionEnabled:NO]; return YES; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; #else return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; #endif } - (void) initializeFlipper:(UIApplication *)application { #if false #ifdef FB_SONARKIT_ENABLED FlipperClient *client = [FlipperClient sharedClient]; SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; [client addPlugin: [[FlipperKitLayoutPlugin alloc] initWithRootNode: application withDescriptorMapper: layoutDescriptorMapper]]; [client addPlugin: [[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; [client addPlugin: [FlipperKitReactPlugin new]]; [client addPlugin: [[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; [client start]; #endif #endif } - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options { return [RCTLinkingManager application:application openURL:url options:options]; } - (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray> * _Nullable))restorationHandler { return [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler]; } @end ```


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` (node:69671) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use `node --trace-warnings ...` to show where the warning was created) System: OS: macOS 11.6 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 2.48 GB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 14.17.5 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.14 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /Users/jasonmoore/.rvm/gems/ruby-2.6.5/bin/pod SDKs: iOS SDK: Platforms: iOS 15.0, DriverKit 20.4, macOS 11.3, tvOS 15.0, watchOS 8.0 Android SDK: API Levels: 28, 29, 30, 31 Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.1, 30.0.3 System Images: android-29 | Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.6953283 Xcode: 13.0/13A233 - /usr/bin/xcodebuild Languages: Java: 1.8.0_265 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: ^17.0.2 => 17.0.2 react-native: 0.65.1 => 0.65.1 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [x] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `12.8.0` - **`Firebase` module(s) you're using that has the issue:** - `Firestore` - **Are you using `TypeScript`?** - `Y 4.0.3`


mikehardy commented 3 years ago

@casconed sorry to hear that! Can you post a full stack? The more information we have about a crash the better we can handle it.

Have you tried using RNFB 12.8.0 but using an older version of firebase-ios-sdk, say 8.6.0 via override? I think that's a bit tough to advise for you as you're using Perf, and you'll want to make sure it comes down as 8.6.1 (it will if you nuke your Podfile.lock for instance) and since you have App Check + Functions you will want to make sure your App Check is generating valid tokens to make sure Functions HTTPS Callables are working, but it could be an interesting test.

Otherwise, for native crashes, assuming the stack really points to firebase and firestore, it will likely be a firestore-ios-sdk issue and searching their issue list might be fruitful, as would a native reproduction using their quickstart if that was possible

casconed commented 3 years ago

Looks like Firebase all the way down, just figured I'd start here in case anyone else was seeing similar crashes. I'll check their repo as well, and report back if I can rustle up anything interesting. Thanks!

Crashed: com.google.firebase.firestore
0  MyProject                      0x1028afae4 firebase::firestore::local::LevelDbRemoteDocumentCache::GetAllExisting(firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) + 191 (mutable_document.h:191)
1  MyProject                      0x1028aff1c firebase::firestore::local::LevelDbRemoteDocumentCache::GetMatching(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) + 222 (leveldb_remote_document_cache.cc:222)
2  MyProject                      0x1028b97d4 firebase::firestore::local::LocalDocumentsView::GetDocumentsMatchingCollectionQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&) + 149 (local_documents_view.cc:149)
3  MyProject                      0x1028e7950 firebase::firestore::local::QueryEngine::GetDocumentsMatchingQuery(firebase::firestore::core::Query const&, firebase::firestore::model::SnapshotVersion const&, firebase::firestore::immutable::SortedSet<firebase::firestore::model::DocumentKey, firebase::firestore::util::Comparator<firebase::firestore::model::DocumentKey> > const&) + 77 (query_engine.cc:77)
4  MyProject                      0x1028c55c8 std::__1::__function::__func<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::'lambda'(), std::__1::allocator<std::__1::enable_if<!(std::is_same<void, decltype(fp0())>::value), decltype(fp0())>::type firebase::firestore::local::Persistence::Run<firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14>(absl::lts_2020_02_25::string_view, firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool)::$_14)::'lambda'()>, void ()>::operator()() + 484 (local_store.cc:484)
5  MyProject                      0x1028ae1f8 firebase::firestore::local::LevelDbPersistence::RunInternal(absl::lts_2020_02_25::string_view, std::__1::function<void ()>) + 2314 (memory:2314)
6  MyProject                      0x1028be9bc firebase::firestore::local::LocalStore::ExecuteQuery(firebase::firestore::core::Query const&, bool) + 1838 (functional:1838)
7  MyProject                      0x10290af1c firebase::firestore::core::SyncEngine::InitializeViewAndComputeSnapshot(firebase::firestore::core::Query const&, int) + 100 (optional.h:100)
8  MyProject                      0x10290aad0 firebase::firestore::core::SyncEngine::Listen(firebase::firestore::core::Query) + 437 (vector:437)
9  MyProject                      0x1028546e4 firebase::firestore::core::EventManager::AddQueryListener(std::__1::shared_ptr<firebase::firestore::core::QueryListener>) + 60 (event_manager.cc:60)
10 MyProject                      0x10287158c std::__1::__function::__func<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10, std::__1::allocator<firebase::firestore::core::FirestoreClient::ListenToQuery(firebase::firestore::core::Query, firebase::firestore::core::ListenOptions, std::__1::shared_ptr<firebase::firestore::core::EventListener<firebase::firestore::core::ViewSnapshot> >&&)::$_10>, void ()>::operator()() + 3883 (memory:3883)
11 MyProject                      0x10282966c firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) + 990 (atomic:990)
12 MyProject                      0x10291aab8 firebase::firestore::util::Task::ExecuteAndRelease() + 1866 (functional:1866)
13 libdispatch.dylib              0x18566a2f0 _dispatch_client_callout + 16
14 libdispatch.dylib              0x185645410 _dispatch_lane_serial_drain$VARIANT$armv81 + 596
15 libdispatch.dylib              0x185645eb8 _dispatch_lane_invoke$VARIANT$armv81 + 388
16 libdispatch.dylib              0x18564f76c _dispatch_workloop_worker_thread + 616
17 libsystem_pthread.dylib        0x1df27ef38 _pthread_wqthread + 284
18 libsystem_pthread.dylib        0x1df27eaa4 start_wqthread + 8
casconed commented 3 years ago

@mikehardy according to this comment, the presence of LevelDbRemoteDocumentCache::GetAllExisting in that call stack means that this bug has been fixed, but not released!

mikehardy commented 3 years ago

Good sleuthing! Thanks for those links. I am only speculating but it appears based on tag dates vs release https://github.com/firebase/firebase-ios-sdk/tags that there was an 8 or so day lag between tagging 8.7.0 and release of 8.7.0. I'm not sure that's typical but it sets a reasonable "should not be longer than..." expectation that we should see 8.8.0 of firebase-ios-sdk in the next 7-8 days max and the referenced PR was merged and is in that tag

So I'm going to close this as an upstream issue but we'll have to wait for 8.8.0 of course to see it or you may follow instructions here https://github.com/firebase/firebase-ios-sdk/issues/8612#issuecomment-911882931 (likely best implemented as a Podfile post-install stanza with files committed to source control, so it's reproducible)