firebase / firebase/firebase-cpp-sdk
[Question] heap-use-after-free after deleting database::DatabaseReference
- 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: open source from this repo
* Firebase C++ SDK version: all
* Main Firebase Components in concern: Database
* Other Firebase Components in use: -
* Platform you are using the C++ SDK on: Linux
* Platform you are targeting: iOS, Android, Destkop
### [REQUIRED] Please describe the question here:
I have lot of issue with "heap-use-after-free". To what I understand, the issue is linked to the fact reference is removed while beeing still in use in the SDK. When I made some "get" I just wait for the onFinish callback to be sure that firebase SDK don't need the reference anymore. But when using with Listener (ValueListener or ChildListener) we have no callback saying that the remove listener is finished. Then it's not clear when the reference can be safely destroyed. I tried lot of different approach but I always ends in use after free issue. Where can I find more informations about when a reference can be destroyed without risking a crash ?
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par examiner la durée de vie de DatabaseReference et le comportement de suppression des listeners décrits dans l’issue, notamment ValueListener, ChildListener et le callback onFinish utilisé pour les opérations get. Déterminez quand une référence peut être détruite en toute sécurité sans provoquer de heap-use-after-free, et documentez ou reproduisez le comportement attendu lors de la suppression des listeners.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp
- Domaine
- databases
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 20/100