Skip to content

fix(auth,apple): prevent EXC_BAD_ACCESS crash in Apple Sign-In completion handler #17273

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukemmtt
Copy link

@lukemmtt lukemmtt commented Apr 12, 2025

Fixes a crash where Firebase Auth's Apple Sign-In handler crashes with EXC_BAD_ACCESS on iOS/macOS when the completion handler is deallocated during async operations.

Specifically:

  • Captures appleCompletion locally within handleSignInWithApple to prevent deallocation
  • Adds nil check before calling the completion handler
  • Creates strong references for callbacks in async operations

Affects both iOS and macOS platforms through the shared implementation.

Closes #17216.

Copy link

google-cla bot commented Apr 12, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

…tion handler

- Locally captures completion handler to prevent deallocation
- Fixes crash during async Apple Sign-In operations
@lukemmtt lukemmtt force-pushed the apple-sign-in-fix branch from 673e3e5 to 7ab5067 Compare April 12, 2025 19:15
@lukemmtt lukemmtt marked this pull request as ready for review April 12, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[firebase_auth]: handleSignInWithApple EXC_BAD_ACCESS (KERN_INVALID_ADDRESS)
1 participant