HeapTaskDaemon blocked ANR. Other threads seem to be in waiting state
Asked Answered
M

0

10

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

Monseigneur answered 28/2, 2020 at 10:14 Comment(3)
Related: #44475610Unwinking
Did you figure this out?Winchell
@Winchell not yet. no.Monseigneur

© 2022 - 2024 — McMap. All rights reserved.