firebase / firebase/firebase-cpp-sdk

[Question] Assert in auth.cc line 119 when trying to create Auth

Ouverte
#1,680 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
needs-triage new type: question
Langage dominant
C++
Étoiles
326
Forks
137
Merge moyen
3 j 9 h
PR mergées (30 j)
5

Description

### [REQUIRED] Please fill in the following fields:

* Pre-built SDK from the [website](https://firebase.google.com/download/cpp) or open-source from this repo: Pre-build SDK
* Firebase C++ SDK version: 12.1.0
* Main Firebase Components in concern: Auth (Auth, Database, etc.)
* Other Firebase Components in use: App,Firestore,Storage (Auth, Database, etc.)
* Platform you are using the C++ SDK on: Windows (Mac, Windows, or Linux)
* Platform you are targeting: iOS, Android (iOS, Android, and/or desktop)

### [REQUIRED] Please describe the question here:

I was not able to reproduce the issue on test-app where auth example works properly on desktop.

Issue occurs only on Desktop when using c++ wrapper on Windows (Android and iOS works fine)

I'm following general FirebaseApp creation:

`m_App = firebase::App::Create();`

later on when i try to get Auth by calling this code: (from the same thread)

```
firebase::App* app = FirebaseApp::Get();
if (!app)
return nullptr;

firebase::auth::Auth* auth = firebase::auth::Auth::GetAuth(app);
if (!auth)
return nullptr;

return auth;
```

I'm getting hard crash with assert from [auth.cc line 119](https://github.com/firebase/firebase-cpp-sdk/blob/main/auth/src/auth.cc#L119)

If I try to create auth immediately after creating app i will get a proper object but then calling eg.:

`firebase::Future result = auth->SignInAnonymously();`

Result in exact same assert.

Can you please assist what may be the cause? Is there some kind of releasing object under the hood?

![Image](https://github.com/user-attachments/assets/c3699405-f0d8-42bb-a642-bcdffe92be04)
![Image](https://github.com/user-attachments/assets/f9ba7440-19e1-43ff-a057-664a3a626df2)
![Image](https://github.com/user-attachments/assets/092a1908-d490-48ee-bce4-d3ff94608250)

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par auth/src/auth.cc à la ligne 119 et comparez le flux Windows desktop signalé avec l’exemple auth fonctionnel dans test-app. Reproduisez la séquence en utilisant App::Create, Auth::GetAuth et SignInAnonymously sur le même thread. Le travail est terminé lorsque la cause de l’assertion a été identifiée et qu’une résolution vérifiée pour le cas Windows desktop a été documentée ou implémentée.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
cpp
Domaine
authentication
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.