WATCHDOG NOT KILLING SYSTEM PROCESS com.android.server.am.ActivityManagerService Dead Lock

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

WATCHDOG NOT KILLING SYSTEM PROCESS com.android.server.am.ActivityManagerService Dead Lock

Maunik Shah
Hi All,

I'm facing issue of deadlock in system_server Process.

Trace file logs,

11-22 16:51:57.010 503 644 W Watchdog: *** WATCHDOG NOT KILLING SYSTEM PROCESS:

----- pid 503 at 2012-11-22 16:51:54 -----
Cmd line: system_server

"android.server.ServerThread" prio=5 tid=12 MONITOR

group="main" sCount=1 dsCount=0 obj=0x414c8c10 self=0x491c8928
sysTid=517 nice=-2 sched=0/0 cgrp=apps handle=1361196144
schedstat=( 0 0 0 ) utm=20514 stm=5949 core=0
at com.android.server.am.ActivityManagerService.monitor(ActivityManagerService.java:~15219)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.Watchdog$HeartbeatHandler.handleMessage(Watchdog.java:134)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at com.android.server.ServerThread.run(SystemServer.java:907)

"InputDispatcher" prio=10 tid=28 MONITOR

group="main" sCount=1 dsCount=0 obj=0x417c5e70 self=0x50dd6008
sysTid=539 nice=-8 sched=0/0 cgrp=apps handle=1306828184
schedstat=( 0 0 0 ) utm=15529 stm=13434 core=0
at com.android.server.wm.WindowManagerService.prepareAppTransition(WindowManagerService.java:~3897)
  • waiting to lock <0x41670338> (a java.util.HashMap) held by tid=77 (Binder_C)
    at com.android.server.am.ActivityStack.updateTransitLocked(ActivityStack.java:4133)
    at com.android.server.am.ActivityStack.moveTaskToFrontLocked(ActivityStack.java:4193)
    at com.android.server.am.ActivityStack.startActivityUncheckedLocked(ActivityStack.java:2704)
    at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:2566)
    at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:3114)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at dalvik.system.NativeStart.run(Native Method)

"Binder_C" prio=5 tid=77 MONITOR

group="main" sCount=1 dsCount=0 obj=0x41ad6f70 self=0x513ac038
sysTid=15352 nice=0 sched=0/0 cgrp=apps handle=1360639152
schedstat=( 0 0 0 ) utm=9164 stm=4626 core=0
at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:~3026)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at com.android.server.input.InputManagerService.nativeUnregisterInputChannel(Native Method)
    at com.android.server.input.InputManagerService.unregisterInputChannel(InputManagerService.java:414)
    at com.android.server.wm.WindowState.disposeInputChannel(WindowState.java:841)
    at com.android.server.wm.WindowManagerService.removeWindowLocked(WindowManagerService.java:2395)
    at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2381)
    at com.android.server.wm.Session.remove(Session.java:149)
    at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:124)
    at com.android.server.wm.Session.onTransact(Session.java:111)
    at android.os.Binder.execTransact(Binder.java:367)
    at dalvik.system.NativeStart.run(Native Method)

Here, the deadlock happened between "mWindowMap" and "mService" objects. 

As far as my knowledge, to solve this issue,

either 1) We need to change the sequence of the both the locks, 
or 2) We need to remove one of those lock. 

Could you please help me out on this Deadlock issue?


Thanks,
Maunik

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/nRN-CnSJKS4J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: WATCHDOG NOT KILLING SYSTEM PROCESS com.android.server.am.ActivityManagerService Dead Lock

saminath sanjai
Could attach the complete crash report (ANR...)






On Wed, Dec 12, 2012 at 5:39 PM, Maunik Shah <[hidden email]> wrote:
Hi All,

I'm facing issue of deadlock in system_server Process.

Trace file logs,

11-22 16:51:57.010 503 644 W Watchdog: *** WATCHDOG NOT KILLING SYSTEM PROCESS:

----- pid 503 at 2012-11-22 16:51:54 -----
Cmd line: system_server

"android.server.ServerThread" prio=5 tid=12 MONITOR

group="main" sCount=1 dsCount=0 obj=0x414c8c10 self=0x491c8928
sysTid=517 nice=-2 sched=0/0 cgrp=apps handle=1361196144
schedstat=( 0 0 0 ) utm=20514 stm=5949 core=0
at com.android.server.am.ActivityManagerService.monitor(ActivityManagerService.java:~15219)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.Watchdog$HeartbeatHandler.handleMessage(Watchdog.java:134)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at com.android.server.ServerThread.run(SystemServer.java:907)

"InputDispatcher" prio=10 tid=28 MONITOR

group="main" sCount=1 dsCount=0 obj=0x417c5e70 self=0x50dd6008
sysTid=539 nice=-8 sched=0/0 cgrp=apps handle=<a href="tel:1306828184" value="+911306828184" target="_blank">1306828184
schedstat=( 0 0 0 ) utm=15529 stm=13434 core=0
at com.android.server.wm.WindowManagerService.prepareAppTransition(WindowManagerService.java:~3897)
  • waiting to lock <0x41670338> (a java.util.HashMap) held by tid=77 (Binder_C)
    at com.android.server.am.ActivityStack.updateTransitLocked(ActivityStack.java:4133)
    at com.android.server.am.ActivityStack.moveTaskToFrontLocked(ActivityStack.java:4193)
    at com.android.server.am.ActivityStack.startActivityUncheckedLocked(ActivityStack.java:2704)
    at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:2566)
    at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:3114)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at dalvik.system.NativeStart.run(Native Method)

"Binder_C" prio=5 tid=77 MONITOR

group="main" sCount=1 dsCount=0 obj=0x41ad6f70 self=0x513ac038
sysTid=15352 nice=0 sched=0/0 cgrp=apps handle=<a href="tel:1360639152" value="+911360639152" target="_blank">1360639152
schedstat=( 0 0 0 ) utm=9164 stm=4626 core=0
at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:~3026)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at com.android.server.input.InputManagerService.nativeUnregisterInputChannel(Native Method)
    at com.android.server.input.InputManagerService.unregisterInputChannel(InputManagerService.java:414)
    at com.android.server.wm.WindowState.disposeInputChannel(WindowState.java:841)
    at com.android.server.wm.WindowManagerService.removeWindowLocked(WindowManagerService.java:2395)
    at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2381)
    at com.android.server.wm.Session.remove(Session.java:149)
    at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:124)
    at com.android.server.wm.Session.onTransact(Session.java:111)
    at android.os.Binder.execTransact(Binder.java:367)
    at dalvik.system.NativeStart.run(Native Method)

Here, the deadlock happened between "mWindowMap" and "mService" objects. 

As far as my knowledge, to solve this issue,

either 1) We need to change the sequence of the both the locks, 
or 2) We need to remove one of those lock. 

Could you please help me out on this Deadlock issue?


Thanks,
Maunik

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/nRN-CnSJKS4J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: WATCHDOG NOT KILLING SYSTEM PROCESS com.android.server.am.ActivityManagerService Dead Lock

Maunik Shah
Please find attached ANR report

On Wednesday, 12 December 2012 17:45:02 UTC+5:30, ARM_SOC wrote:
Could attach the complete crash report (ANR...)






On Wed, Dec 12, 2012 at 5:39 PM, Maunik Shah <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="gVY3z41FtZIJ">maun...@...> wrote:
Hi All,

I'm facing issue of deadlock in system_server Process.

Trace file logs,

11-22 16:51:57.010 503 644 W Watchdog: *** WATCHDOG NOT KILLING SYSTEM PROCESS:

----- pid 503 at 2012-11-22 16:51:54 -----
Cmd line: system_server

"android.server.ServerThread" prio=5 tid=12 MONITOR

group="main" sCount=1 dsCount=0 obj=0x414c8c10 self=0x491c8928
sysTid=517 nice=-2 sched=0/0 cgrp=apps handle=1361196144
schedstat=( 0 0 0 ) utm=20514 stm=5949 core=0
at com.android.server.am.ActivityManagerService.monitor(ActivityManagerService.java:~15219)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.Watchdog$HeartbeatHandler.handleMessage(Watchdog.java:134)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at com.android.server.ServerThread.run(SystemServer.java:907)

"InputDispatcher" prio=10 tid=28 MONITOR

group="main" sCount=1 dsCount=0 obj=0x417c5e70 self=0x50dd6008
sysTid=539 nice=-8 sched=0/0 cgrp=apps handle=1306828184
schedstat=( 0 0 0 ) utm=15529 stm=13434 core=0
at com.android.server.wm.WindowManagerService.prepareAppTransition(WindowManagerService.java:~3897)
  • waiting to lock <0x41670338> (a java.util.HashMap) held by tid=77 (Binder_C)
    at com.android.server.am.ActivityStack.updateTransitLocked(ActivityStack.java:4133)
    at com.android.server.am.ActivityStack.moveTaskToFrontLocked(ActivityStack.java:4193)
    at com.android.server.am.ActivityStack.startActivityUncheckedLocked(ActivityStack.java:2704)
    at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:2566)
    at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:3114)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at dalvik.system.NativeStart.run(Native Method)

"Binder_C" prio=5 tid=77 MONITOR

group="main" sCount=1 dsCount=0 obj=0x41ad6f70 self=0x513ac038
sysTid=15352 nice=0 sched=0/0 cgrp=apps handle=1360639152
schedstat=( 0 0 0 ) utm=9164 stm=4626 core=0
at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:~3026)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at com.android.server.input.InputManagerService.nativeUnregisterInputChannel(Native Method)
    at com.android.server.input.InputManagerService.unregisterInputChannel(InputManagerService.java:414)
    at com.android.server.wm.WindowState.disposeInputChannel(WindowState.java:841)
    at com.android.server.wm.WindowManagerService.removeWindowLocked(WindowManagerService.java:2395)
    at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2381)
    at com.android.server.wm.Session.remove(Session.java:149)
    at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:124)
    at com.android.server.wm.Session.onTransact(Session.java:111)
    at android.os.Binder.execTransact(Binder.java:367)
    at dalvik.system.NativeStart.run(Native Method)

Here, the deadlock happened between "mWindowMap" and "mService" objects. 

As far as my knowledge, to solve this issue,

either 1) We need to change the sequence of the both the locks, 
or 2) We need to remove one of those lock. 

Could you please help me out on this Deadlock issue?


Thanks,
Maunik

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/nRN-CnSJKS4J.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gVY3z41FtZIJ">android-...@googlegroups.com.
To unsubscribe from this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="gVY3z41FtZIJ">android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/4d_tiDWJ7fYJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

traces.txt (144K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: WATCHDOG NOT KILLING SYSTEM PROCESS com.android.server.am.ActivityManagerService Dead Lock

Christopher Tate
This is a bug in the Android framework involving teardown handling when input destinations (usually activity windows) go away and the corresponding input channels get torn down while there are pending undelivered keypresses (in this case, crucially, shortcut keys that will wind up causing new activities to be started).  I believe the fix went out in Android 4.2.*; I know it's in AOSP.  You can see the fix patch here -- it's straightforward and likely to be an easy cherrypick into whatever base OS sources you're using:

https://android.googlesource.com/platform/frameworks/base/+/074b8b7cf19d128f16e0de12bc2fc58e7438ec37

Good luck!

(Ideally, of course, you'd snap up to developing on the latest release, but I realize that is seldom practical for OEMs with products already in the pipeline.)

--
christopher tate
android framework engineer


On Wed, Dec 12, 2012 at 8:05 AM, Maunik Shah <[hidden email]> wrote:
Please find attached ANR report


On Wednesday, 12 December 2012 17:45:02 UTC+5:30, ARM_SOC wrote:
Could attach the complete crash report (ANR...)






On Wed, Dec 12, 2012 at 5:39 PM, Maunik Shah <[hidden email]> wrote:
Hi All,

I'm facing issue of deadlock in system_server Process.

Trace file logs,

11-22 16:51:57.010 503 644 W Watchdog: *** WATCHDOG NOT KILLING SYSTEM PROCESS:

----- pid 503 at 2012-11-22 16:51:54 -----
Cmd line: system_server

"android.server.ServerThread" prio=5 tid=12 MONITOR

group="main" sCount=1 dsCount=0 obj=0x414c8c10 self=0x491c8928
sysTid=517 nice=-2 sched=0/0 cgrp=apps handle=1361196144
schedstat=( 0 0 0 ) utm=20514 stm=5949 core=0
at com.android.server.am.ActivityManagerService.monitor(ActivityManagerService.java:~15219)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.Watchdog$HeartbeatHandler.handleMessage(Watchdog.java:134)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at com.android.server.ServerThread.run(SystemServer.java:907)

"InputDispatcher" prio=10 tid=28 MONITOR

group="main" sCount=1 dsCount=0 obj=0x417c5e70 self=0x50dd6008
sysTid=539 nice=-8 sched=0/0 cgrp=apps handle=1306828184
schedstat=( 0 0 0 ) utm=15529 stm=13434 core=0
at com.android.server.wm.WindowManagerService.prepareAppTransition(WindowManagerService.java:~3897)
  • waiting to lock <0x41670338> (a java.util.HashMap) held by tid=77 (Binder_C)
    at com.android.server.am.ActivityStack.updateTransitLocked(ActivityStack.java:4133)
    at com.android.server.am.ActivityStack.moveTaskToFrontLocked(ActivityStack.java:4193)
    at com.android.server.am.ActivityStack.startActivityUncheckedLocked(ActivityStack.java:2704)
    at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:2566)
    at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:3114)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at dalvik.system.NativeStart.run(Native Method)

"Binder_C" prio=5 tid=77 MONITOR

group="main" sCount=1 dsCount=0 obj=0x41ad6f70 self=0x513ac038
sysTid=15352 nice=0 sched=0/0 cgrp=apps handle=1360639152
schedstat=( 0 0 0 ) utm=9164 stm=4626 core=0
at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:~3026)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at com.android.server.input.InputManagerService.nativeUnregisterInputChannel(Native Method)
    at com.android.server.input.InputManagerService.unregisterInputChannel(InputManagerService.java:414)
    at com.android.server.wm.WindowState.disposeInputChannel(WindowState.java:841)
    at com.android.server.wm.WindowManagerService.removeWindowLocked(WindowManagerService.java:2395)
    at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2381)
    at com.android.server.wm.Session.remove(Session.java:149)
    at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:124)
    at com.android.server.wm.Session.onTransact(Session.java:111)
    at android.os.Binder.execTransact(Binder.java:367)
    at dalvik.system.NativeStart.run(Native Method)

Here, the deadlock happened between "mWindowMap" and "mService" objects. 

As far as my knowledge, to solve this issue,

either 1) We need to change the sequence of the both the locks, 
or 2) We need to remove one of those lock. 

Could you please help me out on this Deadlock issue?


Thanks,
Maunik

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/nRN-CnSJKS4J.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/4d_tiDWJ7fYJ.

To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: WATCHDOG NOT KILLING SYSTEM PROCESS com.android.server.am.ActivityManagerService Dead Lock

Maunik Shah
Thanks Christopher Tate for the solution and quick reply. :)

On Thursday, 13 December 2012 03:46:20 UTC+5:30, Christopher Tate wrote:
This is a bug in the Android framework involving teardown handling when input destinations (usually activity windows) go away and the corresponding input channels get torn down while there are pending undelivered keypresses (in this case, crucially, shortcut keys that will wind up causing new activities to be started).  I believe the fix went out in Android 4.2.*; I know it's in AOSP.  You can see the fix patch here -- it's straightforward and likely to be an easy cherrypick into whatever base OS sources you're using:

https://android.googlesource.com/platform/frameworks/base/+/074b8b7cf19d128f16e0de12bc2fc58e7438ec37

Good luck!

(Ideally, of course, you'd snap up to developing on the latest release, but I realize that is seldom practical for OEMs with products already in the pipeline.)

--
christopher tate
android framework engineer


On Wed, Dec 12, 2012 at 8:05 AM, Maunik Shah <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="NHNzj88WUm0J">maun...@...> wrote:
Please find attached ANR report


On Wednesday, 12 December 2012 17:45:02 UTC+5:30, ARM_SOC wrote:
Could attach the complete crash report (ANR...)






On Wed, Dec 12, 2012 at 5:39 PM, Maunik Shah <[hidden email]> wrote:
Hi All,

I'm facing issue of deadlock in system_server Process.

Trace file logs,

11-22 16:51:57.010 503 644 W Watchdog: *** WATCHDOG NOT KILLING SYSTEM PROCESS:

----- pid 503 at 2012-11-22 16:51:54 -----
Cmd line: system_server

"android.server.ServerThread" prio=5 tid=12 MONITOR

group="main" sCount=1 dsCount=0 obj=0x414c8c10 self=0x491c8928
sysTid=517 nice=-2 sched=0/0 cgrp=apps handle=1361196144
schedstat=( 0 0 0 ) utm=20514 stm=5949 core=0
at com.android.server.am.ActivityManagerService.monitor(ActivityManagerService.java:~15219)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.Watchdog$HeartbeatHandler.handleMessage(Watchdog.java:134)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at com.android.server.ServerThread.run(SystemServer.java:907)

"InputDispatcher" prio=10 tid=28 MONITOR

group="main" sCount=1 dsCount=0 obj=0x417c5e70 self=0x50dd6008
sysTid=539 nice=-8 sched=0/0 cgrp=apps handle=1306828184
schedstat=( 0 0 0 ) utm=15529 stm=13434 core=0
at com.android.server.wm.WindowManagerService.prepareAppTransition(WindowManagerService.java:~3897)
  • waiting to lock <0x41670338> (a java.util.HashMap) held by tid=77 (Binder_C)
    at com.android.server.am.ActivityStack.updateTransitLocked(ActivityStack.java:4133)
    at com.android.server.am.ActivityStack.moveTaskToFrontLocked(ActivityStack.java:4193)
    at com.android.server.am.ActivityStack.startActivityUncheckedLocked(ActivityStack.java:2704)
    at com.android.server.am.ActivityStack.startActivityLocked(ActivityStack.java:2566)
    at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:3114)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at dalvik.system.NativeStart.run(Native Method)

"Binder_C" prio=5 tid=77 MONITOR

group="main" sCount=1 dsCount=0 obj=0x41ad6f70 self=0x513ac038
sysTid=15352 nice=0 sched=0/0 cgrp=apps handle=1360639152
schedstat=( 0 0 0 ) utm=9164 stm=4626 core=0
at com.android.server.am.ActivityStack.startActivityMayWait(ActivityStack.java:~3026)
  • waiting to lock <0x414d2cf0> (a com.android.server.am.ActivityManagerService) held by tid=28 (InputDispatcher)
    at com.android.server.am.ActivityManagerService.startActivity(ActivityManagerService.java:2374)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1411)
    at android.app.ContextImpl.startActivity(ContextImpl.java:899)
    at android.app.ContextImpl.startActivity(ContextImpl.java:888)
    at com.android.internal.policy.impl.PhoneWindowManager.interceptKeyBeforeDispatching(PhoneWindowManager.java:2011)
    at com.android.server.wm.InputMonitor.interceptKeyBeforeDispatching(InputMonitor.java:310)
    at com.android.server.input.InputManagerService.interceptKeyBeforeDispatching(InputManagerService.java:1259)
    at com.android.server.input.InputManagerService.nativeUnregisterInputChannel(Native Method)
    at com.android.server.input.InputManagerService.unregisterInputChannel(InputManagerService.java:414)
    at com.android.server.wm.WindowState.disposeInputChannel(WindowState.java:841)
    at com.android.server.wm.WindowManagerService.removeWindowLocked(WindowManagerService.java:2395)
    at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2381)
    at com.android.server.wm.Session.remove(Session.java:149)
    at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:124)
    at com.android.server.wm.Session.onTransact(Session.java:111)
    at android.os.Binder.execTransact(Binder.java:367)
    at dalvik.system.NativeStart.run(Native Method)

Here, the deadlock happened between "mWindowMap" and "mService" objects. 

As far as my knowledge, to solve this issue,

either 1) We need to change the sequence of the both the locks, 
or 2) We need to remove one of those lock. 

Could you please help me out on this Deadlock issue?


Thanks,
Maunik

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/nRN-CnSJKS4J.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/4d_tiDWJ7fYJ.

To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="NHNzj88WUm0J">android-...@googlegroups.com.
To unsubscribe from this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="NHNzj88WUm0J">android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/oh2yHRZuUsAJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.