SWT问题分析
1、db.fatal.00.SWT.dbg HWT信息
Exception Log Time:[Fri Jan 1 12:27:35 GMT 2016] [3497.753160]
Exception Class: SWT
Exception Type: system_server_watchdog
Current Executing Process:
system_server
Backtrace:
Process: system_server
Subject: Blocked in monitor com.android.server.am.ActivityManagerService on foreground thread (android.fg), Blocked in handler on ui thread (android.ui), Blocked in handler on display thread (android.display), Blocked in handler on ActivityManager (ActivityManager), Blocked in handler on PowerManagerService (PowerManagerService)
Build: wtk/m6010_public_3565u/m6010_public_3565u:6.0/MRA58K/1456245566:user/release-keys
2、events_log对应的log
01-01 12:27:24.684545 926 1462 I watchdog: Blocked in monitor com.android.server.am.ActivityManagerService on foreground thread (android.fg),
Blocked in handler on ui thread (android.ui), Blocked in handler on display thread (android.display),
Blocked in handler on ActivityManager (ActivityManager), Blocked in handler on PowerManagerService (PowerManagerService)
3、根据时间点和事件查找trance中有效的log
查看一分钟前的SystemServer的trace
----- pid 926 at 2016-01-01 12:26:49 -----
Cmd line: system_server
见附件:死锁trance.txt
1、搜索关键字Blocked
2、线程的锁依赖关系
3->null
7->94
11->94
12->94
13->94
16->19
19->62
29->16
58->94
62->94
71->94
73->94
75->94
77->94
94->16
查找形成的死锁环:
16->19->62->94->16
"android.display" -> "PowerManagerService" -> "Binder_4" -> "Binder_D" -> "android.display"
3、取出对应的log
"android.display" prio=5 tid=16 Blocked
| group="main" sCount=1 dsCount=0 obj=0x12e15ba0 self=0x7f6a4bdc00
| sysTid=956 nice=-4 cgrp=default sched=0/0 handle=0x7f61475440
| state=S schedstat=( 94347967865 34265249598 177876 ) utm=8079 stm=1355 core=1 HZ=100
| stack=0x7f61373000-0x7f61375000 stackSize=1037KB
| held mutexes=
at com.android.server.power.PowerManagerService.setScreenBrightnessOverrideFromWindowManagerInternal(PowerManagerService.java:2877)
- waiting to lock <0x008506c5> (a java.lang.Object) held by thread 19
at com.android.server.power.PowerManagerService.-wrap31(PowerManagerService.java:-1)
at com.android.server.power.PowerManagerService$LocalService.setScreenBrightnessOverrideFromWindowManager(PowerManagerService.java:4023)
at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner(WindowManagerService.java:10866)
at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedLoop(WindowManagerService.java:9460)
at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLocked(WindowManagerService.java:9407)
at com.android.server.wm.WindowManagerService.-wrap8(WindowManagerService.java:-1)
at com.android.server.wm.WindowManagerService$H.handleMessage(WindowManagerService.java:8247)
- locked <0x0212181a> (a java.util.HashMap)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
"PowerManagerService" prio=5 tid=19 Blocked
| group="main" sCount=1 dsCount=0 obj=0x12e8e6d0 self=0x7f61211a00
| sysTid=965 nice=-4 cgrp=default sched=0/0 handle=0x7f610fa440
| state=S schedstat=( 2829285529 10461426875 37382 ) utm=137 stm=145 core=0 HZ=100
| stack=0x7f60ff8000-0x7f60ffa000 stackSize=1037KB
| held mutexes=
at com.android.server.BatteryService$LocalService.isPowered(BatteryService.java:1087)
- waiting to lock <0x043b9d28> (a java.lang.Object) held by thread 62
at com.android.server.power.PowerManagerService.updateIsPoweredLocked(PowerManagerService.java:1633)
at com.android.server.power.PowerManagerService.updatePowerStateLocked(PowerManagerService.java:1585)
at com.android.server.power.PowerManagerService.handleBatteryStateChangedLocked(PowerManagerService.java:2647)
at com.android.server.power.PowerManagerService.-wrap15(PowerManagerService.java:-1)
at com.android.server.power.PowerManagerService$BatteryReceiver.onReceive(PowerManagerService.java:3149)
- locked <0x008506c5> (a java.lang.Object)
at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:922)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
"Binder_4" prio=5 tid=62 Blocked
| group="main" sCount=1 dsCount=0 obj=0x1323f0a0 self=0x7f5cb6f000
| sysTid=1070 nice=0 cgrp=default sched=0/0 handle=0x7f5c62d440
| state=S schedstat=( 19711811141 13985846399 59602 ) utm=1337 stm=634 core=1 HZ=100
| stack=0x7f5c532000-0x7f5c534000 stackSize=1009KB
| held mutexes=
at com.android.server.am.ActivityManagerService.getTasks(ActivityManagerService.java:9061)
- waiting to lock <0x0100ff2f> (a com.android.server.am.ActivityManagerService) held by thread 94
at android.app.ActivityManager.getRunningTasks(ActivityManager.java:1325)
at com.android.server.BatteryService$Led.updateLightsLocked(BatteryService.java:918)
at com.android.server.BatteryService.processValuesLocked(BatteryService.java:442)
at com.android.server.BatteryService.update(BatteryService.java:393)
- locked <0x043b9d28> (a java.lang.Object)
at com.android.server.BatteryService.-wrap3(BatteryService.java:-1)
at com.android.server.BatteryService$BatteryListener.batteryPropertiesChanged(BatteryService.java:1061)
at android.os.IBatteryPropertiesListener$Stub.onTransact(IBatteryPropertiesListener.java:58)
at android.os.Binder.execTransact(Binder.java:458)
"Binder_D" prio=5 tid=94 Blocked
| group="main" sCount=1 dsCount=0 obj=0x13db60a0 self=0x7f4fb5b400
| sysTid=10268 nice=0 cgrp=default sched=0/0 handle=0x7f56443440
| state=S schedstat=( 11639399144 8541156178 35049 ) utm=832 stm=331 core=3 HZ=100
| stack=0x7f56348000-0x7f5634a000 stackSize=1009KB
| held mutexes=
at com.android.server.wm.WindowManagerService.closeSystemDialogs(WindowManagerService.java:5847)
- waiting to lock <0x0212181a> (a java.util.HashMap) held by thread 16
at com.android.server.am.ActivityManagerService.closeSystemDialogsLocked(ActivityManagerService.java:5957)
at com.android.server.am.ActivityManagerService.closeSystemDialogs(ActivityManagerService.java:5943)
- locked <0x0100ff2f> (a com.android.server.am.ActivityManagerService)
at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:1651)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2617)
at android.os.Binder.execTransact(Binder.java:458)
对于死锁问题,还请先从死锁路径上每个线程的CallStack看是否有和Google或MTK原始代码不一样的地方.
仔细查看后发现"Binder_4"有我们自己修改的代码,还原后验证。
posted on 2021-03-04 11:21 framework开发 阅读(388) 评论(0) 编辑 收藏 举报