firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.62k stars 1.48k forks source link

[Unit tests] EXC_BAD_ACCESS while executing registerInternalLibrary:withName:withVersion #8759

Closed andresguzmanl closed 2 years ago

andresguzmanl commented 3 years ago

[REQUIRED] Step 1: Describe your environment

[REQUIRED] Step 2: Describe the problem

App crashes when performing Unit Tests

Steps to reproduce:

Relevant Code:

morganchen12 commented 3 years ago

Hi @andresguzmanl, can you share the full stack trace?

andresguzmanl commented 3 years ago

Hello @morganchen12 thanks for answering so quickly. My problem is there is no backtrace, I only get that crash with no additional data. The only thing I am sure of, is that Unit Testing on 12.4 is perfectly fine. Please let me know what info should I provide so that it can give you a better idea of the problem.

morganchen12 commented 3 years ago

If you can repro the crash in Xcode with the debugger attached, you can find the stack trace by setting an exception breakpoint and running bt all when execution stops.

andresguzmanl commented 3 years ago

Hi @morganchen12, sorry for taking so long with this (had other stuff to address). here is te full backtrace:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=10, address=0x10d5da298)
  * frame #0: 0x000000010d5c2469 FirebaseCore`+[FIRApp registerInternalLibrary:withName:withVersion:](self=FIRApp, _cmd="registerInternalLibrary:withName:withVersion:", library=0x00000001077cc780, name=@"fire-analytics", version=@"7.5.0") at FIRApp.m:521:1
    frame #1: 0x000000010681b40a LuloBank`+[FIRAnalyticsConnector load] + 89
    frame #2: 0x00007fff2018cf26 libobjc.A.dylib`load_images + 1419
    frame #3: 0x000000010d2b69da dyld_sim`dyld4::RuntimeState::notifyObjCInit(dyld4::Loader const*) + 170
    frame #4: 0x000000010d2bb94d dyld_sim`dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 167
    frame #5: 0x000000010d2bb9f6 dyld_sim`dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 102
    frame #6: 0x000000010d2ca2d8 dyld_sim`dyld4::APIs::runAllInitializersForMain() + 222
    frame #7: 0x000000010d2ae920 dyld_sim`dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 2306
    frame #8: 0x000000010d2aed3f dyld_sim`_dyld_sim_prepare + 379
    frame #9: 0x00000001158abc27 dyld`dyld::useSimulatorDyld(int, macho_header const*, char const*, int, char const**, char const**, char const**, unsigned long*, unsigned long*) + 2093
    frame #10: 0x00000001158a915e dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 1191
    frame #11: 0x00000001158a3224 dyld`dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 450
    frame #12: 0x00000001158a3025 dyld`_dyld_start + 37
  thread #2
    frame #0: 0x00007fff6bf9995e libsystem_kernel.dylib`__workq_kernreturn + 10
    frame #1: 0x00007fff6bfeb4c1 libsystem_pthread.dylib`_pthread_wqthread + 414
    frame #2: 0x00007fff6bfea42f libsystem_pthread.dylib`start_wqthread + 15
  thread #3
    frame #0: 0x00007fff6bfea420 libsystem_pthread.dylib`start_wqthread
paulb777 commented 3 years ago

I'm not sure about the crash, but the backtrace indicates version 7.5.0 of Firebase Analytics.

Does the same problem occur with Firebase 8.8.0?

If you're still stuck, please share the Podfile.lock that goes with the crash backtrace.

andresguzmanl commented 3 years ago

It happens on 8.8.0 too, funny thing, works ok on a physical iphone with iOS 14.4.

PODS:
  - Alamofire (4.8.2)
  - Capable/Colors (1.1.4)
  - CleverTap-iOS-SDK (3.9.2):
    - SDWebImage (~> 5.1)
  - Firebase (7.6.0):
    - Firebase/Core (= 7.6.0)
  - Firebase/Core (7.6.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 7.6.0)
  - Firebase/CoreOnly (7.6.0):
    - FirebaseCore (= 7.6.0)
  - FirebaseABTesting (7.11.0):
    - FirebaseCore (~> 7.0)
  - FirebaseAnalytics (7.6.0):
    - FirebaseCore (~> 7.0)
    - FirebaseInstallations (~> 7.0)
    - GoogleAppMeasurement (= 7.6.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.0)
    - GoogleUtilities/MethodSwizzler (~> 7.0)
    - GoogleUtilities/Network (~> 7.0)
    - "GoogleUtilities/NSData+zlib (~> 7.0)"
    - nanopb (~> 2.30907.0)
  - FirebaseCore (7.6.0):
    - FirebaseCoreDiagnostics (~> 7.4)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/Logger (~> 7.0)
  - FirebaseCoreDiagnostics (7.9.0):
    - GoogleDataTransport (~> 8.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/Logger (~> 7.0)
    - nanopb (~> 2.30907.0)
  - FirebaseCrashlytics (7.6.0):
    - FirebaseCore (~> 7.0)
    - FirebaseInstallations (~> 7.0)
    - GoogleDataTransport (~> 8.0)
    - nanopb (~> 2.30907.0)
    - PromisesObjC (~> 1.2)
  - FirebaseDatabase (7.6.0):
    - FirebaseCore (~> 7.0)
    - leveldb-library (~> 1.22)
  - FirebaseDynamicLinks (7.6.0):
    - FirebaseCore (~> 7.0)
  - FirebaseInstallations (7.11.0):
    - FirebaseCore (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/UserDefaults (~> 7.0)
    - PromisesObjC (~> 1.2)
  - FirebaseInstanceID (7.11.0):
    - FirebaseCore (~> 7.0)
    - FirebaseInstallations (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/UserDefaults (~> 7.0)
  - FirebaseMessaging (7.6.0):
    - FirebaseCore (~> 7.0)
    - FirebaseInstanceID (~> 7.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/Reachability (~> 7.0)
    - GoogleUtilities/UserDefaults (~> 7.0)
  - FirebasePerformance (7.6.0):
    - FirebaseCore (~> 7.0)
    - FirebaseInstallations (~> 7.0)
    - FirebaseRemoteConfig (~> 7.0)
    - GoogleDataTransport (~> 8.2)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/ISASwizzler (~> 7.0)
    - GoogleUtilities/MethodSwizzler (~> 7.0)
    - Protobuf (~> 3.12)
  - FirebaseRemoteConfig (7.11.0):
    - FirebaseABTesting (~> 7.0)
    - FirebaseCore (~> 7.0)
    - FirebaseInstallations (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - "GoogleUtilities/NSData+zlib (~> 7.0)"
  - FLEX (4.4.0)
  - GoogleAppMeasurement (7.6.0):
    - GoogleUtilities/AppDelegateSwizzler (~> 7.0)
    - GoogleUtilities/MethodSwizzler (~> 7.0)
    - GoogleUtilities/Network (~> 7.0)
    - "GoogleUtilities/NSData+zlib (~> 7.0)"
    - nanopb (~> 2.30907.0)
  - GoogleDataTransport (8.3.1):
    - GoogleUtilities/Environment (~> 7.2)
    - nanopb (~> 2.30907.0)
    - PromisesObjC (~> 1.2)
  - GoogleMaps (4.1.0):
    - GoogleMaps/Maps (= 4.1.0)
  - GoogleMaps/Base (4.1.0)
  - GoogleMaps/Maps (4.1.0):
    - GoogleMaps/Base
  - GoogleUtilities/AppDelegateSwizzler (7.5.2):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (7.5.2):
    - PromisesObjC (< 3.0, >= 1.2)
  - GoogleUtilities/ISASwizzler (7.5.2)
  - GoogleUtilities/Logger (7.5.2):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (7.5.2):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (7.5.2):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (7.5.2)"
  - GoogleUtilities/Reachability (7.5.2):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (7.5.2):
    - GoogleUtilities/Logger
  - leveldb-library (1.22.1)
  - lottie-ios (3.2.1)
  - LuloLibs (0.1.63):
    - Alamofire
    - lottie-ios
    - SheetyColors
    - Socket.IO-Client-Swift
  - mParticle-Apple-SDK (8.1.4):
    - mParticle-Apple-SDK/mParticle (= 8.1.4)
  - mParticle-Apple-SDK/mParticle (8.1.4)
  - nanopb (2.30907.0):
    - nanopb/decode (= 2.30907.0)
    - nanopb/encode (= 2.30907.0)
  - nanopb/decode (2.30907.0)
  - nanopb/encode (2.30907.0)
  - PPpdf417 (5.1.2)
  - PromisesObjC (1.2.12)
  - Protobuf (3.18.0)
  - SDWebImage (5.11.1):
    - SDWebImage/Core (= 5.11.1)
  - SDWebImage/Core (5.11.1)
  - SheetyColors (1.2.0):
    - Capable/Colors (~> 1.1)
  - SnapKit (5.0.1)
  - Socket.IO-Client-Swift (15.2.0):
    - Starscream (~> 3.1)
  - Starscream (3.1.1)
  - UILulo (0.2.1)
  - ZendeskChatProvidersSDK (2.10.0)

DEPENDENCIES:
  - Alamofire (= 4.8.2)
  - CleverTap-iOS-SDK (= 3.9.2)
  - Firebase (= 7.6.0)
  - FirebaseAnalytics (= 7.6.0)
  - FirebaseCrashlytics (= 7.6.0)
  - FirebaseDatabase (= 7.6.0)
  - FirebaseDynamicLinks (= 7.6.0)
  - FirebaseMessaging (= 7.6.0)
  - FirebasePerformance (= 7.6.0)
  - FLEX (= 4.4.0)
  - GoogleMaps (= 4.1.0)
  - lottie-ios (= 3.2.1)
  - LuloLibs (= 0.1.63)
  - mParticle-Apple-SDK (= 8.1.4)
  - PPpdf417 (= 5.1.2)
  - SheetyColors (= 1.2.0)
  - SnapKit (= 5.0.1)
  - Socket.IO-Client-Swift (= 15.2.0)
  - UILulo (= 0.2.1)
  - ZendeskChatProvidersSDK (= 2.10.0)

SPEC REPOS:
  "ssh://git@github.com/piso19/LuloPodsRepo.git":
    - LuloLibs
    - UILulo
  trunk:
    - Alamofire
    - Capable
    - CleverTap-iOS-SDK
    - Firebase
    - FirebaseABTesting
    - FirebaseAnalytics
    - FirebaseCore
    - FirebaseCoreDiagnostics
    - FirebaseCrashlytics
    - FirebaseDatabase
    - FirebaseDynamicLinks
    - FirebaseInstallations
    - FirebaseInstanceID
    - FirebaseMessaging
    - FirebasePerformance
    - FirebaseRemoteConfig
    - FLEX
    - GoogleAppMeasurement
    - GoogleDataTransport
    - GoogleMaps
    - GoogleUtilities
    - leveldb-library
    - lottie-ios
    - mParticle-Apple-SDK
    - nanopb
    - PPpdf417
    - PromisesObjC
    - Protobuf
    - SDWebImage
    - SheetyColors
    - SnapKit
    - Socket.IO-Client-Swift
    - Starscream
    - ZendeskChatProvidersSDK

SPEC CHECKSUMS:
  Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
  Capable: 9f420f2a80a12144814ea2f0ba196516a0827ca1
  CleverTap-iOS-SDK: 348167628e6bf8f784b003b15abc0c872d346a55
  Firebase: e1e089d9aac215a52442583f818ab61de3c4581b
  FirebaseABTesting: e66f1f80747792630d9b292966de206d5df9853b
  FirebaseAnalytics: 9f8f4feab1f3fddf4e4515f8f022fe6aa9e51043
  FirebaseCore: 0a43b7f1c5b36f3358cd703011ca4c7e0df55870
  FirebaseCoreDiagnostics: 3d36e05da74cb8b7ce30e6594a8f201b982c725c
  FirebaseCrashlytics: 1e87b25303b1840b3c99c37ee427c3e9564a4be1
  FirebaseDatabase: 21842227253dafe61482065148fd044ba7983a41
  FirebaseDynamicLinks: 1ba27bcead0c55cb3fa48db7e1ca75005f8123d0
  FirebaseInstallations: a58d4f72ec5861840b84df489f2668d970df558a
  FirebaseInstanceID: ad5135045a498d7775903efd39762d2cdfa1be27
  FirebaseMessaging: 4b9b2850fcfcaac2820097ee3703ba6cfff3df84
  FirebasePerformance: bd70a911919ab62b6a4a51728fadb901406b0a13
  FirebaseRemoteConfig: 0ea30de5fb0231df8c1bdcdf3b6c23bdc5066131
  FLEX: 0592c011c6dfbfdb94a5e24f2d4a9dbff0c6026d
  GoogleAppMeasurement: c542a2feaac9ab98fd074e8f1a02c3585bbfbd47
  GoogleDataTransport: 8b0e733ea77c9218778e5a9e34ba9508b8328939
  GoogleMaps: 008e2c80e38605b56b560e8deb73d4194ff30bef
  GoogleUtilities: 8de2a97a17e15b6b98e38e8770e2d129a57c0040
  leveldb-library: 50c7b45cbd7bf543c81a468fe557a16ae3db8729
  lottie-ios: 106e92eaf11fbed0a76590b4cdb9b5ec26123ff7
  LuloLibs: 6d29bd2e7e7751d52c5db348c96e1630c82586fb
  mParticle-Apple-SDK: 3b1bda288a50158b6f3e8434672e18205ba249dc
  nanopb: 59221d7f958fb711001e6a449489542d92ae113e
  PPpdf417: de7dd7bea6c8d3ece4fd5be6d09403985698c1c9
  PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97
  Protobuf: 1a37ebea1338949e9ac35a3f06e80b3f536eec8d
  SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
  SheetyColors: 8dc64a666415be8a81df3c5d44b9088d6f8bee2e
  SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
  Socket.IO-Client-Swift: 1e3e3a1f09f3312a167f0d781eb2f383d477357c
  Starscream: 4bb2f9942274833f7b4d296a55504dcfc7edb7b0
  UILulo: b26727eca6e54fda1590a9abac870f0ba19db5b3
  ZendeskChatProvidersSDK: dcda37575fba7ae503f3dc03313424ef1b2e729d

PODFILE CHECKSUM: 1d405a21bf17a37e6401e8145ff7253a581c624d

COCOAPODS: 1.11.2
paulb777 commented 3 years ago

The mix of 7.6.0 and 7.11.0 Firebase versions should in theory work, but is not an expected combination and may be exposing an issue.

Would you share the Podfile, Podfile.lock and crash backtrace for the 8.8.0 occurrence?

Are you able to get more details about the crash from the debugger?

andresguzmanl commented 3 years ago

So, here is the lock file for 8.8.0:

PODS:
  - Alamofire (4.8.2)
  - Capable/Colors (1.1.4)
  - CleverTap-iOS-SDK (3.9.2):
    - SDWebImage (~> 5.1)
  - Firebase (8.8.0):
    - Firebase/Core (= 8.8.0)
  - Firebase/Core (8.8.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (~> 8.8.0)
  - Firebase/CoreOnly (8.8.0):
    - FirebaseCore (= 8.8.0)
  - FirebaseABTesting (8.8.0):
    - FirebaseCore (~> 8.0)
  - FirebaseAnalytics (8.8.0):
    - FirebaseAnalytics/AdIdSupport (= 8.8.0)
    - FirebaseCore (~> 8.0)
    - FirebaseInstallations (~> 8.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    - GoogleUtilities/MethodSwizzler (~> 7.4)
    - GoogleUtilities/Network (~> 7.4)
    - "GoogleUtilities/NSData+zlib (~> 7.4)"
    - nanopb (~> 2.30908.0)
  - FirebaseAnalytics/AdIdSupport (8.8.0):
    - FirebaseCore (~> 8.0)
    - FirebaseInstallations (~> 8.0)
    - GoogleAppMeasurement (= 8.8.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    - GoogleUtilities/MethodSwizzler (~> 7.4)
    - GoogleUtilities/Network (~> 7.4)
    - "GoogleUtilities/NSData+zlib (~> 7.4)"
    - nanopb (~> 2.30908.0)
  - FirebaseCore (8.8.0):
    - FirebaseCoreDiagnostics (~> 8.0)
    - GoogleUtilities/Environment (~> 7.4)
    - GoogleUtilities/Logger (~> 7.4)
  - FirebaseCoreDiagnostics (8.8.0):
    - GoogleDataTransport (~> 9.0)
    - GoogleUtilities/Environment (~> 7.4)
    - GoogleUtilities/Logger (~> 7.4)
    - nanopb (~> 2.30908.0)
  - FirebaseCrashlytics (8.8.0):
    - FirebaseCore (~> 8.0)
    - FirebaseInstallations (~> 8.0)
    - GoogleDataTransport (~> 9.0)
    - GoogleUtilities/Environment (~> 7.4)
    - nanopb (~> 2.30908.0)
    - PromisesObjC (< 3.0, >= 1.2)
  - FirebaseDatabase (8.8.0):
    - FirebaseCore (~> 8.0)
    - leveldb-library (~> 1.22)
  - FirebaseDynamicLinks (8.8.0):
    - FirebaseCore (~> 8.0)
  - FirebaseInstallations (8.8.0):
    - FirebaseCore (~> 8.0)
    - GoogleUtilities/Environment (~> 7.4)
    - GoogleUtilities/UserDefaults (~> 7.4)
    - PromisesObjC (< 3.0, >= 1.2)
  - FirebaseMessaging (8.8.0):
    - FirebaseCore (~> 8.0)
    - FirebaseInstallations (~> 8.0)
    - GoogleDataTransport (~> 9.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    - GoogleUtilities/Environment (~> 7.4)
    - GoogleUtilities/Reachability (~> 7.4)
    - GoogleUtilities/UserDefaults (~> 7.4)
    - nanopb (~> 2.30908.0)
  - FirebasePerformance (8.8.0):
    - FirebaseCore (~> 8.0)
    - FirebaseInstallations (~> 8.0)
    - FirebaseRemoteConfig (~> 8.0)
    - GoogleDataTransport (~> 9.0)
    - GoogleUtilities/Environment (~> 7.4)
    - GoogleUtilities/ISASwizzler (~> 7.4)
    - GoogleUtilities/MethodSwizzler (~> 7.4)
    - nanopb (~> 2.30908.0)
  - FirebaseRemoteConfig (8.8.0):
    - FirebaseABTesting (~> 8.0)
    - FirebaseCore (~> 8.0)
    - FirebaseInstallations (~> 8.0)
    - GoogleUtilities/Environment (~> 7.4)
    - "GoogleUtilities/NSData+zlib (~> 7.4)"
  - FLEX (4.4.0)
  - GoogleAppMeasurement (8.8.0):
    - GoogleAppMeasurement/AdIdSupport (= 8.8.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    - GoogleUtilities/MethodSwizzler (~> 7.4)
    - GoogleUtilities/Network (~> 7.4)
    - "GoogleUtilities/NSData+zlib (~> 7.4)"
    - nanopb (~> 2.30908.0)
  - GoogleAppMeasurement/AdIdSupport (8.8.0):
    - GoogleAppMeasurement/WithoutAdIdSupport (= 8.8.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    - GoogleUtilities/MethodSwizzler (~> 7.4)
    - GoogleUtilities/Network (~> 7.4)
    - "GoogleUtilities/NSData+zlib (~> 7.4)"
    - nanopb (~> 2.30908.0)
  - GoogleAppMeasurement/WithoutAdIdSupport (8.8.0):
    - GoogleUtilities/AppDelegateSwizzler (~> 7.4)
    - GoogleUtilities/MethodSwizzler (~> 7.4)
    - GoogleUtilities/Network (~> 7.4)
    - "GoogleUtilities/NSData+zlib (~> 7.4)"
    - nanopb (~> 2.30908.0)
  - GoogleDataTransport (9.1.0):
    - GoogleUtilities/Environment (~> 7.2)
    - nanopb (~> 2.30908.0)
    - PromisesObjC (< 3.0, >= 1.2)
  - GoogleMaps (4.1.0):
    - GoogleMaps/Maps (= 4.1.0)
  - GoogleMaps/Base (4.1.0)
  - GoogleMaps/Maps (4.1.0):
    - GoogleMaps/Base
  - GoogleUtilities/AppDelegateSwizzler (7.5.2):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (7.5.2):
    - PromisesObjC (< 3.0, >= 1.2)
  - GoogleUtilities/ISASwizzler (7.5.2)
  - GoogleUtilities/Logger (7.5.2):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (7.5.2):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (7.5.2):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (7.5.2)"
  - GoogleUtilities/Reachability (7.5.2):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (7.5.2):
    - GoogleUtilities/Logger
  - leveldb-library (1.22.1)
  - lottie-ios (3.2.1)
  - LuloLibs (0.1.63):
    - Alamofire
    - lottie-ios
    - SheetyColors
    - Socket.IO-Client-Swift
  - mParticle-Apple-SDK (8.1.4):
    - mParticle-Apple-SDK/mParticle (= 8.1.4)
  - mParticle-Apple-SDK/mParticle (8.1.4)
  - nanopb (2.30908.0):
    - nanopb/decode (= 2.30908.0)
    - nanopb/encode (= 2.30908.0)
  - nanopb/decode (2.30908.0)
  - nanopb/encode (2.30908.0)
  - PPpdf417 (5.1.2)
  - PromisesObjC (2.0.0)
  - SDWebImage (5.11.1):
    - SDWebImage/Core (= 5.11.1)
  - SDWebImage/Core (5.11.1)
  - SheetyColors (1.2.0):
    - Capable/Colors (~> 1.1)
  - SnapKit (5.0.1)
  - Socket.IO-Client-Swift (15.2.0):
    - Starscream (~> 3.1)
  - Starscream (3.1.1)
  - UILulo (0.2.1)
  - ZendeskChatProvidersSDK (2.10.0)

DEPENDENCIES:
  - Alamofire (= 4.8.2)
  - CleverTap-iOS-SDK (= 3.9.2)
  - Firebase (= 8.8.0)
  - FirebaseAnalytics (= 8.8.0)
  - FirebaseCrashlytics (= 8.8.0)
  - FirebaseDatabase (= 8.8.0)
  - FirebaseDynamicLinks (= 8.8.0)
  - FirebaseMessaging (= 8.8.0)
  - FirebasePerformance (= 8.8.0)
  - FLEX (= 4.4.0)
  - GoogleMaps (= 4.1.0)
  - lottie-ios (= 3.2.1)
  - LuloLibs (= 0.1.63)
  - mParticle-Apple-SDK (= 8.1.4)
  - PPpdf417 (= 5.1.2)
  - SheetyColors (= 1.2.0)
  - SnapKit (= 5.0.1)
  - Socket.IO-Client-Swift (= 15.2.0)
  - UILulo (= 0.2.1)
  - ZendeskChatProvidersSDK (= 2.10.0)

SPEC REPOS:
  "ssh://git@github.com/piso19/LuloPodsRepo.git":
    - LuloLibs
    - UILulo
  trunk:
    - Alamofire
    - Capable
    - CleverTap-iOS-SDK
    - Firebase
    - FirebaseABTesting
    - FirebaseAnalytics
    - FirebaseCore
    - FirebaseCoreDiagnostics
    - FirebaseCrashlytics
    - FirebaseDatabase
    - FirebaseDynamicLinks
    - FirebaseInstallations
    - FirebaseMessaging
    - FirebasePerformance
    - FirebaseRemoteConfig
    - FLEX
    - GoogleAppMeasurement
    - GoogleDataTransport
    - GoogleMaps
    - GoogleUtilities
    - leveldb-library
    - lottie-ios
    - mParticle-Apple-SDK
    - nanopb
    - PPpdf417
    - PromisesObjC
    - SDWebImage
    - SheetyColors
    - SnapKit
    - Socket.IO-Client-Swift
    - Starscream
    - ZendeskChatProvidersSDK

SPEC CHECKSUMS:
  Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
  Capable: 9f420f2a80a12144814ea2f0ba196516a0827ca1
  CleverTap-iOS-SDK: 348167628e6bf8f784b003b15abc0c872d346a55
  Firebase: 629510f1a9ddb235f3a7c5c8ceb23ba887f0f814
  FirebaseABTesting: 981336dd14d84787e33466e4247f77ec2343f8d9
  FirebaseAnalytics: 5506ea8b867d8423485a84b4cd612d279f7b0b8a
  FirebaseCore: 98b29e3828f0a53651c363937a7f7d92a19f1ba2
  FirebaseCoreDiagnostics: fe77f42da6329d6d83d21fd9d621a6b704413bfc
  FirebaseCrashlytics: 3660c045c8e45cc4276110562a0ef44cf43c8157
  FirebaseDatabase: bc4610ff3a816dcc680c1dbccf7f9f4bd94ac07d
  FirebaseDynamicLinks: cf76a46274569da2d4491548a39ef35f3c1a992d
  FirebaseInstallations: 2563cb18a723ef9c6ef18318a49519b75dce613c
  FirebaseMessaging: 419b5c9d84f294a753c6501d8cfb9ced1ce37304
  FirebasePerformance: 0c01a7a496657d7cea86d40c0b1725259d164c6c
  FirebaseRemoteConfig: f6365883d7950d784ee97bcdbbf1e442d4fa6119
  FLEX: 0592c011c6dfbfdb94a5e24f2d4a9dbff0c6026d
  GoogleAppMeasurement: 5ba1164e3c844ba84272555e916d0a6d3d977e91
  GoogleDataTransport: 85fd18ff3019bb85d3f2c551d04c481dedf71fc9
  GoogleMaps: 008e2c80e38605b56b560e8deb73d4194ff30bef
  GoogleUtilities: 8de2a97a17e15b6b98e38e8770e2d129a57c0040
  leveldb-library: 50c7b45cbd7bf543c81a468fe557a16ae3db8729
  lottie-ios: 106e92eaf11fbed0a76590b4cdb9b5ec26123ff7
  LuloLibs: 6d29bd2e7e7751d52c5db348c96e1630c82586fb
  mParticle-Apple-SDK: 3b1bda288a50158b6f3e8434672e18205ba249dc
  nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96
  PPpdf417: de7dd7bea6c8d3ece4fd5be6d09403985698c1c9
  PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58
  SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
  SheetyColors: 8dc64a666415be8a81df3c5d44b9088d6f8bee2e
  SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
  Socket.IO-Client-Swift: 1e3e3a1f09f3312a167f0d781eb2f383d477357c
  Starscream: 4bb2f9942274833f7b4d296a55504dcfc7edb7b0
  UILulo: b26727eca6e54fda1590a9abac870f0ba19db5b3
  ZendeskChatProvidersSDK: dcda37575fba7ae503f3dc03313424ef1b2e729d

PODFILE CHECKSUM: 9e1512b428f08dc6d881c6efb9cac9b99d041d16

COCOAPODS: 1.11.2

My podfile looks like this:

platform :ios, '13.0'
use_frameworks!
def list_pods
  # Pods for LuloBank
  pod 'Firebase', '8.8.0'
  pod 'FirebaseAnalytics', '8.8.0'
  pod 'FirebaseCrashlytics', '8.8.0'
  pod 'FirebaseDatabase', '8.8.0'
  pod 'FirebasePerformance', '8.8.0'
  pod 'FirebaseDynamicLinks', '8.8.0'
  pod 'FirebaseMessaging', '8.8.0'
  pod 'GoogleMaps', '4.1.0'
  pod 'mParticle-Apple-SDK', '8.1.4'
  pod 'CleverTap-iOS-SDK', '3.9.2'
  #Adotech Required pods
  pod 'Alamofire', '4.8.2'
  pod 'PPpdf417', '5.1.2'
  pod 'SnapKit', '5.0.1'
  pod 'Socket.IO-Client-Swift', '15.2.0'
  pod 'SheetyColors', '1.2.0'
  #end
  pod 'lottie-ios', '3.2.1'
  pod 'FLEX', '4.4.0', :configurations => ['Debug']
  pod 'ZendeskChatProvidersSDK', '2.10.0'
  pod 'LuloLibs', '0.1.63'
  pod 'UILulo', '0.2.1'
end

target 'LuloBank' do
  list_pods
  target 'LuloBankTests' do
    inherit! :search_paths
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '5.3'
    end
  end
end

And here is the backtrace with the error:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=10, address=0x117ee1298)
  * frame #0: 0x0000000117ec94f9 FirebaseCore`+[FIRApp registerInternalLibrary:withName:withVersion:](self=FIRApp, _cmd="registerInternalLibrary:withName:withVersion:", library=0x000000011212cc30, name=@"fire-analytics", version=@"8.8.0") at FIRApp.m:525:1
    frame #1: 0x000000011119fd93 LuloBank`+[FIRAnalyticsConnector load] + 89
    frame #2: 0x00007fff2018cf26 libobjc.A.dylib`load_images + 1419
    frame #3: 0x0000000117bbd9da dyld_sim`dyld4::RuntimeState::notifyObjCInit(dyld4::Loader const*) + 170
    frame #4: 0x0000000117bc294d dyld_sim`dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 167
    frame #5: 0x0000000117bc29f6 dyld_sim`dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 102
    frame #6: 0x0000000117bd12d8 dyld_sim`dyld4::APIs::runAllInitializersForMain() + 222
    frame #7: 0x0000000117bb5920 dyld_sim`dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 2306
    frame #8: 0x0000000117bb5d3f dyld_sim`_dyld_sim_prepare + 379
    frame #9: 0x000000012640dc27 dyld`dyld::useSimulatorDyld(int, macho_header const*, char const*, int, char const**, char const**, char const**, unsigned long*, unsigned long*) + 2093
    frame #10: 0x000000012640b15e dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 1191
    frame #11: 0x0000000126405224 dyld`dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*) + 450
    frame #12: 0x0000000126405025 dyld`_dyld_start + 37
  thread #2
    frame #0: 0x00007fff6bfea420 libsystem_pthread.dylib`start_wqthread
  thread #3
    frame #0: 0x0000000000000000

Also, with this setup on a physical device the Unit tests run perfectly fine, the issue is only while doing it on a simulator.

paulb777 commented 3 years ago

Hmm, based on https://opensource.apple.com/source/xnu/xnu-1228.0.2/osfmk/mach/kern_return.h and https://developer.apple.com/documentation/xcode/investigating-memory-access-crashes an EXC_BAD_ACCESS code 10 is a KERN_MEMORY_ERROR. The crashed thread tried to access memory that couldn’t return data at that moment, such as a memory-mapped file that became unavailable.

I'm not sure what could cause that at https://github.com/firebase/firebase-ios-sdk/blob/bb8965c3ce61634ad15ab82cb36e4ad3a9962d77/FirebaseCore/Sources/FIRApp.m#L525.

Does running with the Address Sanitizer or any of the other tools described at https://developer.apple.com/documentation/xcode/investigating-memory-access-crashes help?

Otherwise sharing a reproducible example would help us investigate more deeply.

andresguzmanl commented 3 years ago

Thanks for the input. I will try to share a reproducible example, in the mean time I could only get this from the article you shared: LuloBank(22616,0x11e99de00) malloc: nano zone abandoned due to inability to preallocate reserved vm space. Not sure what it means either.

sstigler commented 3 years ago

I'm seeing the same issue. The crash appears to be in +[FIRAnalyticsConnector componentsToRegister].

tmle commented 3 years ago

I'm experiencing the same crash on [FIRApp registerInternalLibrary:withName:withVersion:].

Here is the crash backtrace

Thread 1 Queue : com.apple.main-thread (serial)
#0  0x000000010cbfcb89 in +[FIRApp registerInternalLibrary:withName:withVersion:] at /Users/...user-path/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m:525
#1  0x000000010c03a0b3 in +[FIRAnalyticsConnector load] ()
#2  0x00007fff201804e3 in load_images ()
#3  0x000000010995ae54 in dyld::notifySingle(dyld_image_states, ImageLoader const*, ImageLoader::InitializerTimingList*) ()
#4  0x0000000109969887 in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#5  0x0000000109967bb0 in ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) ()
#6  0x0000000109967c50 in ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) ()
#7  0x000000010995eae7 in dyld::runInitializers(ImageLoader*) ()
#8  0x000000010996319e in dlopen_internal ()
#9  0x00007fff2025e0cf in dlopen_internal(char const*, int, void*) ()
#10 0x00007fff2035bb8b in _CFBundleDlfcnLoadBundle ()
#11 0x00007fff2032d5a7 in _CFBundleLoadExecutableAndReturnError ()
#12 0x00007fff2073144a in -[NSBundle loadAndReturnError:] ()
#13 0x0000000109be05a8 in -[XCTestDriver _loadTestBundleFromURL:error:] ()
#14 0x0000000109bdf86e in -[XCTestDriver _prepareTestConfigurationAndIDESession] ()
#15 0x0000000109bdf21a in -[XCTestDriver run] ()
#16 0x0000000109b766f8 in _XCTestMain ()
#17 0x000000010994a812 in _XCTRunnerRunTests ()
#18 0x000000010994a7f9 in __46-[_XCTRunnerAppDelegate runTestsInBackground:]_block_invoke ()
#19 0x00007fff20390120 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ ()
#20 0x00007fff2038f534 in __CFRunLoopDoBlocks ()
#21 0x00007fff20389f44 in __CFRunLoopRun ()
#22 0x00007fff203896d6 in CFRunLoopRunSpecific ()
#23 0x00007fff2c257db3 in GSEventRunModal ()
#24 0x00007fff24696cf7 in -[UIApplication _run] ()
#25 0x00007fff2469bba8 in UIApplicationMain ()
#26 0x000000010994aa08 in main ()
#27 0x00007fff2025a3e9 in start ()
#28 0x00007fff2025a3e9 in start ()

and here is the Podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'

plugin 'cocoapods-art', :sources => [
    'company-pods3',
    'company-pods-retail3',
]
# ignore all warnings from all pods
inhibit_all_warnings!

use_frameworks!
install! 'cocoapods', :deterministic_uuids => false
source 'https://github.com/CocoaPods/Specs.git'

$retailVersion = '9.0.0'
$passwordVersion = '3.0.0'

def include_pods
# some company pods

    pod 'GooglePlaces', '2.7.0'
    pod 'GoogleAnalytics'
    pod 'GoogleTagManager', '~> 7.2'

    pod 'Firebase/Analytics'
    pod 'Firebase/Crashlytics'
    pod 'Firebase/Core', '8.8.0'
    pod 'Firebase/RemoteConfig'

    pod 'SwiftLint'
    pod 'SwiftFormat/CLI'
    pod 'FSCalendar', '~> 2.7.9'

end

def include_sepa_pods
    include_pods
end

def include_us_pods
    include_pods    
# some company pods
end

#def include_test_pods
#    pod 'Quick'
#    pod 'Nimble'
#end

def include_ui_test_pods
    use_frameworks!
    pod 'iOSSnapshotTestCase'
    pod 'CompanyUITestUtils', '0.3.1'
    pod 'Cucumberish'
end

target 'CompanyApp' do
    # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!
    include_sepa_pods
    include_us_pods

    target 'CompanyAppTests' do
        inherit! :search_paths
        use_frameworks!
        pod 'Quick'
        pod 'Nimble'
        #include_test_pods
    end

    target 'CompanyAppUITests' do
        use_frameworks!
        include_ui_test_pods
    end
end

target 'Unstable-isam' do
    use_frameworks!
    include_us_pods
end

target 'Stable-isam' do
    use_frameworks!
    include_us_pods
end

target 'Testing-isam' do
    use_frameworks!
    include_us_pods
end

target 'Staging-isam' do
    use_frameworks!
    include_us_pods
end

target 'Prod-isam' do
    use_frameworks!
    include_us_pods
end

target 'Unstable-ldap' do
    use_frameworks!
    include_us_pods
end

target 'Stable-ldap' do
    use_frameworks!
    include_us_pods
end

target 'Testing-ldap' do
    use_frameworks!
    include_us_pods
end

post_install do |installer|
    if installer.pods_project.root_object.attributes["TargetAttributes"]
        installer.pods_project.root_object.attributes["TargetAttributes"].each do | target, sett |
            sett["ProvisioningStyle"] = 'Automatic'
        end
        else
        attrs = Hash.new
        installer.pods_project.targets.each do |target|
            attrs[target.uuid] = Hash.new
            attrs[target.uuid]["ProvisioningStyle"] = 'Automatic'
        end

        installer.pods_project.root_object.attributes["TargetAttributes"] = attrs
    end

    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = ''
        end
    end
end
paulb777 commented 2 years ago

Thanks for the reports. A reproducible example would be helpful for us here.

sstigler commented 2 years ago

At this point I'm not positive the issue is with Firebase: We tried removing Firebase last week, but then we got an error (something about sqlite3) in a call from libGoogleAnalytics. We removed libGoogleAnalytics and then got the same EXC_BAD_ACCESS (code 10) crash in a completely different, non-Google, third-party library. Removing that only brought the crash to a different part of our code. We're starting to thinking maybe it's an Apple issue.

(Cannot provide a reproducible example at this time.)

andresguzmanl commented 2 years ago

It looks like we are out of options, I haven't seen any known issues by apple on this matter. Should we wait to upgrade on a future XCode release?

paulb777 commented 2 years ago

@andresguzmanl If it's a Firebase issue, it should be feasible to create a shareable reproducible example.

google-oss-bot commented 2 years ago

Hey @andresguzmanl. 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!

google-oss-bot commented 2 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@andresguzmanl if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.