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
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)
In an native cpp application compiled for Android I am getting ANR error with the cause keyDispatchingTimedOut.It only happens sometimes when the app switches from native activity to java activity.
Nothing in the error report really stands out. Most of the threads just sit in a loop waiting for input. I cant disclose any code but the code at 58b505 is from android_native_app_glue library.
I have attached the ANR error report: full ANR on pastebin
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x741e33c0 self=0xab684ea8
| sysTid=29202 nice=-1 cgrp=default sched=0/0 handle=0xf778fb34
| state=S schedstat=( 962236509 24407600 624 ) utm=84 stm=12 core=4 HZ=100
| stack=0xff56e000-0xff570000 stackSize=8MB
| held mutexes=
native: pc 0000000000042c9c /system/lib/libc.so (__epoll_pwait+20)
native: pc 00000000000195cf /system/lib/libc.so (epoll_pwait+26)
native: pc 00000000000195dd /system/lib/libc.so (epoll_wait+6)
native: pc 0000000000012d8b /system/lib/libutils.so (_ZN7android6Looper9pollInnerEi+102)
native: pc 0000000000013007 /system/lib/libutils.so (_ZN7android6Looper8pollOnceEiPiS1_PPv+130)
native: pc 00000000000836fd /system/lib/libandroid_runtime.so (_ZN7android18NativeMessageQueue8pollOnceEP7_JNIEnvP8_jobjecti+22)
native: pc 000000000000055d /data/dalvik-cache/arm/system#framework#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 android.app.ActivityThread.main (ActivityThread.java:5438)
at java.lang.reflect.Method.invoke! (Native method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:738)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:628)
"Thread-295" prio=6 tid=17 Native
| group="main" sCount=1 dsCount=0 obj=0x12c630a0 self=0xabdbcd60
| sysTid=29269 nice=-1 cgrp=default sched=0/0 handle=0xdabfd930
| state=S schedstat=( 15667236 2344530 115 ) utm=0 stm=1 core=6 HZ=100
| stack=0xdab01000-0xdab03000 stackSize=1014KB
| held mutexes=
native: pc 0000000000016908 /system/lib/libc.so (syscall+28)
native: pc 000000000004167b /system/lib/libc.so (_ZL33__pthread_cond_timedwait_relativeP23pthread_cond_internal_tP15pthread_mutex_tPK8timespec+56)
native: pc 000000000058b505 /data/app/com.package-1/lib/arm/libgame.so (???)
native: pc 000000000058b2ed /data/app/com.package-1/lib/arm/libgame.so (???)
native: pc 00000000005ac4c7 /data/app/com.package-1/lib/arm/libgame.so (???)
native: pc 000000000004185b /system/lib/libc.so (_ZL15__pthread_startPv+30)
native: pc 00000000000192a5 /system/lib/libc.so (__start_thread+6)
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
I have witnessed and have received reports of a rare but particularly nasty ANR in my app that causes the app to be completely useless unless it's uninstalled and reinstalled, not even Force Stopping the app (which is supposed to shutdown the entire process) can get the app out of the ANR.
I haven't been able to get anything out of the ANR reports, but this one has some useful information. It appears MediaCodec.dequeueInputBuffer is not returning. It is being given a timeout of 200000 microseconds. This is happening in a synchronized block of code off the main thread, in which all operations involving the MediaCodec and MediaExtractor objects take place. The main thread is waiting for the lock to enter a code block containing a call to MediaExtractor.seekTo().
The whole code for SoundTouchPlayable and MediaCodecAudioDecoder can bet found at https://github.com/svenoaks/SoundTouch-Android/tree/master/src/com/smp/soundtouchandroid
The lockup in the non-main thread is happening in MediaCodecAudioDecoder line 181.
I'm not really sure what, if anything, I can do about this. What can I do?
----- pid 21484 at 2014-05-01 12:50:08 -----
Cmd line: com.smp.musicspeed
JNI: CheckJNI is off; workarounds are off; pins=0; globals=336 (plus 35 weak)
DALVIK THREADS:
(mutexes: tll=0 tsl=0 tscl=0 ghl=0)
"main" prio=5 tid=1 MONITOR
| group="main" sCount=1 dsCount=0 obj=0x41656e40 self=0x41645450
| sysTid=21484 nice=-6 sched=0/0 cgrp=apps handle=1074180436
| state=S schedstat=( 0 0 0 ) utm=936 stm=126 core=0
at com.smp.soundtouchandroid.SoundTouchPlayable.seekTo(SoundTouchPlayable.java:~292)
- waiting to lock <0x422cfb18> (a java.lang.Object) held by tid=20 (Thread-157041)
at com.smp.musicspeed.SoundTouchPlayService.seekTo(SoundTouchPlayService.java:376)
at com.smp.musicspeed.MainActivity$1$1$1.run(MainActivity.java:134)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5184)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1015)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:831)
at dalvik.system.NativeStart.main(Native Method)
"Visualizer" prio=5 tid=26 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4231ac08 self=0x6a4f1298
| sysTid=21802 nice=0 sched=0/0 cgrp=apps handle=1853423672
| state=S schedstat=( 0 0 0 ) utm=11 stm=2 core=0
#00 pc 0002114c /system/lib/libc.so (nanosleep+12)
#01 pc 0002fc17 /system/lib/libc.so (usleep+30)
#02 pc 00069fd7 /system/lib/libmedia.so (android::Visualizer::CaptureThread::threadLoop()+8)
#03 pc 0000f149 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216)
#04 pc 00050357 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+98)
#05 pc 0000ec0f /system/lib/libutils.so
#06 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#07 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"Thread-157041" prio=10 tid=20 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4231dd00 self=0x6c2c0278
| sysTid=21801 nice=-8 sched=0/0 cgrp=apps handle=1825959168
| state=S schedstat=( 0 0 0 ) utm=6 stm=0 core=0
#00 pc 00021dc4 /system/lib/libc.so (__futex_syscall3+8)
#01 pc 0000ef54 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 0000efb4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#03 pc 000098d7 /system/lib/libstagefright_foundation.so (android::ALooperRoster::postAndAwaitResponse(android::sp<android::AMessage> const&, android::sp<android::AMessage>*)+78)
#04 pc 0000a4e7 /system/lib/libstagefright_foundation.so (android::AMessage::postAndAwaitResponse(android::sp<android::AMessage>*)+26)
#05 pc 000724a3 /system/lib/libstagefright.so (android::MediaCodec::PostAndAwaitResponse(android::sp<android::AMessage> const&, android::sp<android::AMessage>*)+6)
#06 pc 00072e17 /system/lib/libstagefright.so (android::MediaCodec::dequeueInputBuffer(unsigned int*, long long)+66)
#07 pc 0001442d /system/lib/libmedia_jni.so
#08 pc 0002044c /system/lib/libdvm.so (dvmPlatformInvoke+112)
#09 pc 00054019 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+428)
#10 pc 000298e0 /system/lib/libdvm.so
#11 pc 00031840 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#12 pc 0002ed5c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+232)
#13 pc 000697c5 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
#14 pc 000697e9 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
#15 pc 0005cc7b /system/lib/libdvm.so
#16 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#17 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at android.media.MediaCodec.dequeueInputBuffer(Native Method)
at com.smp.soundtouchandroid.MediaCodecAudioDecoder.advanceInput(MediaCodecAudioDecoder.java:181)
at com.smp.soundtouchandroid.MediaCodecAudioDecoder.decodeChunk(MediaCodecAudioDecoder.java:125)
at com.smp.soundtouchandroid.SoundTouchPlayable.playFile(SoundTouchPlayable.java:373)
at com.smp.soundtouchandroid.SoundTouchPlayable.run(SoundTouchPlayable.java:228)
at java.lang.Thread.run(Thread.java:856)
"AudioTrack" prio=10 tid=19 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x4231dc40 self=0x6a699228
| sysTid=21800 nice=-16 sched=0/0 cgrp=apps handle=1785696352
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0
#00 pc 00021dc8 /system/lib/libc.so (__futex_syscall3+12)
#01 pc 0000ef54 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 000482b5 /system/lib/libmedia.so (android::AudioTrack::AudioTrackThread::threadLoop()+116)
#03 pc 0000f0d9 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+104)
#04 pc 00050357 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+98)
#05 pc 0000ec0f /system/lib/libutils.so
#06 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#07 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"OMXCallbackDisp" prio=6 tid=18 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x422ca468 self=0x6ef90ef0
| sysTid=21799 nice=-2 sched=0/0 cgrp=apps handle=1851258128
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0
#00 pc 00021dc4 /system/lib/libc.so (__futex_syscall3+8)
#01 pc 0000ef54 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 0000efb4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#03 pc 0000e719 /system/lib/libstagefright_omx.so (android::OMX::CallbackDispatcher::loop()+40)
#04 pc 0000f149 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216)
#05 pc 00050357 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+98)
#06 pc 0000ec0f /system/lib/libutils.so
#07 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#08 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"ModernAsyncTask #2" prio=5 tid=25 WAIT
| group="main" sCount=1 dsCount=0 obj=0x4244ea50 self=0x6671ffb0
| sysTid=21756 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1787397960
| state=S schedstat=( 0 0 0 ) utm=0 stm=1 core=3
at java.lang.Object.wait(Native Method)
- waiting on <0x42316088> (a java.lang.VMThread) held by tid=25 (ModernAsyncTask #2)
at java.lang.Thread.parkFor(Thread.java:1220)
at sun.misc.Unsafe.park(Unsafe.java:325)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2017)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:410)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:856)
"JavaBridge" prio=5 tid=24 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x41fb6ae8 self=0x6df54688
| sysTid=21744 nice=0 sched=0/0 cgrp=apps handle=1837055584
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3
#00 pc 00021a04 /system/lib/libc.so (epoll_wait+12)
#01 pc 00010e1f /system/lib/libutils.so (android::Looper::pollInner(int)+98)
#02 pc 000110c9 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
#03 pc 0006e609 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
#04 pc 0002044c /system/lib/libdvm.so (dvmPlatformInvoke+112)
#05 pc 00054019 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+428)
#06 pc 000298e0 /system/lib/libdvm.so
#07 pc 00031840 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#08 pc 0002ed5c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+232)
#09 pc 000697c5 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
#10 pc 000697e9 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
#11 pc 0005cc7b /system/lib/libdvm.so
#12 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#13 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:123)
at android.os.HandlerThread.run(HandlerThread.java:61)
"PowerManagerThread" prio=5 tid=23 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x42340140 self=0x6df63ef0
| sysTid=21742 nice=0 sched=0/0 cgrp=apps handle=1785189064
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3
#00 pc 00021a04 /system/lib/libc.so (epoll_wait+12)
#01 pc 00010e1f /system/lib/libutils.so (android::Looper::pollInner(int)+98)
#02 pc 000110c9 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
#03 pc 0006e609 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22)
#04 pc 0002044c /system/lib/libdvm.so (dvmPlatformInvoke+112)
#05 pc 00054019 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+428)
#06 pc 000298e0 /system/lib/libdvm.so
#07 pc 00031840 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#08 pc 0002ed5c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+232)
#09 pc 000697c5 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
#10 pc 000697e9 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
#11 pc 0005cc7b /system/lib/libdvm.so
#12 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#13 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:123)
at android.os.HandlerThread.run(HandlerThread.java:61)
"ModernAsyncTask #1" prio=5 tid=22 WAIT
| group="main" sCount=1 dsCount=0 obj=0x42330dc8 self=0x6d7d36f0
| sysTid=21741 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1718732032
| state=S schedstat=( 0 0 0 ) utm=1 stm=0 core=3
at java.lang.Object.wait(Native Method)
- waiting on <0x4234d908> (a java.lang.VMThread) held by tid=22 (ModernAsyncTask #1)
at java.lang.Thread.parkFor(Thread.java:1220)
at sun.misc.Unsafe.park(Unsafe.java:325)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2017)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:410)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:856)
"FileObserver" prio=5 tid=16 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x42352798 self=0x6ef902b0
| sysTid=21740 nice=0 sched=0/0 cgrp=apps handle=1853392264
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0
#00 pc 00020590 /system/lib/libc.so (read+12)
#01 pc 0008ac23 /system/lib/libandroid_runtime.so
#02 pc 0002044c /system/lib/libdvm.so (dvmPlatformInvoke+112)
#03 pc 00054019 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+428)
#04 pc 000298e0 /system/lib/libdvm.so
#05 pc 00031840 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
#06 pc 0002ed5c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+232)
#07 pc 000697c5 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336)
#08 pc 000697e9 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
#09 pc 0005cc7b /system/lib/libdvm.so
#10 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#11 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at android.os.FileObserver$ObserverThread.observe(Native Method)
at android.os.FileObserver$ObserverThread.run(FileObserver.java:88)
"Thread-157029" prio=4 tid=21 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x424de938 self=0x6a9451e8
| sysTid=21666 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1786046376
| state=S schedstat=( 0 0 0 ) utm=1 stm=0 core=3
#00 pc 00021dc4 /system/lib/libc.so (__futex_syscall3+8)
#01 pc 0000ef54 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 0000efb4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#03 pc 00b4fd31 /system/lib/libwebviewchromium.so
#04 pc 001dbcdf /system/lib/libwebviewchromium.so
#05 pc 001dbf2b /system/lib/libwebviewchromium.so
#06 pc 001da16b /system/lib/libwebviewchromium.so
#07 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#08 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"OkHttp ConnectionPool" daemon prio=5 tid=17 TIMED_WAIT
| group="main" sCount=1 dsCount=0 obj=0x42336c90 self=0x6a6f81d8
| sysTid=21533 nice=0 sched=0/0 cgrp=apps handle=1785691240
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3
at java.lang.Object.wait(Native Method)
- waiting on <0x42336d68> (a java.lang.VMThread) held by tid=17 (OkHttp ConnectionPool)
at java.lang.Thread.parkFor(Thread.java:1220)
at sun.misc.Unsafe.park(Unsafe.java:325)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2056)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:435)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:856)
"Thread-157021" prio=5 tid=15 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x422cfe58 self=0x6a8afb18
| sysTid=21516 nice=0 sched=0/0 cgrp=apps handle=1783564672
| state=S schedstat=( 0 0 0 ) utm=47 stm=6 core=0
#00 pc 00021dc8 /system/lib/libc.so (__futex_syscall3+12)
#01 pc 0000ef54 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 0000efb4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#03 pc 001e52d7 /system/lib/libwebviewchromium.so
#04 pc 001d97cd /system/lib/libwebviewchromium.so
#05 pc 001cff3f /system/lib/libwebviewchromium.so
#06 pc 001cf485 /system/lib/libwebviewchromium.so
#07 pc 001d3f4f /system/lib/libwebviewchromium.so
#08 pc 001cecbf /system/lib/libwebviewchromium.so
#09 pc 001dc33d /system/lib/libwebviewchromium.so
#10 pc 001da16b /system/lib/libwebviewchromium.so
#11 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#12 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"AdWorker #2" prio=5 tid=14 TIMED_WAIT
| group="main" sCount=1 dsCount=0 obj=0x422e3f48 self=0x6a6b8988
| sysTid=21513 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1784930528
| state=S schedstat=( 0 0 0 ) utm=6 stm=0 core=3
at java.lang.Object.wait(Native Method)
- waiting on <0x41fc9458> (a java.lang.VMThread) held by tid=14 (AdWorker #2)
at java.lang.Thread.parkFor(Thread.java:1220)
at sun.misc.Unsafe.park(Unsafe.java:325)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
at java.util.concurrent.SynchronousQueue$TransferQueue.awaitFulfill(SynchronousQueue.java:733)
at java.util.concurrent.SynchronousQueue$TransferQueue.transfer(SynchronousQueue.java:664)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:910)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:856)
"AdWorker #1" prio=5 tid=13 TIMED_WAIT
| group="main" sCount=1 dsCount=0 obj=0x42335668 self=0x6c0cec20
| sysTid=21511 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1812787320
| state=S schedstat=( 0 0 0 ) utm=2 stm=0 core=3
at java.lang.Object.wait(Native Method)
- waiting on <0x42335808> (a java.lang.VMThread) held by tid=13 (AdWorker #1)
at java.lang.Thread.parkFor(Thread.java:1220)
at sun.misc.Unsafe.park(Unsafe.java:325)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
at java.util.concurrent.SynchronousQueue$TransferQueue.awaitFulfill(SynchronousQueue.java:733)
at java.util.concurrent.SynchronousQueue$TransferQueue.transfer(SynchronousQueue.java:664)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:910)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:856)
"CleanupReference" daemon prio=5 tid=12 WAIT
| group="main" sCount=1 dsCount=0 obj=0x4232b618 self=0x6c2bf8e0
| sysTid=21510 nice=0 sched=0/0 cgrp=apps handle=1814822200
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x4232b550> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait(Object.java:401)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
at com.android.org.chromium.content.common.CleanupReference$1.run(CleanupReference.java:48)
"Thread-157017" prio=5 tid=11 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x423293a0 self=0x6c2b38e0
| sysTid=21499 nice=0 sched=0/0 cgrp=apps handle=1782253760
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2
#00 pc 00021dc4 /system/lib/libc.so (__futex_syscall3+8)
#01 pc 0000ef54 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 0000efb4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#03 pc 001d97d5 /system/lib/libwebviewchromium.so
#04 pc 001d97f5 /system/lib/libwebviewchromium.so
#05 pc 001cff0f /system/lib/libwebviewchromium.so
#06 pc 001cf485 /system/lib/libwebviewchromium.so
#07 pc 001d3f4f /system/lib/libwebviewchromium.so
#08 pc 001cecbf /system/lib/libwebviewchromium.so
#09 pc 008e9893 /system/lib/libwebviewchromium.so
#10 pc 008e9c8b /system/lib/libwebviewchromium.so
#11 pc 001dc33d /system/lib/libwebviewchromium.so
#12 pc 001da16b /system/lib/libwebviewchromium.so
#13 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#14 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"Thread-157015" prio=5 tid=10 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x42325e00 self=0x6a42b578
| sysTid=21504 nice=-6 sched=0/0 cgrp=apps handle=1782737400
| state=S schedstat=( 0 0 0 ) utm=18 stm=10 core=0
#00 pc 00021a04 /system/lib/libc.so (epoll_wait+12)
#01 pc 001e7ff3 /system/lib/libwebviewchromium.so
#02 pc 001e71e5 /system/lib/libwebviewchromium.so
#03 pc 001e010f /system/lib/libwebviewchromium.so
#04 pc 001cf485 /system/lib/libwebviewchromium.so
#05 pc 001d3f4f /system/lib/libwebviewchromium.so
#06 pc 001cecbf /system/lib/libwebviewchromium.so
#07 pc 008e9901 /system/lib/libwebviewchromium.so
#08 pc 008e9cb3 /system/lib/libwebviewchromium.so
#09 pc 001dc33d /system/lib/libwebviewchromium.so
#10 pc 001da16b /system/lib/libwebviewchromium.so
#11 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#12 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"Binder_2" prio=5 tid=9 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x41b878e8 self=0x6659d530
| sysTid=21495 nice=0 sched=0/0 cgrp=apps handle=1717162728
| state=S schedstat=( 0 0 0 ) utm=1 stm=0 core=0
#00 pc 00020850 /system/lib/libc.so (__ioctl+8)
#01 pc 0002d187 /system/lib/libc.so (ioctl+14)
#02 pc 0001d561 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+140)
#03 pc 0001dc6b /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+6)
#04 pc 0001dd01 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48)
#05 pc 00022019 /system/lib/libbinder.so
#06 pc 0000f149 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216)
#07 pc 00050357 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+98)
#08 pc 0000ec0f /system/lib/libutils.so
#09 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#10 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"Binder_1" prio=5 tid=8 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x41b87748 self=0x6659c8b0
| sysTid=21494 nice=0 sched=0/0 cgrp=apps handle=1717159528
| state=S schedstat=( 0 0 0 ) utm=1 stm=0 core=0
#00 pc 00020850 /system/lib/libc.so (__ioctl+8)
#01 pc 0002d187 /system/lib/libc.so (ioctl+14)
#02 pc 0001d561 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+140)
#03 pc 0001dc6b /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+6)
#04 pc 0001dd01 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48)
#05 pc 00022019 /system/lib/libbinder.so
#06 pc 0000f149 /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216)
#07 pc 00050357 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+98)
#08 pc 0000ec0f /system/lib/libutils.so
#09 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#10 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"FinalizerWatchdogDaemon" daemon prio=5 tid=7 WAIT
| group="system" sCount=1 dsCount=0 obj=0x41b830e8 self=0x6659bbc8
| sysTid=21493 nice=0 sched=0/0 cgrp=apps handle=1717157920
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x41660478> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Object.wait(Object.java:364)
at java.lang.Daemons$FinalizerWatchdogDaemon.waitForObject(Daemons.java:230)
at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:207)
at java.lang.Thread.run(Thread.java:856)
"FinalizerDaemon" daemon prio=5 tid=6 WAIT
| group="system" sCount=1 dsCount=0 obj=0x41b82f90 self=0x6659a768
| sysTid=21492 nice=0 sched=0/0 cgrp=apps handle=1717152704
| state=S schedstat=( 0 0 0 ) utm=1 stm=0 core=0
at java.lang.Object.wait(Native Method)
- waiting on <0x4164b7d8> (a java.lang.ref.ReferenceQueue)
at java.lang.Object.wait(Object.java:401)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170)
at java.lang.Thread.run(Thread.java:856)
"ReferenceQueueDaemon" daemon prio=5 tid=5 WAIT
| group="system" sCount=1 dsCount=0 obj=0x41b82e28 self=0x66599ec0
| sysTid=21491 nice=0 sched=0/0 cgrp=apps handle=1717150488
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3
at java.lang.Object.wait(Native Method)
- waiting on <0x4164b700>
at java.lang.Object.wait(Object.java:364)
at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:130)
at java.lang.Thread.run(Thread.java:856)
"Compiler" daemon prio=5 tid=4 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x41b82d38 self=0x415b4258
| sysTid=21490 nice=0 sched=0/0 cgrp=apps handle=1096499216
| state=S schedstat=( 0 0 0 ) utm=11 stm=9 core=0
#00 pc 00021dc4 /system/lib/libc.so (__futex_syscall3+8)
#01 pc 0000ef54 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 0000efb4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#03 pc 00080937 /system/lib/libdvm.so
#04 pc 0005c0fd /system/lib/libdvm.so
#05 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#06 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
"Signal Catcher" daemon prio=5 tid=3 RUNNABLE
| group="system" sCount=0 dsCount=0 obj=0x41b82c40 self=0x648b9120
| sysTid=21489 nice=0 sched=0/0 cgrp=apps handle=1772267456
| state=R schedstat=( 0 0 0 ) utm=2 stm=2 core=3
at dalvik.system.NativeStart.run(Native Method)
"GC" daemon prio=5 tid=2 VMWAIT
| group="system" sCount=1 dsCount=0 obj=0x41b82b60 self=0x648bc070
| sysTid=21488 nice=0 sched=0/0 cgrp=apps handle=1686879040
| state=S schedstat=( 0 0 0 ) utm=2 stm=0 core=0
#00 pc 00021dc4 /system/lib/libc.so (__futex_syscall3+8)
#01 pc 0000ef54 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#02 pc 0000efb4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#03 pc 0007eff3 /system/lib/libdvm.so
#04 pc 0005c0fd /system/lib/libdvm.so
#05 pc 0000d200 /system/lib/libc.so (__thread_entry+72)
#06 pc 0000d398 /system/lib/libc.so (pthread_create+240)
at dalvik.system.NativeStart.run(Native Method)
NATIVE THREADS:
".smp.musicspeed" sysTid=21498 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2
".smp.musicspeed" sysTid=21500 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2
".smp.musicspeed" sysTid=21501 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2
".smp.musicspeed" sysTid=21502 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=2
".smp.musicspeed" sysTid=21503 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=0
".smp.musicspeed" sysTid=21505 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3
".smp.musicspeed" sysTid=21506 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3
".smp.musicspeed" sysTid=21507 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3
".smp.musicspeed" sysTid=21508 nice=0 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=0 stm=0 core=3
".smp.musicspeed" sysTid=21517 nice=-6 sched=0/0 cgrp=apps
| state=S schedstat=( 0 0 0 ) utm=1 stm=1 core=0
EDIT 1:
ANRs are triggered by either of the following conditions.
No response to an input event (such as key press or screen touch events) within 5 seconds.
A BroadcastReceiver hasn't finished executing within 10 seconds.
Since your timeout is set to a sub-second value, it's not likely to be the direct source of your problem. The problem is more likely to be a result of the synchronization blocks. If you have code running on the main thread that's being delayed due to thread synchronization, that could easily trigger one of the ANR conditions.
I'll take a look at your actual code a bit later tonight if nobody else has already determined the problem.
EDIT 2:
Looking at the ANR dump in the question and the code, the issue appears to be caused by lock-contention on decodeLock when trying to do a seek. The thread holding the lock is a native thread gotten to by the path SoundTouchPlayable.run()->SoundTouchPlayable.playFile()->MediaCodecAudioDecoder.decodeChunk()->MediaCodecAudioDecoder.advanceInput().
To arrive at that, I looked for "waiting" in the ANR dump. Those that are on Object.wait aren't a problem; they're just waiting for more messages. The only one that's different is waiting to lock <0x422cfb18> (a java.lang.Object) held by tid=20. Then it's just a matter of looking to see which threads has tid=20.
I suggest determining how/why those two different threads could be running at the same time. Then working out a plan to keep them from do so or if it's OK that they run at the same time, changing the synchronization locks to allow it.
To address the fact that you have to do an uninstall to recover, consider that a simple force-stop might be leaving some process running. An uninstall will be more aggressive about finding and killing all processes running under that user id (each app has its own).