Familiarity with ANR in sharedPreferences, I donβt know how to find the problem.
Here are the three parts of the trace, most of the other threads are WAIT or TIMED_WAIT. "main" thread is blocked due to countdownlatch.await (). 2nd thread "pool-1-thread-1" waiting for fsync. The latter is trying to read something.
I think the 2nd thread blocked the main thread, because if this one cannot finish, it will not call countdownlatch.countdown (), so the main thread should wait.
But I can not understand why it stops at fsync. Is this third thread related to this?
thread1
"main" prio=5 tid=1 WAIT | group="main" sCount=1 dsCount=0 obj=0x418efe58 self=0x4180b6e8 | sysTid=4178 nice=-6 sched=0/0 cgrp=apps handle=1074565460 | state=S schedstat=( 3385090416 1929697750 7848 ) utm=278 stm=60 core=3 at java.lang.Object.wait(Native Method) - waiting on <0x418eff28> (a java.lang.VMThread) held by tid=1 (main) at java.lang.Thread.parkFor(Thread.java:1205) at sun.misc.Unsafe.park(Unsafe.java:325) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:813) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:973) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1281) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:202) at android.app.SharedPreferencesImpl$EditorImpl$1.run(SharedPreferencesImpl.java:364) at android.app.QueuedWork.waitToFinish(QueuedWork.java:88) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2697) at android.app.ActivityThread.access$2100(ActivityThread.java:138) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5095) 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:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
thread2
"pool-1-thread-1" prio=5 tid=10 SUSPENDED | group="main" sCount=1 dsCount=0 obj=0x41ca62e0 self=0x6034b008 | sysTid=4246 nice=0 sched=0/0 cgrp=apps handle=1612996584 | state=S schedstat=( 189967314 218846863 555 ) utm=15 stm=3 core=2
thread3
"Thread-5346" prio=5 tid=48 SUSPENDED | group="main" sCount=1 dsCount=0 obj=0x42b9e3c0 self=0x6278f280 | sysTid=4841 nice=0 sched=0/0 cgrp=apps handle=1652085768 | state=S schedstat=( 6396036717 2412660825 15121 ) utm=612 stm=27 core=1 at java.lang.StackTraceElement.<init>(StackTraceElement.java:~61) at java.lang.Throwable.nativeGetStackTrace(Native Method) at java.lang.Throwable.getInternalStackTrace(Throwable.java:264) at java.lang.Throwable.getStackTrace(Throwable.java:200) at org.apache.commons.logging.impl.Jdk14Logger.log(Jdk14Logger.java:88) at org.apache.commons.logging.impl.Jdk14Logger.debug(Jdk14Logger.java:113) at org.apache.http.impl.conn.Wire.wire(Wire.java:64) at org.apache.http.impl.conn.Wire.input(Wire.java:116) at org.apache.http.impl.conn.LoggingSessionInputBuffer.read(LoggingSessionInputBuffer.java:74) at org.apache.http.impl.io.ContentLengthInputStream.read(ContentLengthInputStream.java:174) at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:159) at org.qiyi.android.coreplayer.a.aux.a(SourceFile:206) at org.qiyi.android.coreplayer.a.aux.a(SourceFile:140) at org.qiyi.android.coreplayer.a.aux.a(SourceFile:105) at org.qiyi.android.coreplayer.a.com7.a(SourceFile:361) at org.qiyi.android.coreplayer.a.nul.run(SourceFile:158) at java.lang.Thread.run(Thread.java:841)
source share