Skip to content
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

[Auth] async Auth.auth().fetchSignInMethods(forEmail email: String) causes weird crash on the latest version of Firebase Auth SDK 11.1.0 #13550

Closed
remziyildirim opened this issue Aug 28, 2024 · 2 comments · Fixed by #13561

Comments

@remziyildirim
Copy link

Description

After updating Firebase Auth SDK CocoaPods version from 10.29.0 to 11.1.0, this crash appears in the Firebase Crashlytics Dashboard. I tried to reproduce it on my device, but I couldn't.

It seems it starts to crash inside of the Auth.auth().fetchSignInMethods function. I saw that in the release notes of the version 11.1.0 there is a fix might lead this issue, but I'm not sure.

11.1.0 Release note
[Auth] Fix async/await crash from implicitly unwrapped nil error by @ncooke3 in #13472

We have been using fetchSignInMethods function since October 2023 and have never encountered this crash.

let signInMethods = try await Auth.auth().fetchSignInMethods(forEmail: "emailAddress")
debugPrint("Authentication \(#function) signInMethods: \(signInMethods)")

Reproducing the issue

No response

Firebase SDK Version

11.1.0

Xcode Version

15.3

Installation Method

CocoaPods

Firebase Product(s)

Authentication

Targeted Platforms

iOS

Relevant Log Output

Firebase Crashlytics log;
          Crashed: com.apple.main-thread
0  FirebaseAuth                   0x10054 closure #1 in closure #1 in Auth.fetchSignInMethods(forEmail:) + 116
1  FirebaseAuth                   0x25270 partial apply for thunk for @escaping @callee_guaranteed (@guaranteed AuthDataResult?, @guaranteed Error?) -> () + 24 (<compiler-generated>:24)
2  FirebaseAuth                   0x6dd64 partial apply for specialized closure #1 in static Auth.wrapMainAsync<A>(callback:withParam:error:) + 40
3  FirebaseAuth                   0xd664 thunk for @escaping @callee_guaranteed () -> () + 28
4  libdispatch.dylib              0x637a8 _dispatch_call_block_and_release + 24
5  libdispatch.dylib              0x64780 _dispatch_client_callout + 16
6  libdispatch.dylib              0x45e10 _dispatch_main_queue_drain + 888
7  libdispatch.dylib              0x45a88 _dispatch_main_queue_callback_4CF$VARIANT$armv81 + 36
8  CoreFoundation                 0x919ac __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
9  CoreFoundation                 0x75648 __CFRunLoopRun + 2080
10 CoreFoundation                 0x79d20 CFRunLoopRunSpecific + 584
11 GraphicsServices               0x1998 GSEventRunModal + 160
12 UIKitCore                      0x37134c <redacted> + 868
13 UIKitCore                      0x370fc4 UIApplicationMain + 312
14 HOLIDAY_PIRATES                0x49e5c4 main + 27 (AppDelegate.swift:27)
15 ???                            0x1f049c344 (Missing)

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

PODS:

  • Firebase/Analytics (11.1.0):
    • Firebase/Core
  • Firebase/Auth (11.1.0):
    • Firebase/CoreOnly
    • FirebaseAuth (~> 11.1.0)
  • Firebase/Core (11.1.0):
    • Firebase/CoreOnly
    • FirebaseAnalytics (~> 11.1.0)
  • Firebase/CoreOnly (11.1.0):
    • FirebaseCore (= 11.1.0)
  • Firebase/Crashlytics (11.1.0):
    • Firebase/CoreOnly
    • FirebaseCrashlytics (~> 11.1.0)
  • Firebase/RemoteConfig (11.1.0):
    • Firebase/CoreOnly
    • FirebaseRemoteConfig (~> 11.1.0)
  • FirebaseABTesting (11.1.0):
    • FirebaseCore (~> 11.0)
  • FirebaseAnalytics (11.1.0):
    • FirebaseAnalytics/AdIdSupport (= 11.1.0)
    • FirebaseCore (~> 11.0)
    • FirebaseInstallations (~> 11.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 8.0)
    • GoogleUtilities/MethodSwizzler (~> 8.0)
    • GoogleUtilities/Network (~> 8.0)
    • "GoogleUtilities/NSData+zlib (~> 8.0)"
    • nanopb (~> 3.30910.0)
  • FirebaseAnalytics/AdIdSupport (11.1.0):
    • FirebaseCore (~> 11.0)
    • FirebaseInstallations (~> 11.0)
    • GoogleAppMeasurement (= 11.1.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 8.0)
    • GoogleUtilities/MethodSwizzler (~> 8.0)
    • GoogleUtilities/Network (~> 8.0)
    • "GoogleUtilities/NSData+zlib (~> 8.0)"
    • nanopb (~> 3.30910.0)
  • FirebaseAppCheckInterop (11.1.0)
  • FirebaseAuth (11.1.0):
    • FirebaseAppCheckInterop (~> 11.0)
    • FirebaseAuthInterop (~> 11.0)
    • FirebaseCore (~> 11.0)
    • FirebaseCoreExtension (~> 11.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 8.0)
    • GoogleUtilities/Environment (~> 8.0)
    • GTMSessionFetcher/Core (~> 3.4)
    • RecaptchaInterop (~> 100.0)
  • FirebaseAuthInterop (11.1.0)
  • FirebaseCore (11.1.0):
    • FirebaseCoreInternal (~> 11.0)
    • GoogleUtilities/Environment (~> 8.0)
    • GoogleUtilities/Logger (~> 8.0)
  • FirebaseCoreExtension (11.1.0):
    • FirebaseCore (~> 11.0)
  • FirebaseCoreInternal (11.1.0):
    • "GoogleUtilities/NSData+zlib (~> 8.0)"
  • FirebaseCrashlytics (11.1.0):
    • FirebaseCore (~> 11.0)
    • FirebaseInstallations (~> 11.0)
    • FirebaseRemoteConfigInterop (~> 11.0)
    • FirebaseSessions (~> 11.0)
    • GoogleDataTransport (~> 10.0)
    • GoogleUtilities/Environment (~> 8.0)
    • nanopb (~> 3.30910.0)
    • PromisesObjC (~> 2.4)
  • FirebaseInstallations (11.1.0):
    • FirebaseCore (~> 11.0)
    • GoogleUtilities/Environment (~> 8.0)
    • GoogleUtilities/UserDefaults (~> 8.0)
    • PromisesObjC (~> 2.4)
  • FirebaseRemoteConfig (11.1.0):
    • FirebaseABTesting (~> 11.0)
    • FirebaseCore (~> 11.0)
    • FirebaseInstallations (~> 11.0)
    • FirebaseRemoteConfigInterop (~> 11.0)
    • FirebaseSharedSwift (~> 11.0)
    • GoogleUtilities/Environment (~> 8.0)
    • "GoogleUtilities/NSData+zlib (~> 8.0)"
  • FirebaseRemoteConfigInterop (11.1.0)
  • FirebaseSessions (11.1.0):
    • FirebaseCore (~> 11.0)
    • FirebaseCoreExtension (~> 11.0)
    • FirebaseInstallations (~> 11.0)
    • GoogleDataTransport (~> 10.0)
    • GoogleUtilities/Environment (~> 8.0)
    • GoogleUtilities/UserDefaults (~> 8.0)
    • nanopb (~> 3.30910.0)
    • PromisesSwift (~> 2.1)
  • FirebaseSharedSwift (11.1.0)
  • GoogleAppMeasurement (11.1.0):
    • GoogleAppMeasurement/AdIdSupport (= 11.1.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 8.0)
    • GoogleUtilities/MethodSwizzler (~> 8.0)
    • GoogleUtilities/Network (~> 8.0)
    • "GoogleUtilities/NSData+zlib (~> 8.0)"
    • nanopb (~> 3.30910.0)
  • GoogleAppMeasurement/AdIdSupport (11.1.0):
    • GoogleAppMeasurement/WithoutAdIdSupport (= 11.1.0)
    • GoogleUtilities/AppDelegateSwizzler (~> 8.0)
    • GoogleUtilities/MethodSwizzler (~> 8.0)
    • GoogleUtilities/Network (~> 8.0)
    • "GoogleUtilities/NSData+zlib (~> 8.0)"
    • nanopb (~> 3.30910.0)
  • GoogleAppMeasurement/WithoutAdIdSupport (11.1.0):
    • GoogleUtilities/AppDelegateSwizzler (~> 8.0)
    • GoogleUtilities/MethodSwizzler (~> 8.0)
    • GoogleUtilities/Network (~> 8.0)
    • "GoogleUtilities/NSData+zlib (~> 8.0)"
    • nanopb (~> 3.30910.0)
  • GoogleDataTransport (10.1.0):
    • nanopb (~> 3.30910.0)
    • PromisesObjC (~> 2.4)
  • GoogleSignIn (8.0.0):
    • AppAuth (< 2.0, >= 1.7.3)
    • AppCheckCore (~> 11.0)
    • GTMAppAuth (< 5.0, >= 4.1.1)
    • GTMSessionFetcher/Core (~> 3.3)
  • GoogleTagManager (8.0.0):
    • FirebaseAnalytics (~> 11.0)
  • GoogleUtilities/AppDelegateSwizzler (8.0.2):
    • GoogleUtilities/Environment
    • GoogleUtilities/Logger
    • GoogleUtilities/Network
    • GoogleUtilities/Privacy
  • GoogleUtilities/Environment (8.0.2):
    • GoogleUtilities/Privacy
  • GoogleUtilities/Logger (8.0.2):
    • GoogleUtilities/Environment
    • GoogleUtilities/Privacy
  • GoogleUtilities/MethodSwizzler (8.0.2):
    • GoogleUtilities/Logger
    • GoogleUtilities/Privacy
  • GoogleUtilities/Network (8.0.2):
    • GoogleUtilities/Logger
    • "GoogleUtilities/NSData+zlib"
    • GoogleUtilities/Privacy
    • GoogleUtilities/Reachability
  • "GoogleUtilities/NSData+zlib (8.0.2)":
    • GoogleUtilities/Privacy
  • GoogleUtilities/Privacy (8.0.2)
  • GoogleUtilities/Reachability (8.0.2):
    • GoogleUtilities/Logger
    • GoogleUtilities/Privacy
  • GoogleUtilities/UserDefaults (8.0.2):
    • GoogleUtilities/Logger
    • GoogleUtilities/Privacy
  • GSKStretchyHeaderView (1.0.4)
  • GTMAppAuth (4.1.1):
    • AppAuth/Core (~> 1.7)
    • GTMSessionFetcher/Core (< 4.0, >= 3.3)
  • GTMSessionFetcher/Core (3.5.0)
    ....

DEPENDENCIES:

  • Firebase/Analytics
  • Firebase/Auth
  • Firebase/Crashlytics
  • Firebase/RemoteConfig
  • GoogleSignIn
  • GoogleTagManager
    ...

SPEC REPOS:
https://github.com/CocoaPods/Specs.git:
- Firebase
- FirebaseABTesting
- FirebaseAnalytics
- FirebaseAppCheckInterop
- FirebaseAuth
- FirebaseAuthInterop
- FirebaseCore
- FirebaseCoreExtension
- FirebaseCoreInternal
- FirebaseCrashlytics
- FirebaseInstallations
- FirebaseRemoteConfig
- FirebaseRemoteConfigInterop
- FirebaseSessions
- FirebaseSharedSwift
- GoogleAppMeasurement
- GoogleDataTransport
- GoogleSignIn
- GoogleTagManager
- GoogleUtilities
- GSKStretchyHeaderView
- GTMAppAuth
- GTMSessionFetcher
...

SPEC CHECKSUMS:
Firebase: fdb3bd378401f26a7adfcf446b0a630f8c20c0e8
FirebaseABTesting: c2e22c3aab99afa81d0561708b2c1c356c556976
FirebaseAnalytics: 9fcdb2e9844174bb405b34cc47092c9b91993d83
FirebaseAppCheckInterop: e59b52f2c0e188e6ba77b9e3f6acead2117f2abf
FirebaseAuth: 7348b13e29d46f4a9aa9a343cffa80449db8b116
FirebaseAuthInterop: 49e8faefaf254ce578e278a84a8fe0aebe23b546
FirebaseCore: 6e2a2782e234b14d48e880ed369ac55cda87fed7
FirebaseCoreExtension: aa5c9779c2d0d39d83f1ceb3fdbafe80c4feecfa
FirebaseCoreInternal: adefedc9a88dbe393c4884640a73ec9e8e790f8c
FirebaseCrashlytics: 95cfe27373ff2edab39c28583d93cbf2dfff401d
FirebaseInstallations: d0a8fea5a6fa91abc661591cf57c0f0d70863e57
FirebaseRemoteConfig: 05521e937b72e01847a7128da5a492327364c705
FirebaseRemoteConfigInterop: abf8b1bbc0bf1b84abd22b66746926410bf91a87
FirebaseSessions: 78f137e68dc01ca71606169ba4ac73b98c13752a
FirebaseSharedSwift: 260a35e08943ec810d820a70bc0359136351d0c5
GoogleAppMeasurement: 8bb20efc67c8fc1cff9c42a06c256caf55289bbf
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
GoogleSignIn: ce8c89bb9b37fb624b92e7514cc67335d1e277e4
GoogleTagManager: 05f257a9afe6e1d6da24f0ee37ab255ce34108b6
GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d
GSKStretchyHeaderView: 9743704c12bdc9cf7c7947bad3af8bf24f7061e3
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
....

PODFILE CHECKSUM: ...

COCOAPODS: 1.15.2

@ncooke3
Copy link
Member

ncooke3 commented Aug 28, 2024

Hi @remziyildirim, sorry for the trouble. Do you have a full crash report that shows what all of the threads were doing at the time of the crash?

@ncooke3 ncooke3 self-assigned this Aug 28, 2024
@remziyildirim
Copy link
Author

Hi @ncooke3, sorry I missed it. Full details of the crash with threads are below

Crashed: com.apple.main-thread
SIGTRAP 0x0000000103a84054

0  FirebaseAuth                   0x10054 closure #1 in closure #1 in Auth.fetchSignInMethods(forEmail:) + 116
1  FirebaseAuth                   0x25270 partial apply for thunk for @escaping @callee_guaranteed (@guaranteed AuthDataResult?, @guaranteed Error?) -> () + 24 (<compiler-generated>:24)
2  FirebaseAuth                   0x6dd64 partial apply for specialized closure #1 in static Auth.wrapMainAsync<A>(callback:withParam:error:) + 40
3  FirebaseAuth                   0xd664 thunk for @escaping @callee_guaranteed () -> () + 28
4  libdispatch.dylib              0x213c _dispatch_call_block_and_release + 32
5  libdispatch.dylib              0x3dd4 _dispatch_client_callout + 20
6  libdispatch.dylib              0x125a4 _dispatch_main_queue_drain + 988
7  libdispatch.dylib              0x121b8 _dispatch_main_queue_callback_4CF + 44
8  CoreFoundation                 0x56710 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
9  CoreFoundation                 0x53914 __CFRunLoopRun + 1996
10 CoreFoundation                 0x52cd8 CFRunLoopRunSpecific + 608
11 GraphicsServices               0x11a8 GSEventRunModal + 164
12 UIKitCore                      0x40a90c -[UIApplication _run] + 888
13 UIKitCore                      0x4be9d0 UIApplicationMain + 340
14 HOLIDAY_PIRATES                0x49e5c4 main + 27 (AppDelegate.swift:27)
15 ???                            0x1abc09e4c (Missing)
Thread 1
0  libsystem_kernel.dylib         0x1590 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4980 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x10cc start_wqthread + 8
com.apple.uikit.eventfetch-thread

0  libsystem_kernel.dylib         0x1808 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x5008 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4f20 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0x4d60 mach_msg + 24
4  CoreFoundation                 0x53f5c __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x53600 __CFRunLoopRun + 1208
6  CoreFoundation                 0x52cd8 CFRunLoopRunSpecific + 608
7  Foundation                     0xc7e4c -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8  Foundation                     0xc7c9c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9  UIKitCore                      0x41e640 -[UIEventFetcher threadMain] + 420
10 Foundation                     0xde718 __NSThread__start__ + 732
11 libsystem_pthread.dylib        0x606c _pthread_start + 136
12 libsystem_pthread.dylib        0x10d8 thread_start + 8
com.google.firebase.crashlytics.MachExceptionServer

0  libsystem_kernel.dylib         0x1808 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x5008 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4f20 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0x4d60 mach_msg + 24
4  FirebaseCrashlytics            0x1756c FIRCLSMachExceptionServer + 196 (FIRCLSMachException.c:196)
5  libsystem_pthread.dylib        0x606c _pthread_start + 136
6  libsystem_pthread.dylib        0x10d8 thread_start + 8
 KSCrash Exception Handler (Secondary)

0  libsystem_kernel.dylib         0x1808 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x5008 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4f20 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0x4d60 mach_msg + 24
4  Bugsnag                        0xba60 ksmachexc_i_handleExceptions + 229 (BSG_KSCrashSentry_MachException.c:229)
5  libsystem_pthread.dylib        0x606c _pthread_start + 136
6  libsystem_pthread.dylib        0x10d8 thread_start + 8
com.apple.NSURLConnectionLoader

0  libsystem_kernel.dylib         0x1808 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x5008 mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x4f20 mach_msg_overwrite + 436
3  libsystem_kernel.dylib         0x4d60 mach_msg + 24
4  CoreFoundation                 0x53f5c __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x53600 __CFRunLoopRun + 1208
6  CoreFoundation                 0x52cd8 CFRunLoopRunSpecific + 608
7  CFNetwork                      0xfdc90 _CFHostIsDomainTopLevel + 108176
8  Foundation                     0xde718 __NSThread__start__ + 732
9  libsystem_pthread.dylib        0x606c _pthread_start + 136
10 libsystem_pthread.dylib        0x10d8 thread_start + 8
Thread 2
0  libsystem_kernel.dylib         0x1590 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4980 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x10cc start_wqthread + 8
Thread 3

0  libsystem_kernel.dylib         0x1590 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4980 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x10cc start_wqthread + 8
Thread 4

0  libsystem_kernel.dylib         0x1590 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4980 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x10cc start_wqthread + 8
Thread 5

0  libsystem_kernel.dylib         0x1590 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0x4980 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0x10cc start_wqthread + 8   
JavaScriptCore libpas scavenger

0  libsystem_kernel.dylib         0x71cc __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x36e4 _pthread_cond_wait + 1228
2  JavaScriptCore                 0x155b0a4 scavenger_thread_main + 1512
3  libsystem_pthread.dylib        0x606c _pthread_start + 136
4  libsystem_pthread.dylib        0x10d8 thread_start + 8
Heap Helper Thread

0  libsystem_kernel.dylib         0x71cc __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x36e4 _pthread_cond_wait + 1228
2  JavaScriptCore                 0x82c3c WTF::ThreadCondition::timedWait(WTF::Mutex&, WTF::WallTime) + 240
3  JavaScriptCore                 0x53a1c WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2072
4  JavaScriptCore                 0xaff0 WTF::Detail::CallableWrapper<WTF::AutomaticThread::start(WTF::AbstractLocker const&)::$_0, void>::call() + 460
5  JavaScriptCore                 0x7fe88 WTF::Thread::entryPoint(WTF::Thread::NewThreadContext*) + 352
6  JavaScriptCore                 0x82328 WTF::wtfThreadEntryPoint(void*) + 16
7  libsystem_pthread.dylib        0x606c _pthread_start + 136
8  libsystem_pthread.dylib        0x10d8 thread_start + 8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants