We have an ANR where the HeapTaskDaemon is blocked and the main thread is waiting and not busy/blocked. There are no parts of our code in any of the threads. How to debug this ANR? From what I see there is no deadlock and nothing heavy is being done on the main thread.
It also doesn't seem to be a long running operation in an INTENT.
Any trips on understanding the ANR would be really helpful. Also what does HeapTaskDaemon waiting to lock unknown object mean ?
Here is the HeapTaskDaemon thread:
HeapTaskDaemon" daemon prio=5 tid=6 Blocked
| group="system" sCount=1 dsCount=0 flags=1 obj=0x140c0338 self=0xa41d1400
| sysTid=1239 nice=4 cgrp=default sched=0/0 handle=0x99e3b970
| state=S schedstat=( 0 0 0 ) utm=515 stm=86 core=1 HZ=100
| stack=0x99d39000-0x99d3b000 stackSize=1038KB
| held mutexes=
#00 pc 000000000001902c /system/lib/libc.so (syscall+28)
#01 pc 00000000000b7289 /system/lib/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+88)
#02 pc 00000000001cc795 /system/lib/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+284)
#03 pc 00000000001ccd75 /system/lib/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+44)
#04 pc 00000000000551e3 /system/framework/arm/boot-core-libart.oat (Java_dalvik_system_VMRuntime_runHeapTasks__+74)
at dalvik.system.VMRuntime.runHeapTasks (Native method)
- waiting to lock an unknown object
at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:461)
at java.lang.Daemons$Daemon.run (Daemons.java:103)
at java.lang.Thread.run (Thread.java:764)
Main Thread:
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x70cb3f08 self=0xac6a8000
| sysTid=1230 nice=-2 cgrp=default sched=0/0 handle=0xb07a64a4
| state=S schedstat=( 0 0 0 ) utm=2107 stm=662 core=1 HZ=100
| stack=0xbe6e0000-0xbe6e2000 stackSize=8MB
| held mutexes=
#00 pc 0000000000049658 /system/lib/libc.so (__epoll_pwait+20)
#01 pc 000000000001b7b5 /system/lib/libc.so (epoll_pwait+60)
#02 pc 000000000001b7e5 /system/lib/libc.so (epoll_wait+12)
#03 pc 000000000001008b /system/lib/libutils.so (android::Looper::pollInner(int)+118)
#04 pc 000000000000ff7d /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+32)
#05 pc 00000000000b2d0d /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int)+24)
#06 pc 00000000000ba5d5 /system/framework/arm/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+92)
at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
at android.os.MessageQueue.next (MessageQueue.java:325)
at android.os.Looper.loop (Looper.java:142)
at com.android.server.SystemServer.run (SystemServer.java:423)
at com.android.server.SystemServer.main (SystemServer.java:274)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:787)
The full ANR log is at https://pastebin.com/i4F4VgTS
Once again Google/Android9 crashes somewhere in native code library without giving any idea through Java stack trace or otherwise about where it happened and why.
In my case it happened during "REGISTER_AGENT" intent issued by Samsung SAP library.
Probably it's related to Samsung SAP library, but it's specific to Android9 only and it doesn't happen very often.
Any hint and help are appreciated.
Broadcast of Intent { act=com.samsung.accessory.action.REGISTER_AGENT flg=0x30 pkg=[package_name] cmp=[package_name]/com.samsung.android.sdk.accessory.RegisterUponInstallReceiver }
com.samsung.android.sdk.accessory.RegisterUponInstallReceiver
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x75952fb8 self=0x7368414c00
| sysTid=16534 nice=0 cgrp=default sched=0/0 handle=0x73eee21560
| state=S schedstat=( 92637885 21726999 102 ) utm=1 stm=7 core=1 HZ=100
| stack=0x7fd3ecd000-0x7fd3ecf000 stackSize=8MB
| held mutexes=
#00 pc 00000000000712e0 /system/lib64/libc.so (__epoll_pwait+8)
#01 pc 00000000000141c0 /system/lib64/libutils.so (android::Looper::pollInner(int)+144)
#02 pc 000000000001408c /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+60)
#03 pc 000000000012c25c /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44)
at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
at android.os.MessageQueue.next (MessageQueue.java:326)
at android.os.Looper.loop (Looper.java:181)
at android.app.ActivityThread.main (ActivityThread.java:6990)
at java.lang.reflect.Method.invoke (Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1445)
"Jit thread pool worker thread 0" tid=2 Native
"Jit thread pool worker thread 0" daemon prio=5 tid=2 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x132001a0 self=0x7361e24400
| sysTid=16540 nice=9 cgrp=default sched=0/0 handle=0x7361dff4f0
| state=S schedstat=( 1490961 201962 5 ) utm=0 stm=0 core=1 HZ=100
| stack=0x7361d01000-0x7361d03000 stackSize=1021KB
| held mutexes=
#00 pc 000000000001eeac /system/lib64/libc.so (syscall+28)
#01 pc 00000000000d7c24 /system/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)
#02 pc 00000000004b6614 /system/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)+260)
#03 pc 00000000004b5b6c /system/lib64/libart.so (art::ThreadPoolWorker::Run()+124)
#04 pc 00000000004b561c /system/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+148)
#05 pc 0000000000084df8 /system/lib64/libc.so (__pthread_start(void*)+208)
#06 pc 0000000000023ac4 /system/lib64/libc.so (__start_thread+68)
"ReferenceQueueDaemon" tid=4 Waiting
"ReferenceQueueDaemon" daemon prio=5 tid=4 Waiting
| group="system" sCount=1 dsCount=0 flags=1 obj=0x132002b0 self=0x73684e2000
| sysTid=16542 nice=4 cgrp=default sched=0/0 handle=0x7350ed74f0
| state=S schedstat=( 1160387 6055884 11 ) utm=0 stm=0 core=0 HZ=100
| stack=0x7350dd4000-0x7350dd6000 stackSize=1041KB
| held mutexes=
at java.lang.Object.wait (Native method)
- waiting on <0x0727dab7> (a java.lang.Class<java.lang.ref.ReferenceQueue>)
at java.lang.Daemons$ReferenceQueueDaemon.runInternal (Daemons.java:178)
- locked <0x0727dab7> (a java.lang.Class<java.lang.ref.ReferenceQueue>)
at java.lang.Daemons$Daemon.run (Daemons.java:103)
at java.lang.Thread.run (Thread.java:764)
"FinalizerWatchdogDaemon" tid=5 Waiting
"FinalizerWatchdogDaemon" daemon prio=5 tid=5 Waiting
| group="system" sCount=1 dsCount=0 flags=1 obj=0x13200338 self=0x73684e3800
| sysTid=16544 nice=4 cgrp=default sched=0/0 handle=0x7350ccb4f0
| state=S schedstat=( 428733 6635577 9 ) utm=0 stm=0 core=0 HZ=100
| stack=0x7350bc8000-0x7350bca000 stackSize=1041KB
| held mutexes=
at java.lang.Object.wait (Native method)
- waiting on <0x01261224> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded (Daemons.java:297)
- locked <0x01261224> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal (Daemons.java:277)
at java.lang.Daemons$Daemon.run (Daemons.java:103)
at java.lang.Thread.run (Thread.java:764)
"FinalizerDaemon" tid=6 Waiting
"FinalizerDaemon" daemon prio=5 tid=6 Waiting
| group="system" sCount=1 dsCount=0 flags=1 obj=0x132003c0 self=0x73684e2c00
| sysTid=16543 nice=4 cgrp=default sched=0/0 handle=0x7350dd14f0
| state=S schedstat=( 1754693 6156655 10 ) utm=0 stm=0 core=0 HZ=100
| stack=0x7350cce000-0x7350cd0000 stackSize=1041KB
| held mutexes=
at java.lang.Object.wait (Native method)
- waiting on <0x0294e18d> (a java.lang.Object)
at java.lang.Object.wait (Object.java:422)
at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:188)
- locked <0x0294e18d> (a java.lang.Object)
at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:209)
at java.lang.Daemons$FinalizerDaemon.runInternal (Daemons.java:232)
at java.lang.Daemons$Daemon.run (Daemons.java:103)
at java.lang.Thread.run (Thread.java:764)
"Binder:16534_1" tid=8 Native
"Binder:16534_1" prio=5 tid=8 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x13200448 self=0x735e88d000
| sysTid=16546 nice=0 cgrp=default sched=0/0 handle=0x73509c14f0
| state=S schedstat=( 1058729 78231 14 ) utm=0 stm=0 core=1 HZ=100
| stack=0x73508c6000-0x73508c8000 stackSize=1009KB
| held mutexes=
#00 pc 00000000000713cc /system/lib64/libc.so (__ioctl+4)
#01 pc 0000000000029c48 /system/lib64/libc.so (ioctl+136)
#02 pc 000000000005ac9c /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+260)
#03 pc 000000000005ae78 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)
#04 pc 000000000005b5cc /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60)
#05 pc 000000000007c090 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
#06 pc 000000000000fb80 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
#07 pc 00000000000bcbf4 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
#08 pc 0000000000084df8 /system/lib64/libc.so (__pthread_start(void*)+208)
#09 pc 0000000000023ac4 /system/lib64/libc.so (__start_thread+68)
"Binder:16534_2" tid=9 Native
"Binder:16534_2" prio=5 tid=9 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x132004d0 self=0x735fd04000
| sysTid=16547 nice=0 cgrp=default sched=0/0 handle=0x73508c34f0
| state=S schedstat=( 5113655 9872309 15 ) utm=0 stm=0 core=1 HZ=100
| stack=0x73507c8000-0x73507ca000 stackSize=1009KB
| held mutexes=
#00 pc 00000000000713cc /system/lib64/libc.so (__ioctl+4)
#01 pc 0000000000029c48 /system/lib64/libc.so (ioctl+136)
#02 pc 000000000005ac9c /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+260)
#03 pc 000000000005ae78 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)
#04 pc 000000000005b5cc /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60)
#05 pc 000000000007c090 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
#06 pc 000000000000fb80 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
#07 pc 00000000000bcbf4 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
#08 pc 0000000000084df8 /system/lib64/libc.so (__pthread_start(void*)+208)
#09 pc 0000000000023ac4 /system/lib64/libc.so (__start_thread+68)
"Profile Saver" tid=10 Native
"Profile Saver" daemon prio=5 tid=10 Native
| group="system" sCount=1 dsCount=0 flags=1 obj=0x13200558 self=0x7361e29800
| sysTid=16548 nice=9 cgrp=default sched=0/0 handle=0x73500034f0
| state=S schedstat=( 13089538 7896001 11 ) utm=0 stm=0 core=0 HZ=100
| stack=0x734ff08000-0x734ff0a000 stackSize=1009KB
| held mutexes=
#00 pc 000000000001eeac /system/lib64/libc.so (syscall+28)
#01 pc 00000000000d7c24 /system/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)
#02 pc 000000000032a168 /system/lib64/libart.so (art::ProfileSaver::Run()+384)
#03 pc 000000000032d58c /system/lib64/libart.so (art::ProfileSaver::RunProfileSaverThread(void*)+92)
#04 pc 0000000000084df8 /system/lib64/libc.so (__pthread_start(void*)+208)
#05 pc 0000000000023ac4 /system/lib64/libc.so (__start_thread+68)
"Timer-0" tid=11 TimedWaiting
"Timer-0" prio=5 tid=11 TimedWaiting
| group="main" sCount=1 dsCount=0 flags=1 obj=0x132005e0 self=0x735fcae000
| sysTid=16551 nice=0 cgrp=default sched=0/0 handle=0x734fe5b4f0
| state=S schedstat=( 24982964 11812847 67 ) utm=1 stm=0 core=1 HZ=100
| stack=0x734fd58000-0x734fd5a000 stackSize=1041KB
| held mutexes=
at java.lang.Object.wait (Native method)
- waiting on <0x062b2f42> (a java.util.TaskQueue)
at java.lang.Object.wait (Object.java:422)
at java.util.TimerThread.mainLoop (Timer.java:559)
- locked <0x062b2f42> (a java.util.TaskQueue)
at java.util.TimerThread.run (Timer.java:512)
"RegistrationThread" tid=12 Waiting
"RegistrationThread" prio=5 tid=12 Waiting
| group="main" sCount=1 dsCount=0 flags=1 obj=0x132006a8 self=0x73684b3000
| sysTid=16555 nice=0 cgrp=default sched=0/0 handle=0x734fd554f0
| state=S schedstat=( 360153 6123923 4 ) utm=0 stm=0 core=0 HZ=100
| stack=0x734fc52000-0x734fc54000 stackSize=1041KB
| held mutexes=
at java.lang.Object.wait (Native method)
- waiting on <0x07d56b53> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:2137)
- locked <0x07d56b53> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:358)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190)
at java.util.concurrent.FutureTask.awaitDone (FutureTask.java:450)
at java.util.concurrent.FutureTask.get (FutureTask.java:192)
at com.samsung.android.sdk.accessory.RegisterUponInstallReceiver$1.run (unavailable)
"RegistreationThread" tid=13 Native
"RegistreationThread" prio=5 tid=13 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x13200990 self=0x73684b3c00
| sysTid=16556 nice=0 cgrp=default sched=0/0 handle=0x734fc4f4f0
| state=S schedstat=( 8286656 6348153 18 ) utm=0 stm=0 core=1 HZ=100
| stack=0x734fb4c000-0x734fb4e000 stackSize=1041KB
| held mutexes=
#00 pc 00000000000713cc /system/lib64/libc.so (__ioctl+4)
#01 pc 0000000000029c48 /system/lib64/libc.so (ioctl+136)
#02 pc 000000000005ac9c /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+260)
#03 pc 000000000005bb70 /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse(android::Parcel*, int*)+360)
#04 pc 000000000005b890 /system/lib64/libbinder.so (android::IPCThreadState::transact(int, unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+176)
#05 pc 0000000000051560 /system/lib64/libbinder.so (android::BpBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+72)
#06 pc 000000000013c110 /system/lib64/libandroid_runtime.so (android_os_BinderProxy_transact(_JNIEnv*, _jobject*, int, _jobject*, _jobject*, int)+152)
at android.os.BinderProxy.transactNative (Native method)
at android.os.BinderProxy.transact (Binder.java:1142)
at com.samsung.accessory.api.ISAFrameworkManagerV2$Stub$Proxy.registerComponent (unavailable)
at com.samsung.android.sdk.accessory.SAAdapter.a (unavailable)
- locked <0x01c42c90> (a com.samsung.android.sdk.accessory.SAAdapter)
at com.samsung.android.sdk.accessory.j$a.a (unavailable)
at com.samsung.android.sdk.accessory.j$a.call (unavailable)
at java.util.concurrent.FutureTask.run (FutureTask.java:266)
at java.lang.Thread.run (Thread.java:764)
"Binder:16534_3" tid=14 Native
"Binder:16534_3" prio=5 tid=14 Native
| group="main" sCount=1 dsCount=0 flags=1 obj=0x13201170 self=0x735e918000
| sysTid=16617 nice=0 cgrp=default sched=0/0 handle=0x734fb494f0
| state=S schedstat=( 4330424 370692 5 ) utm=0 stm=0 core=1 HZ=100
| stack=0x734fa4e000-0x734fa50000 stackSize=1009KB
| held mutexes=
#00 pc 00000000000713cc /system/lib64/libc.so (__ioctl+4)
#01 pc 0000000000029c48 /system/lib64/libc.so (ioctl+136)
#02 pc 000000000005ac9c /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+260)
#03 pc 000000000005ae78 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)
#04 pc 000000000005b5cc /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60)
#05 pc 000000000007c090 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
#06 pc 000000000000fb80 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+280)
#07 pc 00000000000bcbf4 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
#08 pc 0000000000084df8 /system/lib64/libc.so (__pthread_start(void*)+208)
#09 pc 0000000000023ac4 /system/lib64/libc.so (__start_thread+68)
"Signal Catcher" tid=3 Runnable
"Signal Catcher" daemon prio=5 tid=3 Runnable
| group="system" sCount=0 dsCount=0 flags=0 obj=0x13200228 self=0x7368416400
| sysTid=16541 nice=0 cgrp=default sched=0/0 handle=0x7361cfe4f0
| state=R schedstat=( 53512999 6126116 5 ) utm=2 stm=2 core=0 HZ=100
| stack=0x7361c03000-0x7361c05000 stackSize=1009KB
| held mutexes= "mutator lock"(shared held)
#00 pc 00000000003cb35c /system/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+220)
#01 pc 000000000049aca8 /system/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+352)
#02 pc 00000000004b4d9c /system/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+844)
#03 pc 00000000004adadc /system/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+476)
#04 pc 00000000004acec0 /system/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+1120)
#05 pc 00000000004ac974 /system/lib64/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char>>&)+884)
#06 pc 000000000047c26c /system/lib64/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char>>&)+188)
#07 pc 00000000004881bc /system/lib64/libart.so (art::SignalCatcher::HandleSigQuit()+1468)
#08 pc 0000000000486ea4 /system/lib64/libart.so (art::SignalCatcher::Run(void*)+380)
#09 pc 0000000000084df8 /system/lib64/libc.so (__pthread_start(void*)+208)
#10 pc 0000000000023ac4 /system/lib64/libc.so (__start_thread+68)
"HeapTaskDaemon" tid=7
"HeapTaskDaemon" daemon prio=5 tid=7 WaitingForTaskProcessor
| group="system" sCount=1 dsCount=0 flags=1 obj=0x132011f8 self=0x735fc37c00
| sysTid=16545 nice=4 cgrp=default sched=0/0 handle=0x7350bc54f0
| state=S schedstat=( 49512888 1873077 14 ) utm=4 stm=0 core=1 HZ=100
| stack=0x7350ac2000-0x7350ac4000 stackSize=1041KB
| held mutexes=
#00 pc 000000000001eeac /system/lib64/libc.so (syscall+28)
#01 pc 00000000000d7c24 /system/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)
#02 pc 0000000000230820 /system/lib64/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+504)
#03 pc 0000000000231098 /system/lib64/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+96)
at dalvik.system.VMRuntime.runHeapTasks (Native method)
at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:475)
at java.lang.Daemons$Daemon.run (Daemons.java:103)
at java.lang.Thread.run (Thread.java:764)
© 2019 Google · Mobile App · Help · Site Terms · Privacy · Developer Distribution Agreement
After updating the Facebook SDK version from 4.40.0 to 5.4.0, my app is getting a ton of ANRs. 12k ANRs in one day, the users couldn't even open the app.
Full Stack trace:
"main" prio=5 tid=1 Waiting
| group="main" sCount=1 dsCount=0 obj=0x7496b268 self=0xb2c84400
| sysTid=8451 nice=0 cgrp=default sched=0/0 handle=0xb5b72534
| state=S schedstat=( 0 0 0 ) utm=12 stm=7 core=2 HZ=100
| stack=0xbe6c2000-0xbe6c4000 stackSize=8MB
| held mutexes=
at java.lang.Object.wait (Native method)
- waiting on <0x047bbe7f> (a java.lang.Object)
at java.lang.Thread.parkFor$ (Thread.java:2127)
- locked <0x047bbe7f> (a java.lang.Object)
at sun.misc.Unsafe.park (Unsafe.java:325)
at java.util.concurrent.locks.LockSupport.park (LockSupport.java:161)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt (AbstractQueuedSynchronizer.java:840)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly (AbstractQueuedSynchronizer.java:994)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly (AbstractQueuedSynchronizer.java:1303)
at java.util.concurrent.CountDownLatch.await (CountDownLatch.java:203)
at com.facebook.internal.LockOnGetVariable.waitOnInit (LockOnGetVariable.java:64)
at com.facebook.internal.LockOnGetVariable.getValue (LockOnGetVariable.java:54)
at com.facebook.FacebookSdk.getCacheDir (FacebookSdk.java:954)
at com.facebook.internal.instrument.InstrumentUtility.getInstrumentReportDir (InstrumentUtility.java:242)
at com.facebook.internal.instrument.InstrumentUtility.listCrashReportFiles (InstrumentUtility.java:124)
at com.facebook.internal.instrument.crashreport.CrashHandler.sendCrashReports (CrashHandler.java:101)
at com.facebook.internal.instrument.crashreport.CrashHandler.enable (CrashHandler.java:73)
- locked <0x01f4fe4c> (a java.lang.Class<com.facebook.internal.instrument.crashreport.CrashHandler>)
at com.facebook.internal.instrument.InstrumentManager.start (InstrumentManager.java:46)
at com.facebook.FacebookSdk.sdkInitialize (FacebookSdk.java:326)
- locked <0x05939e95> (a java.lang.Class<com.facebook.FacebookSdk>)
at com.facebook.marketing.internal.MarketingInitProvider.onCreate (MarketingInitProvider.java:42)
at android.content.ContentProvider.attachInfo (ContentProvider.java:1753)
at android.content.ContentProvider.attachInfo (ContentProvider.java:1728)
at android.app.ActivityThread.installProvider (ActivityThread.java:6066)
at android.app.ActivityThread.installContentProviders (ActivityThread.java:5658)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5597)
at android.app.ActivityThread.-wrap2 (ActivityThread.java)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1614)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:154)
at android.app.ActivityThread.main (ActivityThread.java:6351)
at java.lang.reflect.Method.invoke! (Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:896)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:786)
"GoogleApiHandler" tid=22 Native
"GoogleApiHandler" prio=5 tid=22 Native
| group="main" sCount=1 dsCount=0 obj=0x22c0caf0 self=0xab5c6700
| sysTid=8512 nice=9 cgrp=default sched=0/0 handle=0x95332920
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=1 HZ=100
| stack=0x95230000-0x95232000 stackSize=1038KB
| held mutexes=
#00 pc 0000000000048e38 /system/lib/libc.so (__epoll_pwait+20)
#01 pc 000000000001a291 /system/lib/libc.so (epoll_pwait+60)
#02 pc 000000000001a2c1 /system/lib/libc.so (epoll_wait+12)
#03 pc 0000000000011e77 /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+118)
#04 pc 0000000000011d73 /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+26)
#05 pc 0000000000096fbd /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
#06 pc 000000000067f0a5 /system/framework/arm/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+96)
at android.os.MessageQueue.nativePollOnce (Native method)
at android.os.MessageQueue.next (MessageQueue.java:323)
at android.os.Looper.loop (Looper.java:136)
at android.os.HandlerThread.run (HandlerThread.java:61)
"TokenRefresher" tid=23 Native
"TokenRefresher" prio=5 tid=23 Native
| group="main" sCount=1 dsCount=0 obj=0x22c0cb80 self=0xab5c5d00
| sysTid=8513 nice=10 cgrp=bg_non_interactive sched=0/0 handle=0x9573c920
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2 HZ=100
| stack=0x9563a000-0x9563c000 stackSize=1038KB
| held mutexes=
#00 pc 0000000000048e38 /system/lib/libc.so (__epoll_pwait+20)
#01 pc 000000000001a291 /system/lib/libc.so (epoll_pwait+60)
#02 pc 000000000001a2c1 /system/lib/libc.so (epoll_wait+12)
#03 pc 0000000000011e77 /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+118)
#04 pc 0000000000011d73 /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+26)
#05 pc 0000000000096fbd /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
#06 pc 000000000067f0a5 /system/framework/arm/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+96)
at android.os.MessageQueue.nativePollOnce (Native method)
at android.os.MessageQueue.next (MessageQueue.java:323)
at android.os.Looper.loop (Looper.java:136)
at android.os.HandlerThread.run (HandlerThread.java:61)
I downgraded to version 4.40.0 and the issue has been resolved, but Facebook is constantly sending me alerts to update the SDK, how to solve? I lost thousands of users and several negative reviews.
The Facebook team noticed the issue and fixed it in version 5.5.0.
Commit: https://github.com/facebook/facebook-android-sdk/commit/856665c5e0ede060b3a0f18af8a808aba26d4778
Android ANR with the trace stack
And what does "waiting to lock an unknown object" mean?
"HeapTaskDaemon" daemon prio=5 tid=5 Blocked
| group="system" sCount=1 dsCount=0 obj=0x32c071c0 self=0x557f72c1b0
| sysTid=6892 nice=0 cgrp=top_visible sched=0/0 handle=0x7fa0ffe450
| state=S schedstat=( 53102724244 2289704943 17272 ) utm=4756 stm=554 core=7 HZ=100
| stack=0x7fa0efc000-0x7fa0efe000 stackSize=1037KB
| held mutexes=
kernel: (couldn't read /proc/self/task/6892/stack)
native: #00 pc 0000000000019aa4 /system/lib64/libc.so (syscall+32)
native: #01 pc 000000000013adb8 /system/lib64/libart.so (_ZN3art17ConditionVariable9TimedWaitEPNS_6ThreadEli+164)
native: #02 pc 000000000026ad28 /system/lib64/libart.so (_ZN3art2gc13TaskProcessor7GetTaskEPNS_6ThreadE+228)
native: #03 pc 000000000026b32c /system/lib64/libart.so (_ZN3art2gc13TaskProcessor11RunAllTasksEPNS_6ThreadE+120)
native: #04 pc 000000000000054c /data/dalvik-cache/arm64/system#framework#boot.oat (Java_dalvik_system_VMRuntime_runHeapTasks__+128)
at dalvik.system.VMRuntime.runHeapTasks(Native method)
- waiting to lock an unknown object
at java.lang.Daemons$HeapTaskDaemon.run(Daemons.java:355)
at java.lang.Thread.run(Thread.java:833)
There is one ANR report which I need help to understand it. It is only happened to this user so far. Under the main thread, I can't find anything related to my app package.
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x7392f2a0 self=0xb8bdcd80
| sysTid=1973 nice=-2 cgrp=native sched=0/0 handle=0xb6f3cb34
| state=S schedstat=( 52372964435 58689172479 125804 ) utm=3878 stm=1359 core=7 HZ=100
| stack=0xbe395000-0xbe397000 stackSize=8MB
| held mutexes=
kernel: (couldn't read /proc/self/task/1973/stack)
native: #00 pc 00042f0c /system/lib/libc.so (__epoll_pwait+20)
native: #01 pc 0001967f /system/lib/libc.so (epoll_pwait+26)
native: #02 pc 0001968d /system/lib/libc.so (epoll_wait+6)
native: #03 pc 00012da3 /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+102)
native: #04 pc 0001301f /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+130)
native: #05 pc 00083ed1 /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
native: #06 pc 00000585 /system/framework/arm/boot.oat (Java_android_os_MessageQueue_nativePollOnce__JI+96)
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:135)
at com.android.server.SystemServer.run(SystemServer.java:288)
at com.android.server.SystemServer.main(SystemServer.java:173)
at java.lang.reflect.Method.invoke!(Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
And I noticed this thread which is blocked. However, I don't know how to trace from there.
"HeapTaskDaemon" daemon prio=5 tid=6 Blocked
| group="system" sCount=1 dsCount=0 obj=0x12c041c0 self=0xb8c02318
| sysTid=1982 nice=0 cgrp=native sched=0/0 handle=0xb40c3930
| state=S schedstat=( 68261230481 5881920066 14105 ) utm=6561 stm=265 core=7 HZ=100
| stack=0xb3fc1000-0xb3fc3000 stackSize=1038KB
| held mutexes=
kernel: (couldn't read /proc/self/task/1982/stack)
native: #00 pc 000169b8 /system/lib/libc.so (syscall+28)
native: #01 pc 000f60bb /system/lib/libart.so (_ZN3art17ConditionVariable4WaitEPNS_6ThreadE+82)
native: #02 pc 001cdff1 /system/lib/libart.so (_ZN3art2gc13TaskProcessor7GetTaskEPNS_6ThreadE+92)
native: #03 pc 001ce505 /system/lib/libart.so (_ZN3art2gc13TaskProcessor11RunAllTasksEPNS_6ThreadE+60)
native: #04 pc 00000387 /system/framework/arm/boot.oat (Java_dalvik_system_VMRuntime_runHeapTasks__+74)
at dalvik.system.VMRuntime.runHeapTasks(Native method)
- waiting to lock an unknown object
at java.lang.Daemons$HeapTaskDaemon.run(Daemons.java:355)
at java.lang.Thread.run(Thread.java:818)
Here is the complete file. Thanks for the input.
ANR file