I have the following ANR after entering and exiting (several times) a screen which uses an AsyncTask to load some data.
The full ANR is here: http://pastebin.com/g1MDv44Q
A few observations:
- My package name doesn't appear anywhere on the stacks
- The "main" thread is SUSPENDED
- There are a lot of threads in WAIT, this number increases each time and enter/exit the screen
I also noticed that the two SUSPENDED threads seem to be in some sort of deadlock or infinite loop, one "removing messages" and the other "enqueueing messages":
"main" prio=5 tid=1 SUSPENDED
| group="main" sCount=1 dsCount=0 obj=0x415dce88 self=0x414fb898
| sysTid=9246 nice=-6 sched=0/0 cgrp=apps handle=1074143572
| state=S schedstat=( 487768247094 88677560041 387007 ) utm=45537 stm=3239 core=3
at android.os.MessageQueue.removeMessages(MessageQueue.java:~472)
at android.os.Handler.removeCallbacks(Handler.java:479)
at android.view.View.removeCallbacks(View.java:11343)
at android.support.v7.widget.RecyclerView$ViewFlinger.stop(RecyclerView.java:3914)
at android.support.v7.widget.RecyclerView.stopScrollersInternal(RecyclerView.java:1641)
at android.support.v7.widget.RecyclerView.setScrollState(RecyclerView.java:1112)
at android.support.v7.widget.RecyclerView.cancelTouch(RecyclerView.java:2252)
at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2237)
at android.view.View.dispatchTouchEvent(View.java:7837)
...
"Thread-28544" prio=4 tid=99 SUSPENDED
| group="main" sCount=1 dsCount=0 obj=0x451703d0 self=0x7bc9d658
| sysTid=13075 nice=10 sched=0/0 cgrp=apps handle=-2111467576
| state=S schedstat=( 4705817143 4247615417 4666 ) utm=444 stm=26 core=3
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:~359)
at android.os.Handler.enqueueMessage(Handler.java:626)
at android.os.Handler.sendMessageAtTime(Handler.java:595)
at android.os.Handler.sendMessageDelayed(Handler.java:566)
at android.os.Handler.sendEmptyMessageDelayed(Handler.java:530)
at android.os.Handler.sendEmptyMessage(Handler.java:515)
at com.android.org.chromium.base.SystemMessageHandler.setTimer(SystemMessageHandler.java:30)
at dalvik.system.NativeStart.run(Native Method)
Is this analysis correct?
If yes, why is it happening and how can I fix or prevent it?
If not, what is the correct analysis for this ANR?