firebase / firebase-ios-sdk

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

[Auth] Use native Swift types in Auth backend types #13658

Closed ncooke3 closed 1 month ago

ncooke3 commented 1 month ago

Follow-up to #13647 to further attempt to fix #13650.

The crash reports from #13650 show swift_unknownObjectRetain as the last frame in the terminating thread.

Using a symbolic breakpoint, I verified that swift_unknownObjectRetain gets called to get the rpcIssuer used below: https://github.com/firebase/firebase-ios-sdk/blob/b5e2c182c83db543829f2a712f5cff7e6ad1ce1e/FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift#L274-L275

Stepping through the assembly from swift_unknownObjectRetain, the objc_retain is returned from its source.

When I removed the NSObject conformances and debugged again, swift_unknownObjectRetain is no longer called. I thought this was pretty interesting and will guarantee that should #13650 reappear, the report will at least look different as the object in question will have its memory managed differently as a native Swift type.