Skip to content

art::ConditionVariable::WaitHoldingLocks(art::Thread*) #4985

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

Closed
trong-le123 opened this issue May 5, 2023 · 10 comments
Closed

art::ConditionVariable::WaitHoldingLocks(art::Thread*) #4985

trong-le123 opened this issue May 5, 2023 · 10 comments

Comments

@trong-le123
Copy link

trong-le123 commented May 5, 2023

  • Libraries used:
    implementation 'com.google.firebase:firebase-crashlytics:18.3.7'
    implementation 'com.google.firebase:firebase-core:21.1.1'
    implementation 'com.google.firebase:firebase-analytics:21.2.2'
    implementation 'com.google.firebase:firebase-messaging:23.1.2'

  • Issue
    I am running into a issue where the app spins for a while and then ends up crashing with an ANR dialog.

    Crashlytics Exception Handler1 (runnable):tid=19 systid=10160
    at libcore.io.ForwardingOs.fdatasync(ForwardingOs.java:256)
    at android.system.Os.fdatasync(Os.java:187)
    at java.io.RandomAccessFile.maybeSync(RandomAccessFile.java:306)
    at java.io.RandomAccessFile.writeBytes(RandomAccessFile.java:547)
    at java.io.RandomAccessFile.write(RandomAccessFile.java:559)
    at com.google.firebase.crashlytics.internal.metadata.QueueFile.writeHeader(QueueFile.java:58)
    at com.google.firebase.crashlytics.internal.metadata.QueueFile.add(QueueFile.java:91)
    at com.google.firebase.crashlytics.internal.metadata.QueueFile.add(QueueFile.java:91)
    at com.google.firebase.crashlytics.internal.metadata.QueueFileLogStore.doWriteToLog(QueueFileLogStore.java:90)
    at com.google.firebase.crashlytics.internal.metadata.QueueFileLogStore.writeToLog(QueueFileLogStore.java:90)
    at com.google.firebase.crashlytics.internal.metadata.LogFileManager.writeToLog(LogFileManager.java:28)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsController$5.call(CrashlyticsController.java:28)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsController$5.call(CrashlyticsController.java:28)
    at com.google.firebase.crashlytics.internal.common.CrashlyticsBackgroundWorker$3.then(CrashlyticsBackgroundWorker.java:2)
    at com.google.android.gms.tasks.zzc.run(zzc.java:70)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
    at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:2)
    at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:5)
    at java.lang.Thread.run(Thread.java:1012)

That is the error returned and the rest of the log is different threads be ran

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@argzdev
Copy link
Contributor

argzdev commented May 5, 2023

Hey @trong-le123, thanks for reaching out. Not sure what the issue is here, I've tried testing the latest version of Crashlytics and it seems to work fine. Could you provide a minimal reproducible example of your issue? It'll help speed up our investigation. Thanks!

@trong-le123
Copy link
Author

Unfortunately I don't have any code stripped down enough to share. Is there anything else I can provide to help with clarity?

@argzdev
Copy link
Contributor

argzdev commented May 8, 2023

Something seems to be conflicting with Crashlytics when it is trying to write logs

Could you help answer a few questions below:

  1. Was the issue present on the previous versions of Crashlytics?
  2. Is the issue persistently reproducible?
  3. Do you have an application class? If so, are you running multiple or expensive I/O operations in your Application class?

@trong-le123
Copy link
Author

  1. Yes, before updating to the newest versions of firebase. The crash was still occurring.
  2. Yes, the crash is reproducible in similar steps.
  3. Yes, the steps make multiple API server calls.

@argzdev
Copy link
Contributor

argzdev commented May 9, 2023

Thanks for the extra details, @trong-le123. In expectation, Crashlytics shouldn't be causing ANRs by writing logs, so I'm guessing something is triggering this, perhaps the multiple API server calls are causing too much of I/O operations on the main thread which in turn is causing IO Root blocking. You could try using StrictMode to detect any operations causing issues. However, without any code snippets or MCVE, it is difficult to determine the exact cause of your issue.

@krunalpatel3
Copy link

main (native):tid=1 systid=20388
#00 pc 0x7521c libc.so (syscall + 28) (BuildId: f24f65acf653c409ca4332aced817a71)
#1 pc 0x47a830 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 140) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#2 pc 0x55c14c libart.so (artQuickGenericJniEndTrampoline + 1156) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#3 pc 0x43e164 libart.so (art_quick_generic_jni_trampoline + 164) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#4 pc 0x208a718 memfd:jit-cache (android.view.InputEventReceiver.finishInputEvent + 520)
#5 pc 0x209ef6c memfd:jit-cache (android.view.ViewRootImpl.finishInputEvent + 876)
#6 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#7 pc 0x371ad0 framework.jar (android.view.ViewRootImpl.access$2100)
#8 pc 0x2175e0c memfd:jit-cache (android.view.ViewRootImpl$InputStage.onDeliverToNext + 1180)
#9 pc 0x20c92e0 memfd:jit-cache (android.view.ViewRootImpl$SyntheticInputStage.onDeliverToNext + 480)
#10 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#11 pc 0x36955c framework.jar (android.view.ViewRootImpl$InputStage.forward)
#12 pc 0x2097f90 memfd:jit-cache (android.view.ViewRootImpl$InputStage.deliver + 256)
#13 pc 0x2175de4 memfd:jit-cache (android.view.ViewRootImpl$InputStage.onDeliverToNext + 1140)
#14 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#15 pc 0x36c5dc framework.jar (android.view.ViewRootImpl$ViewPostImeInputStage.onDeliverToNext + 80)
#16 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#17 pc 0x36955c framework.jar (android.view.ViewRootImpl$InputStage.forward)
#18 pc 0x2186114 memfd:jit-cache (android.view.ViewRootImpl$InputStage.finish + 180)
#19 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#20 pc 0x36942a framework.jar (android.view.ViewRootImpl$InputStage.apply + 18)
#21 pc 0x20980d8 memfd:jit-cache (android.view.ViewRootImpl$InputStage.deliver + 584)
#22 pc 0x2175de4 memfd:jit-cache (android.view.ViewRootImpl$InputStage.onDeliverToNext + 1140)
#23 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#24 pc 0x36955c framework.jar (android.view.ViewRootImpl$InputStage.forward)
#25 pc 0x21d3264 memfd:jit-cache (android.view.ViewRootImpl$AsyncInputStage.forward + 132)
#26 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#27 pc 0x36941c framework.jar (android.view.ViewRootImpl$InputStage.apply + 4)
#28 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#29 pc 0x368a62 framework.jar (android.view.ViewRootImpl$AsyncInputStage.apply + 14)
#30 pc 0x20980d8 memfd:jit-cache (android.view.ViewRootImpl$InputStage.deliver + 584)
#31 pc 0x2175de4 memfd:jit-cache (android.view.ViewRootImpl$InputStage.onDeliverToNext + 1140)
#32 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#33 pc 0x36955c framework.jar (android.view.ViewRootImpl$InputStage.forward)
#34 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#35 pc 0x36941c framework.jar (android.view.ViewRootImpl$InputStage.apply + 4)
#36 pc 0x20980d8 memfd:jit-cache (android.view.ViewRootImpl$InputStage.deliver + 584)
#37 pc 0x217b0e8 memfd:jit-cache (android.view.ViewRootImpl.deliverInputEvent + 2024)
#38 pc 0x2175734 memfd:jit-cache (android.view.ViewRootImpl.doProcessInputEvents + 1588)
#39 pc 0x217f44c memfd:jit-cache (android.view.ViewRootImpl.enqueueInputEvent + 3196)
#40 pc 0x217a4c8 memfd:jit-cache (android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent + 1320)
#41 pc 0x21d2774 memfd:jit-cache (android.view.InputEventReceiver.dispatchInputEvent + 276)
#42 pc 0x43476c libart.so (art_quick_invoke_stub + 556) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#43 pc 0x4c87e8 libart.so (art::JValue art::InvokeVirtualOrInterfaceWithVarArgsart::ArtMethod*(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, std::__va_list) + 828) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#44 pc 0x5edcb8 libart.so (art::JNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list) + 140) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#45 pc 0x472ab0 libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType) (.__uniq.99033978352804627313491551960229047428) + 624) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#46 pc 0x5c63f0 libart.so (art::(anonymous namespace)::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list) (.__uniq.99033978352804627313491551960229047428.llvm.13572457048004851375) + 72) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#47 pc 0xae5e8 libandroid_runtime.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...) + 120) (BuildId: c646cf84c51fc07b4bb81680ce4aed68)
#48 pc 0x118d74 libandroid_runtime.so (android::NativeInputEventReceiver::consumeEvents(_JNIEnv*, bool, long, bool*) + 164) (BuildId: c646cf84c51fc07b4bb81680ce4aed68)
#49 pc 0x11a9a4 libandroid_runtime.so (android::nativeConsumeBatchedInputEvents(_JNIEnv*, _jclass*, long, long) + 116) (BuildId: c646cf84c51fc07b4bb81680ce4aed68)
#50 pc 0x43e154 libart.so (art_quick_generic_jni_trampoline + 148) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#51 pc 0x209a9c libart.so (nterp_helper + 1948) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#52 pc 0x32f9ba framework.jar (android.view.InputEventReceiver.consumeBatchedInputEvents + 34)
#53 pc 0x20a254 libart.so (nterp_helper + 3924) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#54 pc 0x36e948 framework.jar (android.view.ViewRootImpl.doConsumeBatchedInput + 8)
#55 pc 0x20c94e8 memfd:jit-cache (android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run + 232)
#56 pc 0x2176140 memfd:jit-cache (android.view.Choreographer$CallbackRecord.run + 368)
#57 pc 0x20eec7c memfd:jit-cache (android.view.Choreographer.doCallbacks + 2268)
#58 pc 0x20f837c memfd:jit-cache (android.view.ChoreographerExtImpl.checkScrollOptSceneEnable + 332)
#59 pc 0x20eba7c memfd:jit-cache (android.view.Choreographer.doFrame + 5516)
#60 pc 0x20bb768 memfd:jit-cache (android.view.Choreographer$FrameDisplayEventReceiver.run + 184)
#61 pc 0x207bca8 memfd:jit-cache (android.os.Handler.handleCallback + 152)
#62 pc 0x2097844 memfd:jit-cache (android.os.Handler.dispatchMessage + 116)
#63 pc 0x2045938 memfd:jit-cache (android.os.Looper.loopOnce + 1912)
#64 pc 0x209a9c libart.so (nterp_helper + 1948) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#65 pc 0x47063a framework.jar (android.os.Looper.loop + 178)
#66 pc 0x209334 libart.so (nterp_helper + 52) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#67 pc 0x1b4dd6 framework.jar (android.app.ActivityThread.main + 270)
#68 pc 0x434a00 libart.so (art_quick_invoke_static_stub + 576) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#69 pc 0x467134 libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long) + 1960) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#70 pc 0x466964 libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277) + 48) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#71 pc 0x43e154 libart.so (art_quick_generic_jni_trampoline + 148) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#72 pc 0x20a2b0 libart.so (nterp_helper + 4016) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#73 pc 0x2a944e framework.jar (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 22)
#74 pc 0x20b074 libart.so (nterp_helper + 7540) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#75 pc 0x2af672 framework.jar (com.android.internal.os.ZygoteInit.main + 714)
#76 pc 0x434a00 libart.so (art_quick_invoke_static_stub + 576) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#77 pc 0x57df48 libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list) + 900) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#78 pc 0x5f194c libart.so (art::JNI::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list) + 160) (BuildId: 28c5aa8a2e8fc5df069f717d6e94f7fe)
#79 pc 0xafb28 libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...) + 120) (BuildId: c646cf84c51fc07b4bb81680ce4aed68)
#80 pc 0xbb214 libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vectorandroid::String8 const&, bool) + 948) (BuildId: c646cf84c51fc07b4bb81680ce4aed68)
#81 pc 0x2580 app_process64 (main + 1320) (BuildId: c4e0717e77dbaf6f3710de1f5d169e0e)
#82 pc 0x71538 libc.so (__libc_init + 96) (BuildId: f24f65acf653c409ca4332aced817a71)
at android.view.InputEventReceiver.nativeFinishInputEvent(Native method)
at android.view.InputEventReceiver.finishInputEvent(InputEventReceiver.java:213)
at android.view.ViewRootImpl.finishInputEvent(ViewRootImpl.java:9415)
at android.view.ViewRootImpl.access$2100(ViewRootImpl.java:247)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6292)
at android.view.ViewRootImpl$SyntheticInputStage.onDeliverToNext(ViewRootImpl.java:7200)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6251)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6221)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6290)
at android.view.ViewRootImpl$ViewPostImeInputStage.onDeliverToNext(ViewRootImpl.java:6781)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6251)
at android.view.ViewRootImpl$InputStage.finish(ViewRootImpl.java:6244)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6261)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6232)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6290)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6251)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6425)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6259)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6482)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6232)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6290)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6251)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6259)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6232)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9372)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9312)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9258)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9526)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:265)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:245)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:9467)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:9617)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1242)
at android.view.Choreographer.doCallbacks(Choreographer.java:996)
at android.view.ChoreographerExtImpl.checkScrollOptSceneEnable(ChoreographerExtImpl.java:366)
at android.view.Choreographer.doFrame(Choreographer.java:865)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1227)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:344)
at android.app.ActivityThread.main(ActivityThread.java:8248)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)

im using firebase crashlytics
implementation 'com.google.firebase:firebase-crashlytics-buildtools:2.9.2'

@argzdev
Copy link
Contributor

argzdev commented May 10, 2023

Hi @krunalpatel3, your issue seems to be different from the current issue. Could you file a new issue with details according to our template? It'll help us conduct an initial investigation regarding your issue. Thanks!

@google-oss-bot
Copy link
Contributor

Hey @trong-le123. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@trong-le123 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@firebase firebase locked and limited conversation to collaborators Jul 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants