Странный ANR на Android, с главным потоком в состоянии Running - PullRequest
0 голосов
/ 26 октября 2019

При прокрутке приложения я столкнулся с проблемой anr. Вот журнал трассировки:

suspend all histogram:  Sum: 24.489ms 99% C.I. 4us-5561.599us Avg: 176.179us Max: 13503us
DALVIK THREADS (100):
"main" prio=5 tid=1 Runnable
  | group="main" sCount=0 dsCount=0 flags=0 obj=0x728af718 self=0xe76c4000
  | sysTid=30924 nice=-4 cgrp=default sched=0/0 handle=0xeb0644a4
  | state=R schedstat=( 120834581095 1716862261 9002 ) utm=12000 stm=82 core=4 HZ=100
  | stack=0xff0a8000-0xff0aa000 stackSize=8MB
  | held mutexes= "mutator lock"(shared held)
  at android.support.v4.view.ViewPager.populate(ViewPager.java:1171)
  at android.support.v4.view.ViewPager.populate(ViewPager.java:1092)
  at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1622)
  at android.view.View.measure(View.java:22071)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
  at android.view.View.measure(View.java:22071)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6602)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
  at android.view.View.measure(View.java:22071)
  at com.alibaba.android.vlayout.VirtualLayoutManager.measureChildWithDecorationsAndMargin(VirtualLayoutManager.java:1517)
  at com.alibaba.android.vlayout.VirtualLayoutManager.measureChildWithMargins(VirtualLayoutManager.java:1326)
  at com.alibaba.android.vlayout.layout.RangeGridLayoutHelper.layoutViews(RangeGridLayoutHelper.java:474)
  at com.alibaba.android.vlayout.layout.BaseLayoutHelper.doLayout(BaseLayoutHelper.java:330)
  at com.alibaba.android.vlayout.VirtualLayoutManager.layoutChunk(VirtualLayoutManager.java:741)
  at com.alibaba.android.vlayout.ExposeLinearLayoutManagerEx.fill(ExposeLinearLayoutManagerEx.java:1161)
  at com.alibaba.android.vlayout.ExposeLinearLayoutManagerEx.onLayoutChildren(ExposeLinearLayoutManagerEx.java:365)
  at com.alibaba.android.vlayout.VirtualLayoutManager.onLayoutChildren(VirtualLayoutManager.java:536)
  at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
  at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
  at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4194)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
  at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
  at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
  at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
  at com.android.internal.policy.DecorView.onLayout(DecorView.java:761)
  at android.view.View.layout(View.java:19659)
  at android.view.ViewGroup.layout(ViewGroup.java:6075)
  at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2496)
  at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2212)
  at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1392)
  at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752)
  at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
  at android.view.Choreographer.doCallbacks(Choreographer.java:723)
  at android.view.Choreographer.doFrame(Choreographer.java:658)
  at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
  at android.os.Handler.handleCallback(Handler.java:790)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:164)
  at android.app.ActivityThread.main(ActivityThread.java:6494)
  at java.lang.reflect.Method.invoke(Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
"Signal Catcher" daemon prio=5 tid=3 Runnable
  | group="system" sCount=0 dsCount=0 flags=0 obj=0x13100290 self=0xe76c4c00
  | sysTid=30933 nice=0 cgrp=default sched=0/0 handle=0xdf950970
  | state=R schedstat=( 400577919 3448228 128 ) utm=28 stm=10 core=6 HZ=100
  | stack=0xdf856000-0xdf858000 stackSize=1006KB
  | held mutexes= "mutator lock"(shared held)
  native: #00 pc 002e8367  /system/lib/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, int, BacktraceMap*, char const*, art::ArtMethod*, void*)+130)
  native: #01 pc 00379111  /system/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+204)
  native: #02 pc 00375847  /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool, BacktraceMap*, bool) const+34)
  native: #03 pc 0038d1db  /system/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+698)
  native: #04 pc 00386d55  /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+320)
  native: #05 pc 00386853  /system/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, bool)+530)
  native: #06 pc 00386573  /system/lib/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char>>&)+626)
  native: #07 pc 00364453  /system/lib/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits<char>>&)+122)
  native: #08 pc 0036b54f  /system/lib/libart.so (art::SignalCatcher::HandleSigQuit()+1282)
  native: #09 pc 0036a52d  /system/lib/libart.so (art::SignalCatcher::Run(void*)+240)
  native: #10 pc 000474ff  /system/lib/libc.so (__pthread_start(void*)+22)
  native: #11 pc 0001af69  /system/lib/libc.so (__start_thread+32)
  (no managed stack frames)

Это действительно сбивает с толку, что основной поток находится в состоянии выполнения, однако система показывает диалог anr. Кстати, я проверил (ViewPager.java:1171) v28.0.0@aar. Но не находите ничего полезного.

Как я могу найти причину этого? Большое спасибо

...