firebase / firebase-ios-sdk

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

AuthBackendRPCImplementation Crashes (Firebase v11.2) #13650

Closed ondrejkorol closed 3 days ago

ondrejkorol commented 4 days ago

Description

Hi Firebase team,

I’ve encountered crash in my app after updating to Firebase 11.2.0 and GoogleSignIn 8.0.0. The crash is reported by Crashlytics and has occurred on user devices running iOS 17.6.1. I’m using Xcode 15.4 for development and publishing the app. I can't reproduce it locally.

We discussed this crash in this GitHub thread but I was advised to open a new issue here.

There are two "different crashes" so far: Crash Details: • Exception Type: EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000003 • Thread: com.apple.root.user-initiated-qos.cooperative • Affected File: AuthBackend.swift - Line 143 • Function: specialized AuthBackendRPCImplementation.callInternal(with:) + 143

The first crash stack trace: app_issue_466ae93783cfc5e3010951fc92f6e334_crash_session_c89332271f904df98a543d8daf437162_DNE_0_v2_stacktrace.txt second.crash_issue_466ae93783cfc5e3010951fc92f6e334_crash_session_449ef354ab5e4450b4e53a2fde399be3_DNE_0_v2_stacktrace.txt

A different stack trace: crash.type2.txt

I'd appreciate any guidance on how to mitigate this crash. Please let me know if you need any additional information to help diagnose this issue.

Thank you for your assistance.

Best regards,

Ondrej

Reproducing the issue

No response

Firebase SDK Version

11.2

Xcode Version

15.4

Installation Method

Swift Package Manager

Firebase Product(s)

Authentication, Crashlytics, Firestore, Messaging

Targeted Platforms

iOS

Relevant Log Output

No response

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

No response

If using CocoaPods, the project's Podfile.lock

No response

google-oss-bot commented 4 days ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

ncooke3 commented 4 days ago

Hi @ondrejkorol, thanks for opening the issue! I just merged #13647 will should hopefully address the problem. I wasn't able to reproduce it, but my rationale from looking at the stack trace is that the shared concurrency queue (com.apple.root.user-initiated-qos.cooperative) is being blocked by a call to [FIRHeartbeatLogger headerValue] which makes a synchronous dispatch to a different queue. Swift concurrency's shared co-op queue should not be blocked (Swift forums), so the SDK has been changed to execute that synchronous call onto another thread of the queue.

I suspect the second kind of crash is related since it does have the same Crashed: stack, but it is interesting so I will investigate it a bit more.

Crashed: com.apple.root.user-initiated-qos.cooperative
0  libswiftCore.dylib             0x4043a4 swift_unknownObjectRetain + 48
...
ondrejkorol commented 4 days ago

That sounds great! I really appreciate your fast response and the whole team’s support. So I guess I should wait for a new Firebase version, and then we can try that.

Yeah, it's tricky as it's not easily reproducible, right? Let me know if I can help somehow. Cheers!

ncooke3 commented 3 days ago

So I guess I should wait for a new Firebase version, and then we can try that.

Yes, @ondrejkorol. Though in the meantime, I do have some tips that may help reproduce it:

ncooke3 commented 3 days ago

Between #13647 and #13658, this issue should be addressed in the next Firebase 11.3 release.

fanwgwg commented 2 days ago

@ncooke3 +1 Thank you for your information. This is now starting to impact our users in production and causing crashes. When will be a new release containing these fixes?

ajunjunandtmac commented 1 day ago

@ncooke3 +1 Thank you for your information. This is now starting to impact our users in production and causing crashes. When will be a new release containing these fixes?

same issue, and cause a lot of crashes.