Skip to content

Possible Deadlock on nativeOnIdTokenChanged causing ANRs #82

@Originator99

Description

@Originator99

Please fill in the following fields:

Pre-built SDK from the website or open-source from this repo: Website
Firebase C++ SDK version: 6.10.0
Firebase plugins in use (Auth, Database, etc.): Auth, Analytics, Crashlytics, Remote Config
Additional SDKs you are using (Facebook, AdMob, etc.): Facebook, AdMob, Play Services
Platform you are using the C++ SDK on (Mac, Windows, or Linux): Windows
Platform you are targeting (iOS, Android, and/or desktop): Android and iOS

Please describe the issue here:

This has Increased the rate in ANRs. Can't seem to figure out how to recreate it but here's the call stack :

> "main" prio=5 tid=1 Native
>   | group="main" sCount=1 dsCount=0 flags=1 obj=0x71dbab60 self=0x7f882dd000
>   | sysTid=14965 nice=-10 cgrp=default sched=0/0 handle=0x7f8984aed0
>   | state=S schedstat=( 12569163447 4218847736 32466 ) utm=807 stm=449 core=1 HZ=100
>   | stack=0x7fd21d9000-0x7fd21db000 stackSize=8192KB
>   | held mutexes=
>   #00  pc 000000000008023c  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
>   #01  pc 000000000008383c  /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
>   #02  pc 00000000000e31c8  /apex/com.android.runtime/lib64/bionic/libc.so (NonPI::MutexLockWithTimeout(pthread_mutex_internal_t*, bool, timespec const*)+640)
>   #03  pc 0000000000187b10  /data/app/cricketgames.hitwicket.strategy-3KjijTeuMrAQofDmPFGTqg==/lib/arm64/libFirebaseCppApp-6_10_0.so (firebase::Mutex::Acquire()+4)
>   #04  pc 0000000000196810  /data/app/cricketgames.hitwicket.strategy-3KjijTeuMrAQofDmPFGTqg==/lib/arm64/libFirebaseCppApp-6_10_0.so (firebase::auth::UpdateCurrentUser(firebase::auth::AuthData*)+36)
>   #05  pc 0000000000196c8c  /data/app/cricketgames.hitwicket.strategy-3KjijTeuMrAQofDmPFGTqg==/lib/arm64/libFirebaseCppApp-6_10_0.so (firebase::auth::JniIdTokenListener_nativeOnIdTokenChanged(_JNIEnv*, _jobject*, long)+24)
>   #06  pc 0000000000140350  /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+144)
>   #07  pc 0000000000137334  /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
>   #08  pc 000000000014606c  /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244)
>   #09  pc 00000000002e0c94  /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384)
>   #10  pc 00000000002dbf74  /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912)
>   #11  pc 000000000059c450  /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+400)
>   #12  pc 0000000000131914  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
>   #13  pc 0000000000000d68  [anon:dalvik-classes.dex (com.google.firebase.auth.internal.cpp.JniIdTokenListener.access$200)
>   #14  pc 000000000059cf5c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136)
>   #15  pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20)
>   #16  pc 0000000000000cde  [anon:dalvik-classes.dex (com.google.firebase.auth.internal.cpp.JniIdTokenListener$1.run+54)
>   #17  pc 000000000059bbb4  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1740)
>   #18  pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20)
>   #19  pc 00000000000007a4  [anon:dalvik-classes.dex (com.google.firebase.auth.internal.cpp.AuthCommon.safeRunNativeMethod)
>   #20  pc 000000000059cf5c  /apex/com.android.runtime/lib64/libart.so (MterpInvokeStatic+1136)
>   #21  pc 0000000000131994  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_static+20)
>   #22  pc 0000000000000dbe  [anon:dalvik-classes.dex (com.google.firebase.auth.internal.cpp.JniIdTokenListener.onIdTokenChanged+10)
>   #23  pc 000000000059bbb4  /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1740)
>   #24  pc 0000000000131a14  /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20)
>   #25  pc 0000000000427620  /data/app/cricketgames.hitwicket.strategy-3KjijTeuMrAQofDmPFGTqg==/oat/arm64/base.vdex (com.google.firebase.auth.zzm.run+104)
>   #26  pc 00000000002b18e0  /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.13287019079350186260)+240)
>   #27  pc 000000000058b6b8  /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012)
>   #28  pc 0000000000140468  /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88)
>   at com.google.firebase.auth.internal.cpp.JniIdTokenListener.nativeOnIdTokenChanged (Native method)
>   at com.google.firebase.auth.internal.cpp.JniIdTokenListener.access$200 (JniIdTokenListener.java:24)
>   at com.google.firebase.auth.internal.cpp.JniIdTokenListener$1.run (JniIdTokenListener.java:61)
> - locked <0x074c10d5> (a java.lang.Object)
>   at com.google.firebase.auth.internal.cpp.AuthCommon.safeRunNativeMethod (AuthCommon.java:32)
>   at com.google.firebase.auth.internal.cpp.JniIdTokenListener.onIdTokenChanged (JniIdTokenListener.java:56)
>   at com.google.firebase.auth.zzm.run
>   at android.os.Handler.handleCallback (Handler.java:883)
>   at android.os.Handler.dispatchMessage (Handler.java:100)
>   at com.google.android.gms.internal.firebase_auth.zzj.dispatchMessage
>   at android.os.Looper.loop (Looper.java:237)
>   at android.app.ActivityThread.main (ActivityThread.java:7814)
>   at java.lang.reflect.Method.invoke (Native method)
>   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
>   at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1068)

What's the issue repro rate? (eg 100%, 1/5 etc) : Every 1 in 100 users being effected by this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions