[Database][Android] SIGSEGV in Database::DeleteInternal when embedded bridge-class init fails; FindClassInFiles passes JNI-form names to loadClass on Android
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start with FindClassInFiles in app/src/util_android.cc, where the Android branch passes the JNI-form name to loadClass without the slash-to-dot replacement the desktop branch does. The second part is Database::GetInstance and Database::DeleteInternal, where a null App* is dereferenced on init failure; the reporter's tombstone points there. Done when the Android branch converts separators like the desktop branch, and a failed init returns an error instead of crashing. Check the existing tests for both paths before changing them.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[Database][Android] SIGSEGV in Database::DeleteInternal when embedded bridge-class init fails; FindClassInFiles passes JNI-form names to loadClass on Android
SDK: Firebase C++ SDK 13.12.0, Realtime Database (libFirebaseCppApp-13_12_0.so), arm64 Android.
Two related defects, one crash. Reporting both together because the second turns the first from "error return" into "process death".
1. Init failure crashes instead of returning an error (the SIGSEGV)
When Database::GetInstance cannot finish DatabaseInternal init (in our case: embedded Java bridge classes fail to resolve, see §2), the code path ends in delete database → Database::DeleteInternal, which dereferences a null App* (MakeKey(app=null) → app->name()).
Tombstone (deterministic, every run once the init fails):
signal 11 (SIGSEGV), SEGV_MAPERR, fault addr 0x8 (null+8 read)
#00 libFirebaseCppApp-13_12_0.so firebase::database::Database::DeleteInternal()+192
#01 libFirebaseCppApp-13_12_0.so firebase::database::Database::GetInstance(...)+792
#02 libFirebaseCppApp-13_12_0.so Firebase_Database_CSharp_InternalFirebaseDatabase_GetInstanceInternal
Expected: init failure returns an error / null instance. Actual: SIGSEGV. This half is environment-independent — any init failure ends in a crash rather than a diagnosable error, which is also what made §2 so hard to root-cause (no error, just death).
2. Android branch of FindClassInFiles skips the slash→dot conversion the desktop branch does
app/src/util_android.cc, FindClassInFiles (verified on current main):
- Desktop branch converts before calling
loadClass:
withstd::string class_name_str(class_name); std::replace(class_name_str.begin(), class_name_str.end(), kPathSeparator, '.');LogDebug("Load class %s (a.k.a. %s)", ...). - Android branch passes the raw JNI-form name straight into
DexClassLoader.loadClass:LogDebug("Load class %s", class_name); jstring class_name_object = env->NewStringUTF(class_name); ... kLoadClass ...
ClassLoader.loadClass takes binary names (dotted). On typical standalone apps ART tolerates the slashed form so nobody notices; under a custom class-loader setup the lookup fails. Preceding log line in our runs:
E firebase: Java class com/google/firebase/database/internal/cpp/CppTransactionHandler not found.
Suggested fix: the same 3-line std::replace in the Android branch — makes both branches consistent, zero behavior change where lookup already succeeds.
Environment (disclosed so this isn't mis-triaged)
The game runs hosted in another app's process (launcher creates the game context via createPackageContext and hosts its activity). That is why the class-loader topology differs from standalone and why §2 bites here first. But §1 needs no hosted setup to matter: any GetInstance init failure on any app crashes today. And §2 is a contract violation that only happens to work standalone.
Happy to attach the full tombstone + logcat and to test a patched build. Thanks for the SDK.
- Lenguaje dominante
- C++
- Estrellas
- 326
- Forks
- 137
- Merge medio
- 2 d 5 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de firebase/firebase-cpp-sdk
-
[FR] Support desktop Linux on aarch64/arm (#error Unknown Linux architecture in app_common.cc)Abiertonew type: question
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
firebase/firebase-cpp-sdk#1926 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
firebase/firebase-cpp-sdk#1905 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
firebase/firebase-cpp-sdk#1935 ·
Los mantenedores suelen responder en 3 días
-
[Bug] Desktop Auth token refresh ignores UseEmulator() and targets productionPosiblemente ocupada @AustinBenoit la tomó hace 1 día. Abiertoapi: auth type: bug
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
firebase/firebase-cpp-sdk#1934 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 3 días
-
api: firestore
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
firebase/firebase-cpp-sdk#1920 · 3 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de firebase/firebase-cpp-sdk
Issues similares
-
[Cleanup] Include the public header in work_split.cppPosiblemente ocupada @blozano-tt la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tenstorrent/tt-metal#60850 ·
Los mantenedores suelen responder en 1 día
-
core: RAC_LLM_OPTIONS_DEFAULT.min_p disagrees with the IDL's annotated defaultPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug core p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
RunanywhereAI/runanywhere-sdks#1083 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
tesseract-ocr/tesseract#4653 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
comp-datalake performance
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
ClickHouse/ClickHouse#126044 ·
Los mantenedores suelen responder en 1 día