Open cclover opened 2 years ago
有主进程的trace么?看下其他线程在做什么
HWOXF:/data/data/com.kwai.koom.demo $ ps -A | grep com.kwai.koom.demo
u0_a454 22980 671 6113028 120560 do_wait 0 S com.kwai.koom.demo
u0_a454 24021 22980 5921088 58816 futex_wait_queue_me 0 S com.kwai.koom.demo
把alarm超时设置600秒。然后抓了bugreport. 子进程没dump出来, 用kill -11看就是卡住JNI END
---- pid 24021 at [unknown] ----
Dump failed, likely due to a timeout.
---- end 24021 ----
这个主进程的
DALVIK THREADS (17):
"Signal Catcher" daemon prio=5 tid=2 Runnable
| group="system" sCount=1 dsCount=0 flags=9 obj=0x165845a0 self=0x7429a36000
| sysTid=23596 nice=0 cgrp=default sched=0/0 handle=0x742aa46d50
| state=R schedstat=( 18797397 29166 8 ) utm=1 stm=0 core=4 HZ=100
| stack=0x742a950000-0x742a952000 stackSize=991KB
| held mutexes= "mutator lock"(shared held)
native: #00 pc 000000000041ea9c /apex/com.android.runtime/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+140)
native: #01 pc 000000000051a520 /apex/com.android.runtime/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+508)
native: #02 pc 0000000000534e60 /apex/com.android.runtime/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+820)
native: #03 pc 000000000052de68 /apex/com.android.runtime/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+456)
native: #04 pc 000000000052d2c8 /apex/com.android.runtime/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+1008)
native: #05 pc 000000000052cdd4 /apex/com.android.runtime/lib64/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char>>&)+860)
native: #06 pc 00000000004e5be0 /apex/com.android.runtime/lib64/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char>>&)+196)
native: #07 pc 00000000004f9acc /apex/com.android.runtime/lib64/libart.so (art::SignalCatcher::HandleSigQuit()+1356)
native: #08 pc 00000000004f8b60 /apex/com.android.runtime/lib64/libart.so (art::SignalCatcher::Run(void*)+252)
native: #09 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #10 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"main" prio=5 tid=1 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x734f2360 self=0x7436210800
| sysTid=22980 nice=-10 cgrp=default sched=1073741825/2 handle=0x74bd2220d0
| state=S schedstat=( 482664096 41916142 1797 ) utm=37 stm=11 core=5 HZ=100
| stack=0x7fcf8a0000-0x7fcf8a2000 stackSize=8192KB
| held mutexes=
kernel: (couldn't read /proc/self/task/22980/stack)
native: #00 pc 00000000000bc464 /apex/com.android.runtime/lib64/bionic/libc.so (wait4+4)
native: #01 pc 0000000000001d44 /data/app/com.kwai.koom.demo-MGSrSziLtNDjJgNlrSUKTw==/lib/arm64/libkoom-fast-dump.so (kwai::leak_monitor::HprofDump::ResumeAndWait(int)+164)
native: #02 pc 0000000000001740 /data/app/com.kwai.koom.demo-MGSrSziLtNDjJgNlrSUKTw==/lib/arm64/libkoom-fast-dump.so (Java_com_kwai_koom_fastdump_ForkJvmHeapDumper_resumeAndWait+24)
native: #03 pc 000000000014e350 /apex/com.android.runtime/lib64/libart.so (art_quick_generic_jni_trampoline+144)
native: #04 pc 0000000000145334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
native: #05 pc 00000000001541a4 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+252)
native: #06 pc 00000000002efe68 /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384)
native: #07 pc 00000000002eb138 /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+912)
native: #08 pc 00000000005c36b8 /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+400)
native: #09 pc 000000000013f914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
native: #10 pc 000000000001f44e [anon:dalvik-classes2.dex extracted in memory from /data/app/com.kwai.koom.demo-MGSrSziLtNDjJgNlrSUKTw==/base.apk!classes2.dex] (com.kwai.koom.fastdump.ForkJvmHeapDumper.dump+138)
native: #11 pc 00000000005c161c /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432)
native: #12 pc 000000000013f814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20)
native: #13 pc 000000000001f6a0 [anon:dalvik-classes2.dex extracted in memory from /data/app/com.kwai.koom.demo-MGSrSziLtNDjJgNlrSUKTw==/base.apk!classes2.dex] (com.kwai.koom.javaoom.hprof.ForkStripHeapDumper.dump+108)
native: #14 pc 00000000005c161c /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtual+1432)
native: #15 pc 000000000013f814 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual+20)
native: #16 pc 0000000000000b64 [anon:dalvik-classes6.dex extracted in memory from /data/app/com.kwai.koom.demo-MGSrSziLtNDjJgNlrSUKTw==/base.apk!classes6.dex] (com.kwai.koom.demo.javaleak.JavaLeakTestActivity.onClick+140)
native: #17 pc 00000000002c0988 /apex/com.android.runtime/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.10666712087520032524+320)
native: #18 pc 00000000005b2030 /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1012)
native: #19 pc 000000000014e468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88)
native: #20 pc 0000000000145334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
native: #21 pc 00000000001541a4 /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+252)
native: #22 pc 00000000004d0248 /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
native: #23 pc 00000000004d1c70 /apex/com.android.runtime/lib64/libart.so (art::InvokeMethod(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+1476)
native: #24 pc 000000000045c3d8 /apex/com.android.runtime/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*)+52)
at com.kwai.koom.fastdump.ForkJvmHeapDumper.resumeAndWait(Native method)
at com.kwai.koom.fastdump.ForkJvmHeapDumper.dump(ForkJvmHeapDumper.java:81)
- locked <0x01db8428> (a com.kwai.koom.fastdump.ForkJvmHeapDumper)
at com.kwai.koom.javaoom.hprof.ForkStripHeapDumper.dump(ForkStripHeapDumper.java:68)
- locked <0x0baba541> (a com.kwai.koom.javaoom.hprof.ForkStripHeapDumper)
at com.kwai.koom.demo.javaleak.JavaLeakTestActivity.onClick(JavaLeakTestActivity.java:54)
at java.lang.reflect.Method.invoke(Native method)
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:397)
at android.view.View.performClick(View.java:7281)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:967)
at android.view.View.performClickInternal(View.java:7255)
at android.view.View.access$3600(View.java:828)
at android.view.View$PerformClick.run(View.java:27925)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8393)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
"Jit thread pool worker thread 0" daemon prio=5 tid=3 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x16584618 self=0x7436349800
| sysTid=23591 nice=0 cgrp=default sched=0/0 handle=0x742ab4bd40
| state=S schedstat=( 52431262 23317187 327 ) utm=2 stm=2 core=1 HZ=100
| stack=0x742aa4d000-0x742aa4f000 stackSize=1023KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23591/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 000000000015a188 /apex/com.android.runtime/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)
native: #02 pc 00000000005368b8 /apex/com.android.runtime/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)+260)
native: #03 pc 0000000000535c48 /apex/com.android.runtime/lib64/libart.so (art::ThreadPoolWorker::Run()+144)
native: #04 pc 000000000053570c /apex/com.android.runtime/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+148)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"ReferenceQueueDaemon" daemon prio=5 tid=4 Waiting
| group="system" sCount=2 dsCount=0 flags=1 obj=0x16584690 self=0x74363d0000
| sysTid=23603 nice=4 cgrp=default sched=0/0 handle=0x742a743d50
| state=S schedstat=( 2955208 2355209 40 ) utm=0 stm=0 core=5 HZ=100
| stack=0x742a641000-0x742a643000 stackSize=1039KB
| held mutexes=
at java.lang.Object.wait(Native method)
- waiting on <0x05b55ae6> (a java.lang.Class<java.lang.ref.ReferenceQueue>)
at java.lang.Object.wait(Object.java:442)
at java.lang.Object.wait(Object.java:568)
at java.lang.Daemons$ReferenceQueueDaemon.runInternal(Daemons.java:215)
- locked <0x05b55ae6> (a java.lang.Class<java.lang.ref.ReferenceQueue>)
at java.lang.Daemons$Daemon.run(Daemons.java:137)
at java.lang.Thread.run(Thread.java:929)
"FinalizerDaemon" daemon prio=5 tid=5 Waiting
| group="system" sCount=2 dsCount=0 flags=1 obj=0x16584708 self=0x74363d1c00
| sysTid=23605 nice=4 cgrp=default sched=0/0 handle=0x742a63ad50
| state=S schedstat=( 2263023 1287499 36 ) utm=0 stm=0 core=4 HZ=100
| stack=0x742a538000-0x742a53a000 stackSize=1039KB
| held mutexes=
at java.lang.Object.wait(Native method)
- waiting on <0x03cdf827> (a java.lang.Object)
at java.lang.Object.wait(Object.java:442)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:190)
- locked <0x03cdf827> (a java.lang.Object)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:211)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:271)
at java.lang.Daemons$Daemon.run(Daemons.java:137)
at java.lang.Thread.run(Thread.java:929)
"FinalizerWatchdogDaemon" daemon prio=5 tid=6 Waiting
| group="system" sCount=2 dsCount=0 flags=1 obj=0x16584780 self=0x74363d5400
| sysTid=23607 nice=4 cgrp=default sched=0/0 handle=0x742a531d50
| state=S schedstat=( 1172397 1300519 13 ) utm=0 stm=0 core=4 HZ=100
| stack=0x742a42f000-0x742a431000 stackSize=1039KB
| held mutexes=
at java.lang.Object.wait(Native method)
- waiting on <0x0578bad4> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Object.wait(Object.java:442)
at java.lang.Object.wait(Object.java:568)
at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded(Daemons.java:339)
- locked <0x0578bad4> (a java.lang.Daemons$FinalizerWatchdogDaemon)
at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal(Daemons.java:319)
at java.lang.Daemons$Daemon.run(Daemons.java:137)
at java.lang.Thread.run(Thread.java:929)
"ADB-JDWP Connection Control Thread" daemon prio=0 tid=8 WaitingInMainDebuggerLoop
| group="system" sCount=2 dsCount=0 flags=1 obj=0x165847f8 self=0x7429a4c800
| sysTid=23598 nice=0 cgrp=default sched=0/0 handle=0x742a949d50
| state=S schedstat=( 1652604 3806251 14 ) utm=0 stm=0 core=4 HZ=100
| stack=0x742a853000-0x742a855000 stackSize=991KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23598/stack)
native: #00 pc 00000000000baec8 /apex/com.android.runtime/lib64/bionic/libc.so (__ppoll+8)
native: #01 pc 000000000007a99c /apex/com.android.runtime/lib64/bionic/libc.so (poll+88)
native: #02 pc 0000000000008c08 /apex/com.android.runtime/lib64/libadbconnection.so (adbconnection::AdbConnectionState::RunPollLoop(art::Thread*)+824)
native: #03 pc 0000000000007024 /apex/com.android.runtime/lib64/libadbconnection.so (adbconnection::CallbackFunction(void*)+1076)
native: #04 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #05 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"HeapTaskDaemon" daemon prio=5 tid=9 WaitingForTaskProcessor
| group="system" sCount=2 dsCount=0 flags=1 obj=0x16584870 self=0x74363d3800
| sysTid=23601 nice=4 cgrp=default sched=0/0 handle=0x742a84cd50
| state=S schedstat=( 675519 1388540 12 ) utm=0 stm=0 core=0 HZ=100
| stack=0x742a74a000-0x742a74c000 stackSize=1039KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23601/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 000000000015a188 /apex/com.android.runtime/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)
native: #02 pc 000000000029c270 /apex/com.android.runtime/lib64/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+444)
native: #03 pc 000000000029cb08 /apex/com.android.runtime/lib64/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+92)
at dalvik.system.VMRuntime.runHeapTasks(Native method)
at java.lang.Daemons$HeapTaskDaemon.runInternal(Daemons.java:523)
at java.lang.Daemons$Daemon.run(Daemons.java:137)
at java.lang.Thread.run(Thread.java:929)
"Binder:22980_1" prio=5 tid=13 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x165848e8 self=0x741f093800
| sysTid=23608 nice=0 cgrp=default sched=0/0 handle=0x742a32ad50
| state=S schedstat=( 3726565 10410935 53 ) utm=0 stm=0 core=5 HZ=100
| stack=0x742a234000-0x742a236000 stackSize=991KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23608/stack)
native: #00 pc 00000000000bae84 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
native: #01 pc 00000000000789c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+132)
native: #02 pc 0000000000064c60 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+256)
native: #03 pc 0000000000064e34 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)
native: #04 pc 000000000006573c /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60)
native: #05 pc 000000000008b97c /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
native: #06 pc 00000000000136d8 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+288)
native: #07 pc 0000000000101fd4 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
native: #08 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #09 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"Binder:22980_2" prio=5 tid=14 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x16584960 self=0x7429a82000
| sysTid=23610 nice=0 cgrp=default sched=0/0 handle=0x742a22dd50
| state=S schedstat=( 12626563 22403644 37 ) utm=0 stm=0 core=7 HZ=100
| stack=0x742a137000-0x742a139000 stackSize=991KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23610/stack)
native: #00 pc 00000000000bae84 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
native: #01 pc 00000000000789c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+132)
native: #02 pc 0000000000064c60 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+256)
native: #03 pc 0000000000064e34 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)
native: #04 pc 000000000006573c /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60)
native: #05 pc 000000000008b97c /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
native: #06 pc 00000000000136d8 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+288)
native: #07 pc 0000000000101fd4 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
native: #08 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #09 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"AppEyeUiProbeThread" prio=5 tid=16 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x165849d8 self=0x7425242400
| sysTid=23617 nice=0 cgrp=default sched=0/0 handle=0x7429f2ad50
| state=S schedstat=( 154070298 37627086 1177 ) utm=8 stm=7 core=0 HZ=100
| stack=0x7429e28000-0x7429e2a000 stackSize=1039KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23617/stack)
native: #00 pc 00000000000bad48 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8)
native: #01 pc 0000000000017b64 /system/lib64/libutils.so (android::Looper::pollInner(int)+144)
native: #02 pc 0000000000017a34 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+56)
native: #03 pc 0000000000181f20 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44)
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:363)
at android.os.Looper.loop(Looper.java:176)
at android.os.HandlerThread.run(HandlerThread.java:67)
"Binder:22980_3" prio=5 tid=17 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x16584bf0 self=0x741f0e9000
| sysTid=23615 nice=0 cgrp=default sched=0/0 handle=0x742a027d50
| state=S schedstat=( 21064067 38910420 185 ) utm=1 stm=0 core=6 HZ=100
| stack=0x7429f31000-0x7429f33000 stackSize=991KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23615/stack)
native: #00 pc 00000000000bae84 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
native: #01 pc 00000000000789c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+132)
native: #02 pc 0000000000064c60 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+256)
native: #03 pc 0000000000064e34 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)
native: #04 pc 000000000006573c /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60)
native: #05 pc 000000000008b97c /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
native: #06 pc 00000000000136d8 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+288)
native: #07 pc 0000000000101fd4 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
native: #08 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #09 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"Profile Saver" daemon prio=5 tid=18 Native
| group="system" sCount=2 dsCount=0 flags=1 obj=0x16584c68 self=0x7429a93800
| sysTid=23642 nice=9 cgrp=default sched=0/0 handle=0x73c95fbd50
| state=S schedstat=( 11232292 42697916 28 ) utm=1 stm=0 core=4 HZ=100
| stack=0x73c9505000-0x73c9507000 stackSize=991KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23642/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 000000000015a188 /apex/com.android.runtime/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)
native: #02 pc 0000000000354070 /apex/com.android.runtime/lib64/libart.so (art::ProfileSaver::Run()+412)
native: #03 pc 0000000000357ca0 /apex/com.android.runtime/lib64/libart.so (art::ProfileSaver::RunProfileSaverThread(void*)+88)
native: #04 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #05 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"RenderThread" daemon prio=7 tid=19 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x16584ce0 self=0x741f1ee000
| sysTid=23643 nice=-10 cgrp=default sched=1073741825/2 handle=0x73c84fed50
| state=S schedstat=( 172096887 8642705 690 ) utm=11 stm=5 core=4 HZ=100
| stack=0x73c8408000-0x73c840a000 stackSize=991KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23643/stack)
native: #00 pc 00000000000bad48 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8)
native: #01 pc 0000000000017b64 /system/lib64/libutils.so (android::Looper::pollInner(int)+144)
native: #02 pc 0000000000017a34 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+56)
native: #03 pc 0000000000306dc4 /system/lib64/libhwui.so (android::uirenderer::ThreadBase::waitForWork()+132)
native: #04 pc 0000000000306c1c /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+72)
native: #05 pc 00000000000136d8 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+288)
native: #06 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #07 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"Sampling Profiler" daemon prio=10 tid=21 Native
| group="system" sCount=1 dsCount=0 flags=1 obj=0x16584d58 self=0x74257edc00
| sysTid=23776 nice=-10 cgrp=default sched=0/0 handle=0x73ae2fed50
| state=S schedstat=( 60167642023 2027194896 713223 ) utm=3859 stm=2157 core=1 HZ=100
| stack=0x73ae208000-0x73ae20a000 stackSize=991KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23776/stack)
native: #00 pc 000000000006cb00 /apex/com.android.runtime/lib64/bionic/libc.so (syscall+32)
native: #01 pc 000000000052f5cc /apex/com.android.runtime/lib64/libart.so (art::ThreadList::SuspendAllInternal(art::Thread*, art::Thread*, art::Thread*, art::SuspendReason)+1040)
native: #02 pc 000000000052fa8c /apex/com.android.runtime/lib64/libart.so (art::ThreadList::SuspendAll(char const*, bool)+192)
native: #03 pc 0000000000539d00 /apex/com.android.runtime/lib64/libart.so (art::Trace::RunSamplingThread(void*)+204)
native: #04 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #05 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"queued-work-looper" prio=5 tid=22 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x16584dd0 self=0x7436294400
| sysTid=23943 nice=-2 cgrp=default sched=0/0 handle=0x73ba71bd50
| state=S schedstat=( 384893 0 8 ) utm=0 stm=0 core=4 HZ=100
| stack=0x73ba619000-0x73ba61b000 stackSize=1039KB
| held mutexes=
kernel: (couldn't read /proc/self/task/23943/stack)
native: #00 pc 00000000000bad48 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8)
native: #01 pc 0000000000017b64 /system/lib64/libutils.so (android::Looper::pollInner(int)+144)
native: #02 pc 0000000000017a34 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+56)
native: #03 pc 0000000000181f20 /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)+44)
at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:363)
at android.os.Looper.loop(Looper.java:176)
at android.os.HandlerThread.run(HandlerThread.java:67)
"Binder:22980_4" prio=5 tid=7 Native
| group="main" sCount=2 dsCount=0 flags=1 obj=0x16584eb8 self=0x7425344400
| sysTid=24144 nice=0 cgrp=default sched=0/0 handle=0x742a130d50
| state=S schedstat=( 49079165 2830208 81 ) utm=3 stm=1 core=0 HZ=100
| stack=0x742a03a000-0x742a03c000 stackSize=991KB
| held mutexes=
kernel: (couldn't read /proc/self/task/24144/stack)
native: #00 pc 00000000000bae84 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)
native: #01 pc 00000000000789c4 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+132)
native: #02 pc 0000000000064c60 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+256)
native: #03 pc 0000000000064e34 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)
native: #04 pc 000000000006573c /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+60)
native: #05 pc 000000000008b97c /system/lib64/libbinder.so (android::PoolThread::threadLoop()+24)
native: #06 pc 00000000000136d8 /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+288)
native: #07 pc 0000000000101fd4 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+140)
native: #08 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #09 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
(no managed stack frames)
"mali-mem-purge" prio=10 (not attached)
| sysTid=23685 nice=-10 cgrp=default
| state=S schedstat=( 9551039 5138543 48 ) utm=0 stm=0 core=0 HZ=100
kernel: (couldn't read /proc/self/task/23685/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 00000000024815f0 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #05 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-utility-wo" prio=10 (not attached)
| sysTid=23686 nice=-10 cgrp=default
| state=S schedstat=( 21354 10226563 2 ) utm=0 stm=0 core=6 HZ=100
kernel: (couldn't read /proc/self/task/23686/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000245d980 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 000000000245d914 /vendor/lib64/egl/libGLES_mali.so (???)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-utility-wo" prio=10 (not attached)
| sysTid=23687 nice=-10 cgrp=default
| state=S schedstat=( 42709 4103645 3 ) utm=0 stm=0 core=7 HZ=100
kernel: (couldn't read /proc/self/task/23687/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000245d980 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 000000000245d914 /vendor/lib64/egl/libGLES_mali.so (???)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-utility-wo" prio=10 (not attached)
| sysTid=23688 nice=-10 cgrp=default
| state=S schedstat=( 33853 101043 3 ) utm=0 stm=0 core=7 HZ=100
kernel: (couldn't read /proc/self/task/23688/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000245d980 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 000000000245d914 /vendor/lib64/egl/libGLES_mali.so (???)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-utility-wo" prio=10 (not attached)
| sysTid=23689 nice=-10 cgrp=default
| state=S schedstat=( 47916 10075521 1 ) utm=0 stm=0 core=6 HZ=100
kernel: (couldn't read /proc/self/task/23689/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000245d980 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 000000000245d914 /vendor/lib64/egl/libGLES_mali.so (???)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-utility-wo" prio=10 (not attached)
| sysTid=23690 nice=-10 cgrp=default
| state=S schedstat=( 28124 3167709 3 ) utm=0 stm=0 core=7 HZ=100
kernel: (couldn't read /proc/self/task/23690/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000245d980 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 000000000245d914 /vendor/lib64/egl/libGLES_mali.so (???)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-utility-wo" prio=10 (not attached)
| sysTid=23691 nice=-10 cgrp=default
| state=S schedstat=( 38021 3578646 2 ) utm=0 stm=0 core=5 HZ=100
kernel: (couldn't read /proc/self/task/23691/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000245d980 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 000000000245d914 /vendor/lib64/egl/libGLES_mali.so (???)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-utility-wo" prio=10 (not attached)
| sysTid=23692 nice=-10 cgrp=default
| state=S schedstat=( 23957 1609375 3 ) utm=0 stm=0 core=4 HZ=100
kernel: (couldn't read /proc/self/task/23692/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000245d980 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 000000000245d914 /vendor/lib64/egl/libGLES_mali.so (???)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-utility-wo" prio=10 (not attached)
| sysTid=23693 nice=-10 cgrp=default
| state=S schedstat=( 30208 16667 2 ) utm=0 stm=0 core=5 HZ=100
kernel: (couldn't read /proc/self/task/23693/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000245d980 /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 000000000245d914 /vendor/lib64/egl/libGLES_mali.so (???)
native: #05 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #06 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-cmar-backe" prio=10 (not attached)
| sysTid=23694 nice=-10 cgrp=default
| state=S schedstat=( 18341668 13730206 362 ) utm=0 stm=1 core=4 HZ=100
kernel: (couldn't read /proc/self/task/23694/stack)
native: #00 pc 00000000000baec8 /apex/com.android.runtime/lib64/bionic/libc.so (__ppoll+8)
native: #01 pc 000000000007a99c /apex/com.android.runtime/lib64/bionic/libc.so (poll+88)
native: #02 pc 000000000245dd08 /vendor/lib64/egl/libGLES_mali.so (???)
native: #03 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #04 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
"mali-hist-dump" prio=10 (not attached)
| sysTid=23695 nice=-10 cgrp=default
| state=S schedstat=( 4126044 4004167 32 ) utm=0 stm=0 core=2 HZ=100
kernel: (couldn't read /proc/self/task/23695/stack)
native: #00 pc 000000000006cafc /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)
native: #01 pc 0000000000070d84 /apex/com.android.runtime/lib64/bionic/libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*)+140)
native: #02 pc 000000000007be6c /apex/com.android.runtime/lib64/bionic/libc.so (sem_wait+116)
native: #03 pc 000000000217191c /vendor/lib64/egl/libGLES_mali.so (???)
native: #04 pc 00000000000cf700 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
native: #05 pc 00000000000720e8 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
----- end 22980 -----
[dump dalvik stack 22980: 0.215s elapsed]
本地复现不了这个问题,推测可能是fork的时候有别的线程拿到了锁,你那边开发版的ROM有源码和符号表么,这两行帮忙把inline调用解析出来确认下是哪个锁,应该不是resumecond,否则就是必现问题了。
另外帮忙把你复现的apk发一下,我再复现试试。
llvm-addr2line -C -f -e -i libart.so 000000000015a188 llvm-addr2line -C -f -e -i libart.so 00000000005b06fc
09-02 16:19:12.276 20722 20722 F DEBUG : #02 pc 00000000005b06fc /apex/com.android.runtime/lib64/libart.so (_ZN3artL12GoToRunnableEPNS_6ThreadE.llvm.13294687203478237565+440) (BuildId: 1a0029abc6bafe71a123b0b3c1a098a0)
用的最新v2.2.1, 2.1.0也碰到这个问题, 只修改了gradle和AGP版本,其他没变,应该不影响。表现就是一下正常一下卡住,有时候没问题,杀进程后跑2次就有问题,然后可能就一直不行,过一会又可以,没啥规律 。 在2个Android10设备上出现。 一个小米8(开发版ROM),一个荣耀V30PRO (自用正式版),其他一些设备没出现, 不知道是不是用的少,还是什么。
dump卡住时, kill -11看了下堆栈。 比较怪异。 卡在子进程JNI返回, 应该是kNative变kRunnable时。 但是不应该, JNI进入时应该只修改了status, flag没有kRequestSuspend, 不应该等, 除非这个线程被执行了Suspend。
但是主进程是正常返回,在等子进程。 Fork后子进程也没其他动作, 比较怪异,不知道你们是否有遇到过。