Closed ItsBenyaamin closed 1 month ago
I found a few problems with this issue:
Hi @graymind75, thanks for reporting. Are you using any code related to Crashlytics? Also were there any changes related to Firebase prior to this issue happening?
No, It's just initializing with FirebaseApp.initializeApp(applicationContext)
Thanks for the details, @graymind75. While we investigate this. Just to confirm, were you using a prior version of Crashlytics before experiencing this issue? If yes, could you share which version were you using?
Hi, Sorry I forgot to put the versions
before any problem:
classpath: 2.9.0
crashlytics: 18.2.11
analytics: 21.0.0
first ANR:
classpath: 2.9.1
crashlytics: 18.2.12
analytics: 21.1.0
and the devices ANR submitted from:
Hi, we are facing the same ANR being reported twice with different logs:
main (timed waiting):tid=1 systid=27674
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1063)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1358)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java)
at com.google.firebase.crashlytics.internal.Logger.canLog(Logger.java)
at com.facebook.internal.instrument.InstrumentUtility.isSDKRelatedException(InstrumentUtility.java)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2203)
main (timed waiting):tid=1 systid=23250
at jdk.internal.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1079)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1369)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:22)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:93)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException(CrashlyticsController.java:93)
at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:25)
at com.facebook.internal.instrument.crashreport.CrashHandler.uncaughtException(CrashHandler.java:409)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2306)
We use Crashlytics too and the versions are the ones that come with Firebase BOM 31.1.0
.
We are just upgrading to 31.1.1
but won't have data until the next release which will be at some point in January.
They are our top ANRs, here are the stats of the last 30 days:
Same occurred to us as well with below logs:
main (timed waiting):tid=1 systid=32460 at jdk.internal.misc.Unsafe.park(Unsafe.java) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1079) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1369) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278) at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:124) at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.checkForPreviousCrash(CrashlyticsCore.java:485) at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:184) at com.google.firebase.crashlytics.FirebaseCrashlytics.init(FirebaseCrashlytics.java:149) at com.google.firebase.crashlytics.CrashlyticsRegistrar.buildCrashlytics(CrashlyticsRegistrar.java:60) at com.google.firebase.crashlytics.CrashlyticsRegistrar.$r8$lambda$Pfd5XmDCFzNyAT9o9H6rDnTBQE4(CrashlyticsRegistrar.java) at com.google.firebase.crashlytics.CrashlyticsRegistrar$$InternalSyntheticLambda$3$ab347a8933944304e42539e3f0bc7a2eb5ded1d56c7a52feedae47ac52780cf7$0.create(CrashlyticsRegistrar.java:2) at com.google.firebase.tracing.ComponentMonitor.lambda$processRegistrar$0(ComponentMonitor.java:38) at com.google.firebase.tracing.ComponentMonitor.$r8$lambda$nUgWIWAyyZxi6mRt6KSZMmA5LxE(ComponentMonitor.java) at com.google.firebase.tracing.ComponentMonitor$$InternalSyntheticLambda$3$5d14153249ab9155b8414252ecf49149174a086fa7b21bebac19047e371b22f6$0.create(ComponentMonitor.java:4) at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:140) at com.google.firebase.components.ComponentRuntime.$r8$lambda$4FqOW9eOQsvFYo-HpMfxCOnPQr0(ComponentRuntime.java) at com.google.firebase.components.ComponentRuntime$$InternalSyntheticLambda$2$784536aca87f12f75d3504e86fd606a2ca102f8312a2daf2c8c51b9b25617f63$0.get(ComponentRuntime.java:4) at com.google.firebase.components.Lazy.get(Lazy.java:53) at com.google.firebase.components.ComponentRuntime.doInitializeEagerComponents(ComponentRuntime.java:302) at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(ComponentRuntime.java:292) at com.google.firebase.FirebaseApp.initializeAllApis(FirebaseApp.java:605) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:307) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:271) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:256) at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51) at android.content.ContentProvider.attachInfo(ContentProvider.java:2404) at android.content.ContentProvider.attachInfo(ContentProvider.java:2374) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45) at android.app.ActivityThread.installProvider(ActivityThread.java:7459) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6976) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6747) at android.app.ActivityThread.access$1500(ActivityThread.java:256) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2091) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7870) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Firebase BOM Version - 31.0.2
Same occurred to us as well with below logs:
main (timed waiting):tid=1 systid=32460 at jdk.internal.misc.Unsafe.park(Unsafe.java) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1079) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1369) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278) at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:124) at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.checkForPreviousCrash(CrashlyticsCore.java:485) at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:184) at com.google.firebase.crashlytics.FirebaseCrashlytics.init(FirebaseCrashlytics.java:149) at com.google.firebase.crashlytics.CrashlyticsRegistrar.buildCrashlytics(CrashlyticsRegistrar.java:60) at com.google.firebase.crashlytics.CrashlyticsRegistrar.$r8$lambda$Pfd5XmDCFzNyAT9o9H6rDnTBQE4(CrashlyticsRegistrar.java) at com.google.firebase.crashlytics.CrashlyticsRegistrar$$InternalSyntheticLambda$3$ab347a8933944304e42539e3f0bc7a2eb5ded1d56c7a52feedae47ac52780cf7$0.create(CrashlyticsRegistrar.java:2) at com.google.firebase.tracing.ComponentMonitor.lambda$processRegistrar$0(ComponentMonitor.java:38) at com.google.firebase.tracing.ComponentMonitor.$r8$lambda$nUgWIWAyyZxi6mRt6KSZMmA5LxE(ComponentMonitor.java) at com.google.firebase.tracing.ComponentMonitor$$InternalSyntheticLambda$3$5d14153249ab9155b8414252ecf49149174a086fa7b21bebac19047e371b22f6$0.create(ComponentMonitor.java:4) at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:140) at com.google.firebase.components.ComponentRuntime.$r8$lambda$4FqOW9eOQsvFYo-HpMfxCOnPQr0(ComponentRuntime.java) at com.google.firebase.components.ComponentRuntime$$InternalSyntheticLambda$2$784536aca87f12f75d3504e86fd606a2ca102f8312a2daf2c8c51b9b25617f63$0.get(ComponentRuntime.java:4) at com.google.firebase.components.Lazy.get(Lazy.java:53) at com.google.firebase.components.ComponentRuntime.doInitializeEagerComponents(ComponentRuntime.java:302) at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(ComponentRuntime.java:292) at com.google.firebase.FirebaseApp.initializeAllApis(FirebaseApp.java:605) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:307) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:271) at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:256) at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:51) at android.content.ContentProvider.attachInfo(ContentProvider.java:2404) at android.content.ContentProvider.attachInfo(ContentProvider.java:2374) at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:45) at android.app.ActivityThread.installProvider(ActivityThread.java:7459) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6976) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6747) at android.app.ActivityThread.access$1500(ActivityThread.java:256) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2091) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7870) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
Firebase BOM Version - 31.0.2
Even after upgrading to BOM Version - 31.1.1 still the same.
Is there any update on this issue, we are also facing a large volume of ANRs.
We're seeing a similar issue with Firebase BOM 31.1.1
:
main (native):tid=1 systid=7347
#00 pc 0xa76bc libc.so (__rt_sigsuspend + 12)
#01 pc 0x631cc libc.so (sigsuspend + 56)
#02 pc 0x5c14a8 split_config.arm64_v8a.apk
#03 pc 0x89c [vdso]
#04 pc 0xa7cb8 libc.so (__epoll_pwait + 8)
#05 pc 0x17cc0 libutils.so (android::Looper::pollInner(int) + 192)
#06 pc 0x17b9c libutils.so (android::Looper::pollOnce(int, int*, int*, void**) + 116)
#07 pc 0x1687b0 libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int) + 48)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:186)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8741)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
awaitEvenIfOnMainThread task continuation executor1 (waiting):tid=23 systid=7448
at jdk.internal.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:64)
at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:27)
at java.lang.Thread.run(Thread.java:1012)
We are aware of this issue. We have some work planned that will reduce the load on the main thread, which should resolve this issue as well. I will keep this thread updated.
The issue started to surface roughly one year ago - surely you have the resources to do more than just "should resolve...".
This is a product used by millions world wide and it really should get a higher priority.
Hey @mrober, we appreciate the update.
While we await a resolution, are you able to provide any workarounds to prevent this from occurring in the meantime? For example, temporarily disabling Firebase Analytics/Crashlytics? Any information would be useful, as we currently have an ANR rate that is 4X the PlayStore quality bar.
Hey @mrober, we appreciate the update.
While we await a resolution, are you able to provide any workarounds to prevent this from occurring in the meantime? For example, temporarily disabling Firebase Analytics? Any information would be useful, as we currently have an ANR rate that is 4X the PlayStore quality bar.
is the problem with crashlytics or analytics?
Same for me too.
Stacktrace:
Thread-30087 (waiting):tid=272 systid=18410
at jdk.internal.misc.Unsafe.park(Native method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:885)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1039)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:232)
at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:128)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:229)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException(CrashlyticsController.java:151)
at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:55)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2306)
@mrober please answer, In case a permanent solution will take some time, Do you have any temporary solution ?
@themiswang to provide a temporary workaround while we migrate the Crashlytics SDK to firebase-android-executors.
FYI I've been using before any problem
versions on my comment above and faced no issue since.
Hi folks,
The Crashlytics uncaught exception handler is doing a bit too much work on the crashing thread. If that is the main thread, and has already been blocked for a few seconds, this can lead to an ANR. We are currently working on refactoring the SDK to avoid this, and the first fix will be included in the next release scheduled for March 23. In the meantime, you can manually add a timeout by doing this in your app, and below is an example:
public class CrashlyticsUncaughtExceptionHandler {
/** Must be run after Crashlytics has initialized. */
static void addTimeoutToCrashlyticsUncaughtExceptionHandler() {
Thread.UncaughtExceptionHandler crashlyticsHandler = Thread.getDefaultUncaughtExceptionHandler();
// If the Crashlytics uncaught exception handler timeout, the report
// will be uploaded on the next app launch in a background thread.
Thread.setDefaultUncaughtExceptionHandler(
(thread, ex) -> {
if (crashlyticsHandler != null) {
CountDownLatch latch = new CountDownLatch(1);
new Thread(
() -> {
crashlyticsHandler.uncaughtException(thread, ex);
latch.countDown();
})
.start();
com.google.firebase.crashlytics.internal.common.Utils.awaitUninterruptibly(latch, 2, TimeUnit.SECONDS);
}
});
}
}
Is it safe to just abort the Crashlytics uncaught exception handler when it's taking too long, because Crashlytics will send any pending reports on the next app launch. Thank you again for your patience!
@themiswang There is another stack trace different from UncaughtExceptionHandler
that you mentioned above.
awaitEvenIfOnMainThread task continuation executor1 (waiting):tid=23 systid=7448
at jdk.internal.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:64)
at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:27)
at java.lang.Thread.run(Thread.java:1012)
Will this also be fixed?
The Crashlytics uncaught exception handler is doing a bit too much work on the crashing thread. If that is the main thread, and has already been blocked for a few seconds, this can lead to an ANR. We are currently working on refactoring the SDK to avoid this, and the first fix will be included in the next release scheduled for March 23. In the meantime, you can manually add a timeout by doing this in your app, and below is an example:
@themiswang Which version fixes this problem? I see that yesterday's release did not mention fixing this issue。
Hey @gongwen,
Sorry for the late replying, the fix is in Crashlytics 18.3.6
which announced on March 24th. With the change it will reduce the ANR and we are still working on SDK thread refactoring.
this error is coming in chinese devices
main (timed waiting):tid=1 systid=26556 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1079) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1369) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278) at com.android.internal.util.SyncResultReceiver.waitResult(SyncResultReceiver.java:55) at com.android.internal.util.SyncResultReceiver.getIntResult(SyncResultReceiver.java:68) at android.view.autofill.AutofillManager.tryAddServiceClientIfNeededLocked(AutofillManager.java:2009) at android.view.autofill.AutofillManager.notifyViewEnteredLocked(AutofillManager.java:1070) at android.view.autofill.AutofillManager.notifyViewEntered(AutofillManager.java:1054) at android.view.autofill.AutofillManager.notifyViewEntered(AutofillManager.java:1011) at android.view.View.notifyEnterOrExitForAutoFillIfNeeded(View.java:8226) at android.view.View.performClick(View.java:7512) at android.view.View.performClickInternal(View.java:7471) at android.view.View.access$3700(View.java:843) at android.view.View$PerformClick.run(View.java:29098) 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)
main (native):tid=1 systid=26052
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:339)
at android.os.Looper.loopOnce(Looper.java:179)
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)
Just bumping up this thread. Hi @graymind75, are you still experiencing ANRs with the latest version of Crashlytics? 18.3.7
?
@krunalpatel3 looking at your stacktrace, this seems to be separate issue. Could you file a new issue with details of our template? This is so that we can conduct an initial investigation regarding your issue. Thanks!
Hi @argzdev,
We're still experiencing ANRs on 18.3.6
, would bumping Crashlytics up to 18.3.7
make a difference in the mitigation of these ANRs?
Thanks!
Hi @jeffmon, did version 18.3.6
make any difference with your ANRs? It should help mitigate these ANRs.
Looking through the release notes for version 18.3.7
, there's no entry regarding fixes about ANRs so I don't think that would make a huge difference in your case. If the update on version 18.3.6
didn't help, then there might be an issue somewhere else.
@argzdev Hi, I didn't update the libraries and I'm using the below versions which were the last release without ANRs. I'm afraid I can't update the production without knowing that It's fixed.
classpath: 2.9.0
crashlytics: 18.2.11
analytics: 21.0.0
Hi @graymind75, the fix in 18.3.6
should help with the ANRs. As mentioned by themiswang.
Sorry for the late replying, the fix is in Crashlytics 18.3.6 which announced on March 24th. With the change it will reduce the ANR and we are still working on SDK thread refactoring.
If you're not comfortable in releasing for the updated version, you could do a rollout strategy to test these fixes to your production app.
Other than that, I don't see anyway to move this forward without first being able to verify that it is working or not.
Hey @graymind75. 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!
Since there haven't been any recent updates here, I am going to close this issue.
@graymind75 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.
This should not have been closed. The issue is still present in the latest stable version.
Yeah sorry about that, the needs-info
label usually marks the thread as stale and then closes after sometime. The google-oss-bot was supposed to remove the needs-info
label right after the author replies, but didn't do so. I'll go ahead and open this.
We face the same problem with 18.3.7
crashlytics version:
main (timed waiting):tid=1 systid=7772 at sun.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1063) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1358) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278) at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:121) at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:253) at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:179) at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException(CrashlyticsController.java:166)
I've got 1k+ ANRs with this issue.
Using: firebase-crashlytics:18.4.0 firebase-messaging-ktx:23.2.0' firebase-crashlytics-gradle:2.9.7
After we sent Push Notifications - it's crazy what's going on in our Crashlytics with ANR
That's the error we have in stacktrace:
`main (native):tid=1 systid=20953
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:186)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)`
Hi @adek, that looks like an interesting finding. So in your case, the issue arises when sending push notifications. Could you share a bit more of your stacktrace? So we can check if this issue is another or related to this current one. And if it's possible could you share a minimal repro of your issue? It'll help us investigate this further. Thanks!
@argzdev But that's actually most of the stuff. There is no pointing to my code anywhere. That's why I think it's Firebase issue. I started when we sent 500k+ messages. At first we starting sending this per country (like 50k, 80k), later to 300k users.
And now we got thousands of this.
Please, tell me what do you need.
@adek, that is odd. Can you share me your full stacktrace? It might help us understand this more and possibly reproduce it. Thanks
@argzdev Here's full stacktrace. There is no mention of my app's package so it looks like it's Firebase. Also it's marked in Firebase as "Unknown root cause".
Additional info: 99% is on Android 13.
Full stacktrace:
`# Crashlytics - Stack trace
Signal Catcher (runnable):tid=6 systid=28700
main (native):tid=1 systid=28693
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:186)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
perfetto_hprof_listener (native):tid=7 systid=28701
Jit thread pool worker thread 0 (native):tid=8 systid=28703
HeapTaskDaemon (waiting):tid=9 systid=28704
at dalvik.system.VMRuntime.runHeapTasks(Native method)
at java.lang.Daemons$HeapTaskDaemon.runInternal(Daemons.java:609)
at java.lang.Daemons$Daemon.run(Daemons.java:140)
at java.lang.Thread.run(Thread.java:1012)
ReferenceQueueDaemon (waiting):tid=10 systid=28705 at java.lang.Object.wait(Native method) at java.lang.Object.wait(Object.java:442) at java.lang.Object.wait(Object.java:568) at java.lang.Daemons$ReferenceQueueDaemon.runInternal(Daemons.java:232) at java.lang.Daemons$Daemon.run(Daemons.java:140) at java.lang.Thread.run(Thread.java:1012)
FinalizerDaemon (waiting):tid=11 systid=28706 at java.lang.Object.wait(Native method) at java.lang.Object.wait(Object.java:442) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:203) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:224) at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:300) at java.lang.Daemons$Daemon.run(Daemons.java:140) at java.lang.Thread.run(Thread.java:1012)
FinalizerWatchdogDaemon (timed waiting):tid=12 systid=28707 at java.lang.Thread.sleep(Native method) at java.lang.Thread.sleep(Thread.java:450) at java.lang.Thread.sleep(Thread.java:355) at java.lang.Daemons$FinalizerWatchdogDaemon.sleepForNanos(Daemons.java:438) at java.lang.Daemons$FinalizerWatchdogDaemon.waitForProgress(Daemons.java:480) at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal(Daemons.java:369) at java.lang.Daemons$Daemon.run(Daemons.java:140) at java.lang.Thread.run(Thread.java:1012)
ADB-JDWP Connection Control Thread (waiting):tid=13 systid=28702
binder:28693_1 (native):tid=14 systid=28708
binder:28693_2 (native):tid=15 systid=28709
binder:28693_3 (native):tid=16 systid=28710
Profile Saver (native):tid=17 systid=28718
queued-work-looper-data (waiting):tid=18 systid=28723 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
DefaultDispatcher-worker-2 (timed waiting):tid=19 systid=28739 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:357) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.park(CoroutineScheduler.kt:795) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.tryPark(CoroutineScheduler.kt:740) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:711) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt)
DefaultDispatcher-worker-1 (timed waiting):tid=20 systid=28738 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:357) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.park(CoroutineScheduler.kt:795) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.tryPark(CoroutineScheduler.kt:740) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:711) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt)
DefaultDispatcher-worker-3 (timed waiting):tid=21 systid=28740 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:357) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.park(CoroutineScheduler.kt:795) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.tryPark(CoroutineScheduler.kt:740) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:711) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt)
Firebase Background Thread #0 (waiting):tid=22 systid=28741 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:47) at java.lang.Thread.run(Thread.java:1012)
Firebase Background Thread #1 (waiting):tid=24 systid=28745 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:47) at java.lang.Thread.run(Thread.java:1012)
Crashlytics Exception Handler1 (waiting):tid=25 systid=28746 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:67) at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:27) at java.lang.Thread.run(Thread.java:1012)
GmsDynamite (waiting):tid=26 systid=28747 at java.lang.Object.wait(Native method) at java.lang.Object.wait(Object.java:442) at java.lang.Object.wait(Object.java:568) at com.google.android.gms.dynamite.zza.run(com.google.android.gms:play-services-basement@@18.2.0:2)
Firebase Background Thread #2 (waiting):tid=27 systid=28749 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:47) at java.lang.Thread.run(Thread.java:1012)
Firebase Background Thread #3 (waiting):tid=28 systid=28750 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:47) at java.lang.Thread.run(Thread.java:1012)
com.google.firebase.crashlytics.startup1 (waiting):tid=29 systid=28748 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:67) at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:27) at java.lang.Thread.run(Thread.java:1012)
awaitEvenIfOnMainThread task continuation executor1 (waiting):tid=30 systid=28751 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:67) at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:27) at java.lang.Thread.run(Thread.java:1012)
Firebase Blocking Thread #0 (timed waiting):tid=31 systid=28752 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234) at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:463) at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:361) at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:939) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:47) at java.lang.Thread.run(Thread.java:1012)
Firebase Blocking Thread #1 (timed waiting):tid=32 systid=28753 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234) at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:463) at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:361) at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:939) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1062) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:47) at java.lang.Thread.run(Thread.java:1012)
pool-9-thread-1 (waiting):tid=33 systid=28758 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
Firebase-Messaging-Init (waiting):tid=34 systid=28762 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1176) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:905) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@18.2.0:2) at java.lang.Thread.run(Thread.java:1012)
Firebase-Messaging-Topics-Io (waiting):tid=36 systid=28763 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1176) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:905) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at com.google.android.gms.common.util.concurrent.zza.run(com.google.android.gms:play-services-basement@@18.2.0:2) at java.lang.Thread.run(Thread.java:1012)
OkHttp ConnectionPool (timed waiting):tid=39 systid=28768 at java.lang.Object.wait(Native method) at com.android.okhttp.ConnectionPool$1.run(ConnectionPool.java:106) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
queued-work-looper (native):tid=43 systid=28779
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loopOnce(Looper.java:186)
at android.os.Looper.loop(Looper.java:313)
at android.os.HandlerThread.run(HandlerThread.java:67)
WM.task-1 (waiting):tid=44 systid=28780 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
Okio Watchdog (waiting):tid=45 systid=28781 at java.lang.Object.wait(Native method) at java.lang.Object.wait(Object.java:442) at java.lang.Object.wait(Object.java:568) at com.android.okhttp.okio.AsyncTimeout.awaitTimeout(AsyncTimeout.java:313) at com.android.okhttp.okio.AsyncTimeout.access$000(AsyncTimeout.java:42) at com.android.okhttp.okio.AsyncTimeout$Watchdog.run(AsyncTimeout.java:288)
binder:28693_4 (native):tid=46 systid=28782
WM.task-2 (waiting):tid=47 systid=28783 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
WM.task-3 (waiting):tid=48 systid=28784 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
WM.task-4 (waiting):tid=49 systid=28785 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
androidx.work-1 (waiting):tid=50 systid=28786 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
androidx.work-2 (waiting):tid=51 systid=28787 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:433) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)
AsyncTask #1 (waiting):tid=52 systid=28788 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461) at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:361) at java.util.concurrent.SynchronousQueue.take(SynchronousQueue.java:922) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1063) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1123) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012)`
Is there any updates on this issue?
Any update on this? We are also facing this in our production application a lot.
firebase-bom
version is 31.1.0
Facing Anr problem with related to firebase crashlytics sdk. Please suggest us how to overcome this problem. sdk version is 18.4.1 and here is logs- jdk.internal.misc.Unsafe.park (Native method) java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:234)
java.util.concurrent.CountDownLatch.await (CountDownLatch.java:278)
com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread (Utils.java:124)
com.google.firebase.crashlytics.internal.common.IdManager.fetchTrueFid (IdManager.java:171)
com.google.firebase.crashlytics.internal.common.IdManager.getCrashlyticsInstallId (IdManager.java:117)
com.google.firebase.crashlytics.internal.common.CLSUUID.
android.content.ContentProvider.attachInfo (ContentProvider.java:2421) com.google.firebase.provider.FirebaseInitProvider.attachInfo (FirebaseInitProvider.java:45) android.app.ActivityThread.installProvider (ActivityThread.java:7964)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1013)
Facing the problem: main (timed waiting):tid=1 systid=14274 at jdk.internal.misc.Unsafe.park(Native method) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:717) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1074) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:276) at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:121) at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:253) at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:179) at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException(CrashlyticsController.java:166) at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:54) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1071) at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1066) at java.lang.Thread.dispatchUncaughtException(Thread.java:2306)
I had the same issue with the new versions. I was only able to make it work using FirebaseBom
in version: 29.3.0
.
We received one of the top most issue which leads to user-perceived
ANR.
ANR Details: java.util.concurrent.CountDownLatch.await
Stacktrace
"main" tid=1 Timed Waiting at java.lang.Object.wait (Native method) at java.lang.Thread.parkFor$ (Thread.java:2135) at sun.misc.Unsafe.park (Unsafe.java:358) at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos (AbstractQueuedSynchronizer.java:1061) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos (AbstractQueuedSynchronizer.java:1352) at java.util.concurrent.CountDownLatch.await (CountDownLatch.java:278) at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread (Utils.java:110) at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException (CrashlyticsController.java:232) at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException (CrashlyticsController.java:155) at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException (CrashlyticsUncaughtExceptionHandler.java:54) at java.lang.ThreadGroup.uncaughtException (ThreadGroup.java:1068) at java.lang.ThreadGroup.uncaughtException (ThreadGroup.java:1063) at java.lang.Thread.dispatchUncaughtException (Thread.java:1953)
"Measurement Worker" tid=30 Runnable at com.google.android.gms.internal.measurement.zzcq.zzc (com.google.android.gms:play-services-measurement-impl@@17.4.1:27) at com.google.android.gms.internal.measurement.zzjk.zzz (com.google.android.gms:play-services-measurement-impl@@17.4.1) at com.google.android.gms.internal.measurement.zzji.zzaa (com.google.android.gms:play-services-measurement-impl@@17.4.1) at com.google.android.gms.measurement.internal.zzas.zzce (com.google.android.gms:play-services-measurement-impl@@17.4.1) at com.google.android.gms.measurement.internal.zzaw.zza (com.google.android.gms:play-services-measurement-impl@@17.4.1) at com.google.android.gms.measurement.internal.zzem.zza (com.google.android.gms:play-services-measurement-impl@@17.4.1:27) at com.google.android.gms.measurement.internal.zzaa.zzd (com.google.android.gms:play-services-measurement-impl@@17.4.1:96) at com.google.android.gms.measurement.internal.zzaa.zza (com.google.android.gms:play-services-measurement-impl@@17.4.1:107) at com.google.android.gms.measurement.internal.zzhc.zza (com.google.android.gms:play-services-measurement-impl@@17.4.1:293) at com.google.android.gms.measurement.internal.zzhf.run (com.google.android.gms:play-services-measurement-impl@@17.4.1) at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:457) at java.util.concurrent.FutureTask.run (FutureTask.java:266) at com.google.android.gms.measurement.internal.zzfy.run (com.google.android.gms:play-services-measurement-impl@@17.4.1:21)
"Signal Catcher" tid=3 Runnable
"Jit thread pool worker thread 0" tid=2 Native
We are using firebase crashlytic version 17.4.1
Please help to resolve this issue?
Is there any updates on this issue?
I have this issue only on Samsung smartwatches and with Android 13. Maybe it helps.
Firebase version: implementation platform('com.google.firebase:firebase-bom:32.7.0') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.firebase:firebase-crashlytics'
main (timed waiting):tid=1 systid=14194
at jdk.internal.misc.Unsafe.park(Native method)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(BlockingCoroutine.java:88)
at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking(BuildersKtBuilders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(Builders.kt:1)
at kotlinx.coroutines.BuildersKtBuildersKt.runBlocking$default(BuildersKtBuilders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Builders.kt:1)
at com.google.firebase.sessions.settings.SettingsCache.
@cempo Does updgrading Firebase bom to implementation platform('com.google.firebase:firebase-bom:32.7.0') solves this issue for you?
@argzdev Anu update on resolution?
[REQUIRED] Step 2: Describe your environment
Versions:
[REQUIRED] Step 3: Describe the problem
We facing this issue for almost 3 months now. But recently the ANR count is insanely high as you can see in the above From crashlytics:
Relevant Code: