Skip to content
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

[Bug]: 4.x.x - ANR - Native method - jdk.internal.misc.Unsafe.park #1904

Open
1 task done
wasif-life opened this issue Nov 8, 2023 · 3 comments
Open
1 task done

Comments

@wasif-life
Copy link

wasif-life commented Nov 8, 2023

What happened?

Alot of ANRs are being logged in Play Store console.

Android version : 12 and 13

OneSignal
Implementation 'com.onesignal:OneSignal:[4.0.0, 4.99.99]'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'
classpath 'com.google.gms:google-services:4.3.15'

ANR LOGS

"main" tid=1 Blocked
at com.onesignal.LocationController.onFocusChange (LocationController.java:324)
at com.onesignal.OneSignal.onAppFocus (OneSignal.java:1409)
at com.onesignal.OSFocusHandler.startOnFocusWork (OSFocusHandler.kt:53)
at com.onesignal.ActivityLifecycleHandler.handleFocus (ActivityLifecycleHandler.java:197)
at com.onesignal.ActivityLifecycleHandler.onActivityResumed (ActivityLifecycleHandler.java:95)
at com.onesignal.ActivityLifecycleListener.onActivityResumed (ActivityLifecycleListener.java:91)
at android.app.Application.dispatchActivityResumed (Application.java:443)
at android.app.Activity.dispatchActivityResumed (Activity.java:1515)
at android.app.Activity.onResume (Activity.java:2097)
at androidx.fragment.app.FragmentActivity.onResume (FragmentActivity.java:309)
at com.lifepharmacy.application.ui.dashboard.DashboardWithNativeBottomActivity.onResume (DashboardWithNativeBottomActivity.kt:171)
at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1584)
at android.app.Activity.performResume (Activity.java:8699)
at android.app.ActivityThread.performResumeActivity (ActivityThread.java:5041)
at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:5085)
at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:54)
at android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2440)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:211)
at android.os.Looper.loop (Looper.java:300)
at android.app.ActivityThread.main (ActivityThread.java:8321)
at java.lang.reflect.Method.invoke (Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:581)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1028)

"OSH_LocationHandlerThread" tid=105 Timed Waiting
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.android.gms.internal.location.zzau.getLastLocation (com.google.android.gms:play-services-location@@21.0.1:12)
at com.onesignal.GMSLocationController$FusedLocationApiWrapper.getLastLocation (GMSLocationController.java:210)
at com.onesignal.GMSLocationController$GoogleApiClientListener.onConnected (GMSLocationController.java:134)
at com.google.android.gms.common.internal.zak.zad (com.google.android.gms:play-services-base@@18.1.0:11)
at com.google.android.gms.common.api.internal.zabe.zab (com.google.android.gms:play-services-base@@18.1.0:3)
at com.google.android.gms.common.api.internal.zaaw.zaC (com.google.android.gms:play-services-base@@18.1.0:11)
at com.google.android.gms.common.api.internal.zaaw.zag (com.google.android.gms:play-services-base@@18.1.0:4)
at com.google.android.gms.common.api.internal.zabi.onConnected (com.google.android.gms:play-services-base@@18.1.0:2)
at com.google.android.gms.common.api.internal.zat.onConnected (com.google.android.gms:play-services-base@@18.1.0:1)
at com.google.android.gms.common.internal.zah.onConnected (com.google.android.gms:play-services-base@@18.1.0:1)
at com.google.android.gms.common.internal.zzf.zzd (com.google.android.gms:play-services-basement@@18.2.0:10)
at com.google.android.gms.common.internal.zza.zza (com.google.android.gms:play-services-basement@@18.2.0:1)
at com.google.android.gms.common.internal.zzc.zze (com.google.android.gms:play-services-basement@@18.2.0:3)
at com.google.android.gms.common.internal.zzb.handleMessage (com.google.android.gms:play-services-basement@@18.2.0:31)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:211)
at android.os.Looper.loop (Looper.java:300)
at android.os.HandlerThread.run (HandlerThread.java:67)

"FinalizerDaemon" tid=9 Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:210)
at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:231)
at java.lang.Daemons$FinalizerDaemon.runInternal (Daemons.java:309)
at java.lang.Daemons$Daemon.run (Daemons.java:145)
at java.lang.Thread.run (Thread.java:1012)

"FinalizerWatchdogDaemon" tid=10 Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at java.lang.Object.wait (Object.java:524)
at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded (Daemons.java:428)
at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal (Daemons.java:408)
at java.lang.Daemons$Daemon.run (Daemons.java:145)
at java.lang.Thread.run (Thread.java:1012)

"ReferenceQueueDaemon" tid=11 Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at java.lang.Object.wait (Object.java:524)
at java.lang.Daemons$ReferenceQueueDaemon.runInternal (Daemons.java:239)
at java.lang.Daemons$Daemon.run (Daemons.java:145)
at java.lang.Thread.run (Thread.java:1012)

"AsyncTask #1" tid=32 Timed Waiting
at jdk.internal.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:1672)
at java.util.concurrent.LinkedBlockingQueue.poll (LinkedBlockingQueue.java:460)
at com.google.android.gms.common.BlockingServiceConnection.getServiceWithTimeout (com.google.android.gms:play-services-basement@@18.2.0:3)
at com.google.android.gms.ads.identifier.AdvertisingIdClient.zzb (com.google.android.gms:play-services-ads-identifier@@17.1.0:14)
at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo (com.google.android.gms:play-services-ads-identifier@@17.1.0:3)
at java.lang.reflect.Method.invoke (Native method)
at com.facebook.internal.Utility.invokeMethodQuietly (Utility.java:923)
at com.facebook.internal.AttributionIdentifiers.getAndroidIdViaReflection (AttributionIdentifiers.java:103)
at com.facebook.internal.AttributionIdentifiers.getAndroidId (AttributionIdentifiers.java:79)
at com.facebook.internal.AttributionIdentifiers.getAttributionIdentifiers (AttributionIdentifiers.java:180)
at com.facebook.FacebookSdk.publishInstallAndWaitForResponse (FacebookSdk.java:660)
at com.facebook.FacebookSdk$5.run (FacebookSdk.java:648)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)

"GmsDynamite" tid=40 Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at java.lang.Object.wait (Object.java:524)
at com.google.android.gms.dynamite.zza.run (com.google.android.gms:play-services-basement@@18.2.0:2)

"|ANR-WatchDog|" tid=48 Timed Waiting
at java.lang.Thread.sleep (Native method)
at java.lang.Thread.sleep (Thread.java:450)
at java.lang.Thread.sleep (Thread.java:355)
at io.sentry.android.core.ANRWatchDog.run (ANRWatchDog.java:78)

"Timer-0" tid=49 Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at java.lang.Object.wait (Object.java:524)
at java.util.TimerThread.mainLoop (Timer.java:534)
at java.util.TimerThread.run (Timer.java:513)

"Timer-1" tid=50 Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at java.lang.Object.wait (Object.java:524)
at java.util.TimerThread.mainLoop (Timer.java:534)
at java.util.TimerThread.run (Timer.java:513)

"Timer-2" tid=51 Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at java.lang.Object.wait (Object.java:524)
at java.util.TimerThread.mainLoop (Timer.java:534)
at java.util.TimerThread.run (Timer.java:513)

"OkHttp ConnectionPool" tid=52 Timed Waiting
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:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)

"Measurement Worker" tid=55 Timed Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at m.ll.run (:com.google.android.gms.dynamite_measurementdynamite@[email protected] (190400-0):71)

"Okio Watchdog" tid=87 Timed Waiting
at java.lang.Object.wait (Native method)
at com.android.okhttp.okio.AsyncTimeout.awaitTimeout (AsyncTimeout.java:325)
at com.android.okhttp.okio.AsyncTimeout.access$000 (AsyncTimeout.java:42)
at com.android.okhttp.okio.AsyncTimeout$Watchdog.run (AsyncTimeout.java:288)

"OS_GMS_LOCATION_FALLBACK" tid=102 Timed Waiting
at java.lang.Thread.sleep (Native method)
at java.lang.Thread.sleep (Thread.java:450)
at java.lang.Thread.sleep (Thread.java:355)
at com.onesignal.GMSLocationController$1.run (GMSLocationController.java:87)
at java.lang.Thread.run (Thread.java:1012)

"Okio Watchdog" tid=112 Timed Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at okio.AsyncTimeout$Companion.awaitTimeout$okio (AsyncTimeout.kt:302)
at okio.AsyncTimeout$Watchdog.run (AsyncTimeout.kt:183)

"Timer-4" tid=123 Timed Waiting
at java.lang.Object.wait (Native method)
at java.lang.Object.wait (Object.java:386)
at java.util.TimerThread.mainLoop (Timer.java:560)
at java.util.TimerThread.run (Timer.java:513)

"Signal Catcher" tid=3 Runnable
#00 pc 0x00000000004c64ac /apex/com.android.art/lib64/libart.so (art::DumpNativeStack+108)
#1 pc 0x00000000004bd774 /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack const+388)
#2 pc 0x00000000004bcfc4 /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run+164)
#3 pc 0x00000000004441f0 /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint+432)
#4 pc 0x00000000004e491c /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump+232)
#5 pc 0x00000000004e4188 /apex/com.android.art/lib64/libart.so (art::ThreadList::DumpForSigQuit+244)
#6 pc 0x00000000004e1928 /apex/com.android.art/lib64/libart.so (art::Runtime::DumpForSigQuit+48)
#7 pc 0x00000000004e07c4 /apex/com.android.art/lib64/libart.so (art::SignalCatcher::HandleSigQuit+452)
#8 pc 0x00000000004e033c /apex/com.android.art/lib64/libart.so (art::SignalCatcher::Run+264)
#9 pc 0x00000000000fba4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
#10 pc 0x000000000008e5f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"perfetto_hprof_listener" tid=7 Native
#00 pc 0x00000000000e5b14 /apex/com.android.runtime/lib64/bionic/libc.so (read+4)
#1 pc 0x0000000000026360 /apex/com.android.art/lib64/libperfetto_hprof.so (void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_deletestd::__1::__thread_struct >, ArtPlugin_Initialize::$_7> >+316)
#2 pc 0x00000000000fba4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
#3 pc 0x000000000008e5f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"Jit thread pool worker thread 0" tid=8 Native
#00 pc 0x000000000008921c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
#1 pc 0x00000000002377f0 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks+140)
#2 pc 0x00000000005bc510 /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask+120)
#3 pc 0x00000000005bc2fc /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run+136)
#4 pc 0x00000000005bc1d8 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback+164)
#5 pc 0x00000000000fba4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
#6 pc 0x000000000008e5f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"HeapTaskDaemon" tid=12 Waiting
#00 pc 0x0000000000089220 /apex/com.android.runtime/lib64/bionic/libc.so (syscall+32)
#1 pc 0x000000000028fb20 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::TimedWait+252)
#2 pc 0x00000000003a2b58 /apex/com.android.art/lib64/libart.so (art::gc::TaskProcessor::GetTask+196)
#3 pc 0x00000000003a2a14 /apex/com.android.art/lib64/libart.so (art::gc::TaskProcessor::RunAllTasks+48)
at dalvik.system.VMRuntime.runHeapTasks (Native method)
at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:687)
at java.lang.Daemons$Daemon.run (Daemons.java:145)
at java.lang.Thread.run (Thread.java:1012)

"binder:3962_1" tid=13 Native
#00 pc 0x00000000000e5df4 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
#1 pc 0x0000000000097f1c /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
#2 pc 0x000000000005b458 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+280)
#3 pc 0x000000000005b748 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand+24)
#4 pc 0x000000000005c064 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool+68)
#5 pc 0x000000000008bed8 /system/lib64/libbinder.so (android::PoolThread::threadLoop+24)
#6 pc 0x0000000000013460 /system/lib64/libutils.so (android::Thread::_threadLoop+416)
#7 pc 0x00000000000cd55c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell+140)
#8 pc 0x00000000000fba4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
#9 pc 0x000000000008e5f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"binder:3962_2" tid=14 Native
#00 pc 0x00000000000e5df4 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
#1 pc 0x0000000000097f1c /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
#2 pc 0x000000000005b458 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+280)
#3 pc 0x000000000005b748 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand+24)
#4 pc 0x000000000005c064 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool+68)
#5 pc 0x000000000008bed8 /system/lib64/libbinder.so (android::PoolThread::threadLoop+24)
#6 pc 0x0000000000013460 /system/lib64/libutils.so (android::Thread::_threadLoop+416)
#7 pc 0x00000000000cd55c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell+140)
#8 pc 0x00000000000fba4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
#9 pc 0x000000000008e5f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"binder:3962_3" tid=15 Native
#00 pc 0x00000000000e5df4 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
#1 pc 0x0000000000097f1c /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
#2 pc 0x000000000005b458 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+280)
#3 pc 0x000000000005b748 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand+24)
#4 pc 0x000000000005c064 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool+68)
#5 pc 0x000000000008bed8 /system/lib64/libbinder.so (android::PoolThread::threadLoop+24)
#6 pc 0x0000000000013460 /system/lib64/libutils.so (android::Thread::_threadLoop+416)
#7 pc 0x00000000000cd55c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell+140)
#8 pc 0x00000000000fba4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
#9 pc 0x000000000008e5f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"binder:3962_4" tid=16 Native
#00 pc 0x00000000000e5df4 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
#1 pc 0x0000000000097f1c /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
#2 pc 0x000000000005b458 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+280)
#3 pc 0x000000000005b748 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand+24)
#4 pc 0x000000000005c064 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool+68)
#5 pc 0x000000000008bed8 /system/lib64/libbinder.so (android::PoolThread::threadLoop+24)
#6 pc 0x0000000000013460 /system/lib64/libutils.so (android::Thread::_threadLoop+416)
#7 pc 0x00000000000cd55c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell+140)
#8 pc 0x00000000000fba4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
#9 pc 0x000000000008e5f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"3962-ScoutStateMachine" tid=17 Native
#00 pc 0x00000000000e6dd8 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8)
#1 pc 0x0000000000017edc /system/lib64/libutils.so (android::Looper::pollInner+188)
#2 pc 0x0000000000017dc0 /system/lib64/libutils.so (android::Looper::pollOnce+112)
#3 pc 0x00000000001666dc /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce+44)
at android.os.MessageQueue.nativePollOnce (Native method)
at android.os.MessageQueue.next (MessageQueue.java:341)
at android.os.Looper.loopOnce (Looper.java:169)
at android.os.Looper.loop (Looper.java:300)
at android.os.HandlerThread.run (HandlerThread.java:67)

"Profile Saver" tid=18 Native
#00 pc 0x000000000008921c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
#1 pc 0x00000000002377f0 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks+140)
#2 pc 0x00000000003d68a0 /apex/com.android.art/lib64/libart.so (art::ProfileSaver::Run+864)
#3 pc 0x00000000003cc298 /apex/com.android.art/lib64/libart.so (art::ProfileSaver::RunProfileSaverThread+152)
#4 pc 0x00000000000fba4c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
#5 pc 0x000000000008e5f0 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"pool-3-thread-1" tid=19 Waiting
at jdk.internal.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:341)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block (AbstractQueuedSynchronizer.java:506)
at java.util.concurrent.ForkJoinPool.unmanagedBlock (ForkJoinPool.java:3466)
at java.util.concurrent.ForkJoinPool.managedBlock (ForkJoinPool.java:3437)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:1623)
at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:435)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1071)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)

"ScionFrontendApi" tid=20 Timed Waiting
at jdk.internal.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:1672)
at java.util.concurrent.LinkedBlockingQueue.poll (LinkedBlockingQueue.java:460)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1070)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)

"pool-16-thread-1" tid=21 Waiting
at jdk.internal.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:341)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block (AbstractQueuedSynchronizer.java:506)
at java.util.concurrent.ForkJoinPool.unmanagedBlock (ForkJoinPool.java:3466)
at java.util.concurrent.ForkJoinPool.managedBlock (ForkJoinPool.java:3437)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:1623)
at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:435)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1071)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)

"pool-9-thread-1" tid=22 Timed Waiting
at jdk.internal.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer (SynchronousQueue.java:401)
at java.util.concurrent.SynchronousQueue.poll (SynchronousQueue.java:903)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1070)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)

"pool-14-thread-1" tid=23 Timed Waiting
at jdk.internal.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer (SynchronousQueue.java:401)
at java.util.concurrent.SynchronousQueue.poll (SynchronousQueue.java:903)
at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1070)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)

"pool-15-thread-1" tid=24 Timed Waiting
at jdk.internal.misc.Unsafe.park (Native method)
at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer (SynchronousQueue.java:401)

Steps to reproduce?

1.5k ANRs got logged in Play Store which is related to one signal.

What did you expect to happen?

No ANR due to onesignal SDK

OneSignal Android SDK version

'com.onesignal:OneSignal:[4.0.0, 4.99.99]'

Android version

13

Specific Android models

- Samsung a53x (Galaxy A53 5G) Android 13
- [OPPO OP4B9EL1 (Reno3)] Android 12

Relevant log output

"main" tid=1 Blocked
  at com.onesignal.LocationController.onFocusChange (LocationController.java:324)
  at com.onesignal.OneSignal.onAppFocus (OneSignal.java:1409)
  at com.onesignal.OSFocusHandler.startOnFocusWork (OSFocusHandler.kt:53)
  at com.onesignal.ActivityLifecycleHandler.handleFocus (ActivityLifecycleHandler.java:197)
  at com.onesignal.ActivityLifecycleHandler.onActivityResumed (ActivityLifecycleHandler.java:95)
  at com.onesignal.ActivityLifecycleListener.onActivityResumed (ActivityLifecycleListener.java:91)
  at android.app.Application.dispatchActivityResumed (Application.java:443)
  at android.app.Activity.dispatchActivityResumed (Activity.java:1515)
  at android.app.Activity.onResume (Activity.java:2097)
  at androidx.fragment.app.FragmentActivity.onResume (FragmentActivity.java:309)
  at com.lifepharmacy.application.ui.dashboard.DashboardWithNativeBottomActivity.onResume (DashboardWithNativeBottomActivity.kt:171)
  at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1584)
  at android.app.Activity.performResume (Activity.java:8699)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:5041)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:5085)
  at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:54)
  at android.app.servertransaction.ActivityTransactionItem.execute (ActivityTransactionItem.java:45)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2440)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:211)
  at android.os.Looper.loop (Looper.java:300)
  at android.app.ActivityThread.main (ActivityThread.java:8321)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:581)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1028)

"OSH_LocationHandlerThread" tid=105 Timed Waiting
  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.android.gms.internal.location.zzau.getLastLocation (com.google.android.gms:play-services-location@@21.0.1:12)
  at com.onesignal.GMSLocationController$FusedLocationApiWrapper.getLastLocation (GMSLocationController.java:210)
  at com.onesignal.GMSLocationController$GoogleApiClientListener.onConnected (GMSLocationController.java:134)
  at com.google.android.gms.common.internal.zak.zad (com.google.android.gms:play-services-base@@18.1.0:11)
  at com.google.android.gms.common.api.internal.zabe.zab (com.google.android.gms:play-services-base@@18.1.0:3)
  at com.google.android.gms.common.api.internal.zaaw.zaC (com.google.android.gms:play-services-base@@18.1.0:11)
  at com.google.android.gms.common.api.internal.zaaw.zag (com.google.android.gms:play-services-base@@18.1.0:4)
  at com.google.android.gms.common.api.internal.zabi.onConnected (com.google.android.gms:play-services-base@@18.1.0:2)
  at com.google.android.gms.common.api.internal.zat.onConnected (com.google.android.gms:play-services-base@@18.1.0:1)
  at com.google.android.gms.common.internal.zah.onConnected (com.google.android.gms:play-services-base@@18.1.0:1)
  at com.google.android.gms.common.internal.zzf.zzd (com.google.android.gms:play-services-basement@@18.2.0:10)
  at com.google.android.gms.common.internal.zza.zza (com.google.android.gms:play-services-basement@@18.2.0:1)
  at com.google.android.gms.common.internal.zzc.zze (com.google.android.gms:play-services-basement@@18.2.0:3)
  at com.google.android.gms.common.internal.zzb.handleMessage (com.google.android.gms:play-services-basement@@18.2.0:31)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:211)
  at android.os.Looper.loop (Looper.java:300)
  at android.os.HandlerThread.run (HandlerThread.java:67)

"FinalizerDaemon" tid=9 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:210)
  at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:231)
  at java.lang.Daemons$FinalizerDaemon.runInternal (Daemons.java:309)
  at java.lang.Daemons$Daemon.run (Daemons.java:145)
  at java.lang.Thread.run (Thread.java:1012)

"FinalizerWatchdogDaemon" tid=10 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at java.lang.Object.wait (Object.java:524)
  at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded (Daemons.java:428)
  at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal (Daemons.java:408)
  at java.lang.Daemons$Daemon.run (Daemons.java:145)
  at java.lang.Thread.run (Thread.java:1012)

"ReferenceQueueDaemon" tid=11 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at java.lang.Object.wait (Object.java:524)
  at java.lang.Daemons$ReferenceQueueDaemon.runInternal (Daemons.java:239)
  at java.lang.Daemons$Daemon.run (Daemons.java:145)
  at java.lang.Thread.run (Thread.java:1012)

"AsyncTask #1" tid=32 Timed Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:1672)
  at java.util.concurrent.LinkedBlockingQueue.poll (LinkedBlockingQueue.java:460)
  at com.google.android.gms.common.BlockingServiceConnection.getServiceWithTimeout (com.google.android.gms:play-services-basement@@18.2.0:3)
  at com.google.android.gms.ads.identifier.AdvertisingIdClient.zzb (com.google.android.gms:play-services-ads-identifier@@17.1.0:14)
  at com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo (com.google.android.gms:play-services-ads-identifier@@17.1.0:3)
  at java.lang.reflect.Method.invoke (Native method)
  at com.facebook.internal.Utility.invokeMethodQuietly (Utility.java:923)
  at com.facebook.internal.AttributionIdentifiers.getAndroidIdViaReflection (AttributionIdentifiers.java:103)
  at com.facebook.internal.AttributionIdentifiers.getAndroidId (AttributionIdentifiers.java:79)
  at com.facebook.internal.AttributionIdentifiers.getAttributionIdentifiers (AttributionIdentifiers.java:180)
  at com.facebook.FacebookSdk.publishInstallAndWaitForResponse (FacebookSdk.java:660)
  at com.facebook.FacebookSdk$5.run (FacebookSdk.java:648)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

"GmsDynamite" tid=40 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at java.lang.Object.wait (Object.java:524)
  at com.google.android.gms.dynamite.zza.run (com.google.android.gms:play-services-basement@@18.2.0:2)

"|ANR-WatchDog|" tid=48 Timed Waiting
  at java.lang.Thread.sleep (Native method)
  at java.lang.Thread.sleep (Thread.java:450)
  at java.lang.Thread.sleep (Thread.java:355)
  at io.sentry.android.core.ANRWatchDog.run (ANRWatchDog.java:78)

"Timer-0" tid=49 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at java.lang.Object.wait (Object.java:524)
  at java.util.TimerThread.mainLoop (Timer.java:534)
  at java.util.TimerThread.run (Timer.java:513)

"Timer-1" tid=50 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at java.lang.Object.wait (Object.java:524)
  at java.util.TimerThread.mainLoop (Timer.java:534)
  at java.util.TimerThread.run (Timer.java:513)

"Timer-2" tid=51 Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at java.lang.Object.wait (Object.java:524)
  at java.util.TimerThread.mainLoop (Timer.java:534)
  at java.util.TimerThread.run (Timer.java:513)

"OkHttp ConnectionPool" tid=52 Timed Waiting
  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:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

"Measurement Worker" tid=55 Timed Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at m.ll.run (:com.google.android.gms.dynamite_measurementdynamite@[email protected] (190400-0):71)

"Okio Watchdog" tid=87 Timed Waiting
  at java.lang.Object.wait (Native method)
  at com.android.okhttp.okio.AsyncTimeout.awaitTimeout (AsyncTimeout.java:325)
  at com.android.okhttp.okio.AsyncTimeout.access$000 (AsyncTimeout.java:42)
  at com.android.okhttp.okio.AsyncTimeout$Watchdog.run (AsyncTimeout.java:288)

"OS_GMS_LOCATION_FALLBACK" tid=102 Timed Waiting
  at java.lang.Thread.sleep (Native method)
  at java.lang.Thread.sleep (Thread.java:450)
  at java.lang.Thread.sleep (Thread.java:355)
  at com.onesignal.GMSLocationController$1.run (GMSLocationController.java:87)
  at java.lang.Thread.run (Thread.java:1012)

"Okio Watchdog" tid=112 Timed Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at okio.AsyncTimeout$Companion.awaitTimeout$okio (AsyncTimeout.kt:302)
  at okio.AsyncTimeout$Watchdog.run (AsyncTimeout.kt:183)

"Timer-4" tid=123 Timed Waiting
  at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:386)
  at java.util.TimerThread.mainLoop (Timer.java:560)
  at java.util.TimerThread.run (Timer.java:513)

"Signal Catcher" tid=3 Runnable
  #00  pc 0x00000000004c64ac  /apex/com.android.art/lib64/libart.so (art::DumpNativeStack+108)
  #01  pc 0x00000000004bd774  /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack const+388)
  #02  pc 0x00000000004bcfc4  /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run+164)
  #03  pc 0x00000000004441f0  /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint+432)
  #04  pc 0x00000000004e491c  /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump+232)
  #05  pc 0x00000000004e4188  /apex/com.android.art/lib64/libart.so (art::ThreadList::DumpForSigQuit+244)
  #06  pc 0x00000000004e1928  /apex/com.android.art/lib64/libart.so (art::Runtime::DumpForSigQuit+48)
  #07  pc 0x00000000004e07c4  /apex/com.android.art/lib64/libart.so (art::SignalCatcher::HandleSigQuit+452)
  #08  pc 0x00000000004e033c  /apex/com.android.art/lib64/libart.so (art::SignalCatcher::Run+264)
  #09  pc 0x00000000000fba4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
  #10  pc 0x000000000008e5f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"perfetto_hprof_listener" tid=7 Native
  #00  pc 0x00000000000e5b14  /apex/com.android.runtime/lib64/bionic/libc.so (read+4)
  #01  pc 0x0000000000026360  /apex/com.android.art/lib64/libperfetto_hprof.so (void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, ArtPlugin_Initialize::$_7> >+316)
  #02  pc 0x00000000000fba4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
  #03  pc 0x000000000008e5f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"Jit thread pool worker thread 0" tid=8 Native
  #00  pc 0x000000000008921c  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
  #01  pc 0x00000000002377f0  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks+140)
  #02  pc 0x00000000005bc510  /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask+120)
  #03  pc 0x00000000005bc2fc  /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run+136)
  #04  pc 0x00000000005bc1d8  /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback+164)
  #05  pc 0x00000000000fba4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
  #06  pc 0x000000000008e5f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"HeapTaskDaemon" tid=12 Waiting
  #00  pc 0x0000000000089220  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+32)
  #01  pc 0x000000000028fb20  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::TimedWait+252)
  #02  pc 0x00000000003a2b58  /apex/com.android.art/lib64/libart.so (art::gc::TaskProcessor::GetTask+196)
  #03  pc 0x00000000003a2a14  /apex/com.android.art/lib64/libart.so (art::gc::TaskProcessor::RunAllTasks+48)
  at dalvik.system.VMRuntime.runHeapTasks (Native method)
  at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:687)
  at java.lang.Daemons$Daemon.run (Daemons.java:145)
  at java.lang.Thread.run (Thread.java:1012)

"binder:3962_1" tid=13 Native
  #00  pc 0x00000000000e5df4  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
  #01  pc 0x0000000000097f1c  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
  #02  pc 0x000000000005b458  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+280)
  #03  pc 0x000000000005b748  /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand+24)
  #04  pc 0x000000000005c064  /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool+68)
  #05  pc 0x000000000008bed8  /system/lib64/libbinder.so (android::PoolThread::threadLoop+24)
  #06  pc 0x0000000000013460  /system/lib64/libutils.so (android::Thread::_threadLoop+416)
  #07  pc 0x00000000000cd55c  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell+140)
  #08  pc 0x00000000000fba4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
  #09  pc 0x000000000008e5f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"binder:3962_2" tid=14 Native
  #00  pc 0x00000000000e5df4  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
  #01  pc 0x0000000000097f1c  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
  #02  pc 0x000000000005b458  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+280)
  #03  pc 0x000000000005b748  /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand+24)
  #04  pc 0x000000000005c064  /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool+68)
  #05  pc 0x000000000008bed8  /system/lib64/libbinder.so (android::PoolThread::threadLoop+24)
  #06  pc 0x0000000000013460  /system/lib64/libutils.so (android::Thread::_threadLoop+416)
  #07  pc 0x00000000000cd55c  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell+140)
  #08  pc 0x00000000000fba4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
  #09  pc 0x000000000008e5f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"binder:3962_3" tid=15 Native
  #00  pc 0x00000000000e5df4  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
  #01  pc 0x0000000000097f1c  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
  #02  pc 0x000000000005b458  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+280)
  #03  pc 0x000000000005b748  /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand+24)
  #04  pc 0x000000000005c064  /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool+68)
  #05  pc 0x000000000008bed8  /system/lib64/libbinder.so (android::PoolThread::threadLoop+24)
  #06  pc 0x0000000000013460  /system/lib64/libutils.so (android::Thread::_threadLoop+416)
  #07  pc 0x00000000000cd55c  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell+140)
  #08  pc 0x00000000000fba4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
  #09  pc 0x000000000008e5f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"binder:3962_4" tid=16 Native
  #00  pc 0x00000000000e5df4  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
  #01  pc 0x0000000000097f1c  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
  #02  pc 0x000000000005b458  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+280)
  #03  pc 0x000000000005b748  /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand+24)
  #04  pc 0x000000000005c064  /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool+68)
  #05  pc 0x000000000008bed8  /system/lib64/libbinder.so (android::PoolThread::threadLoop+24)
  #06  pc 0x0000000000013460  /system/lib64/libutils.so (android::Thread::_threadLoop+416)
  #07  pc 0x00000000000cd55c  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell+140)
  #08  pc 0x00000000000fba4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
  #09  pc 0x000000000008e5f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"3962-ScoutStateMachine" tid=17 Native
  #00  pc 0x00000000000e6dd8  /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8)
  #01  pc 0x0000000000017edc  /system/lib64/libutils.so (android::Looper::pollInner+188)
  #02  pc 0x0000000000017dc0  /system/lib64/libutils.so (android::Looper::pollOnce+112)
  #03  pc 0x00000000001666dc  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce+44)
  at android.os.MessageQueue.nativePollOnce (Native method)
  at android.os.MessageQueue.next (MessageQueue.java:341)
  at android.os.Looper.loopOnce (Looper.java:169)
  at android.os.Looper.loop (Looper.java:300)
  at android.os.HandlerThread.run (HandlerThread.java:67)

"Profile Saver" tid=18 Native
  #00  pc 0x000000000008921c  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
  #01  pc 0x00000000002377f0  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks+140)
  #02  pc 0x00000000003d68a0  /apex/com.android.art/lib64/libart.so (art::ProfileSaver::Run+864)
  #03  pc 0x00000000003cc298  /apex/com.android.art/lib64/libart.so (art::ProfileSaver::RunProfileSaverThread+152)
  #04  pc 0x00000000000fba4c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start+204)
  #05  pc 0x000000000008e5f0  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"pool-3-thread-1" tid=19 Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:341)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block (AbstractQueuedSynchronizer.java:506)
  at java.util.concurrent.ForkJoinPool.unmanagedBlock (ForkJoinPool.java:3466)
  at java.util.concurrent.ForkJoinPool.managedBlock (ForkJoinPool.java:3437)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:1623)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:435)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1071)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

"ScionFrontendApi" tid=20 Timed Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:1672)
  at java.util.concurrent.LinkedBlockingQueue.poll (LinkedBlockingQueue.java:460)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1070)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

"pool-16-thread-1" tid=21 Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.park (LockSupport.java:341)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionNode.block (AbstractQueuedSynchronizer.java:506)
  at java.util.concurrent.ForkJoinPool.unmanagedBlock (ForkJoinPool.java:3466)
  at java.util.concurrent.ForkJoinPool.managedBlock (ForkJoinPool.java:3437)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:1623)
  at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:435)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1071)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

"pool-9-thread-1" tid=22 Timed Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
  at java.util.concurrent.SynchronousQueue$TransferStack.transfer (SynchronousQueue.java:401)
  at java.util.concurrent.SynchronousQueue.poll (SynchronousQueue.java:903)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1070)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

"pool-14-thread-1" tid=23 Timed Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
  at java.util.concurrent.SynchronousQueue$TransferStack.transfer (SynchronousQueue.java:401)
  at java.util.concurrent.SynchronousQueue.poll (SynchronousQueue.java:903)
  at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1070)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1131)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
  at java.lang.Thread.run (Thread.java:1012)

"pool-15-thread-1" tid=24 Timed Waiting
  at jdk.internal.misc.Unsafe.park (Native method)
  at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:252)
  at java.util.concurrent.SynchronousQueue$TransferStack.transfer (SynchronousQueue.java:401)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

@wasif-life thanks for reaching out! We're investigating this and will get back to you as soon as possible.

@chokokatana
Copy link

I'm already seeing #1791, #1612, #1596, with the same stacktrace. Still getting the same problem with version 4.8.9:

      OS_GMS_LOCATION_FALLBACK (waiting):tid=24 systid=15114 
       at jdk.internal.misc.Unsafe.park(Native method)
       at java.util.concurrent.locks.LockSupport.park(LockSupport.java:211)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:715)
       at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:938)
       at java.util.concurrent.locks.ReentrantLock$Sync.lock(ReentrantLock.java:153)
       at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:322)
       at com.google.android.gms.common.api.internal.zabe.disconnect(com.google.android.gms:play-services-base@@18.3.0:1)
       at java.lang.reflect.Method.invoke(Native method)
       at com.onesignal.GoogleApiClientCompatProxy.disconnect(GoogleApiClientCompatProxy.java:54)
       at com.onesignal.GMSLocationController.fireFailedComplete(GMSLocationController.java:102)
       at com.onesignal.LocationController.fireFailedComplete(LocationController.java:359)
       at com.onesignal.GMSLocationController$1.run(GMSLocationController.java:89)
       at java.lang.Thread.run(Thread.java:1012)

      main (blocked):tid=1 systid=13881 | waiting to lock <0x0964ed67> (com.onesignal.k) held by thread 24
       at com.onesignal.LocationController.onFocusChange(LocationController.java:335)
       at com.onesignal.OneSignal.onAppFocus(OneSignal.java:1409)
       at com.onesignal.OSFocusHandler.startOnFocusWork(OSFocusHandler.java:53)
       at com.onesignal.ActivityLifecycleHandler.handleFocus(ActivityLifecycleHandler.java:197)
       at com.onesignal.ActivityLifecycleHandler.onActivityResumed(ActivityLifecycleHandler.java:95)
       at com.onesignal.ActivityLifecycleListener.onActivityResumed(ActivityLifecycleListener.java:91)
       at android.app.Application.dispatchActivityResumed(Application.java:450)
       at android.app.Activity.dispatchActivityResumed(Activity.java:1523)
       at android.app.Activity.onResume(Activity.java:2124)
       at androidx.fragment.app.FragmentActivity.onResume(FragmentActivity.java:309)
       at com.geodb.wallace.presentation.base.BaseActivity.onResume(BaseActivity.kt:71)
       at com.geodb.wallace.presentation.main.MainActivity.onResume(MainActivity.kt:119)
       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1603)
       at android.app.Activity.performResume(Activity.java:9134)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:5399)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:5508)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:180)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:98)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2685)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8919)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
…

Maybe the access to the synchronized block shouldn't happen on the main thread?. There's another background thread locking the access, so if the onFocus spawned a thread rather than locking directly, at least it wouldn't deadlock the main thread.

@jkasten2 jkasten2 changed the title [Bug]: Native method - jdk.internal.misc.Unsafe.park [Bug]: 4.x.x - ANR - Native method - jdk.internal.misc.Unsafe.park Jul 9, 2024
@pierroo
Copy link

pierroo commented Oct 3, 2024

has there been any update on that one? it's been a few years, still happening

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants