So I think this issue may be Android kernel related, because we seem to be the only ones hitting it. This seems to imply that there's a kernel change we don't have or the kernel has changed in our newer versions. The symptom is:
W/SchedPolicy( 1193): add_tid_to_cgroup failed to write '1263' (Permission denied); policy=1 W/ActivityManager( 1193): Failed setting process group of 1263 to -1 W/System.err( 1193): java.lang.SecurityException: No permission to set to given group W/System.err( 1193): at android.os.Process.setProcessGroup(Native Method) W/System.err( 1193): at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:13516) W/System.err( 1193): at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:13636) W/System.err( 1193): at com.android.server.am.ActivityManagerService.updateLruProcessLocked(ActivityManagerService.java:1903) W/System.err( 1193): at com.android.server.am.ActiveServices.realStartServiceLocked(ActiveServices.java:1089) W/System.err( 1193): at com.android.server.am.ActiveServices.attachApplicationLocked(ActiveServices.java:1472) W/System.err( 1193): at com.android.server.am.ActivityManagerService.attachApplicationLocked(ActivityManagerService.java:4269) W/System.err( 1193): at com.android.server.am.ActivityManagerService.attachApplication(ActivityManagerService.java:4317) W/System.err( 1193): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:386) W/System.err( 1193): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1675) W/System.err( 1193): at android.os.Binder.execTransact(Binder.java:351) W/System.err( 1193): at dalvik.system.NativeStart.run(Native Method)
Looking back at top:
I have:
1193 0 0% S 70 548684K 42168K fg system system_server 1263 0 0% S 13 476904K 36216K fg u0_a27 com.android.systemui
so system_server is attempting to write com.android.systemui and its getting an error. The relevant native function seems to be:
/workspace/androids/4_juice-aosp/system/core/libcutils/sched_policy.c
I saw that Tixy also hit this,
https://bugs.launchpad.net/linaro-landing-team-arm/+bug/1037611
..but that the bug never got assigned, etc...
I tried setting:
chmod 0660 /dev/cpuctl/tasks
to
chmod 0666 /dev/cpuctl/tasks
but didn't see any difference.
This change from the Android automerger, seems to be related:
https://android.googlesource.com/platform/system/core/+/d7562ee3d61504ba5d2f...
I also found what appears to be a workaround:
https://android.googlesource.com/platform/frameworks/native/+/f30fd01497a53c...
Looking at additional logs I see what looks like an attempt to put the process that needs to get changed into the right group:
W/System.err( 1192): java.lang.SecurityException: No permission to set to given group W/System.err( 1192): at android.os.Process.setProcessGroup(Native Method) W/System.err( 1192): at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:13516) W/System.err( 1192): at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:13636) W/System.err( 1192): at com.android.server.am.ActivityManagerService.updateLruProcessLocked(ActivityManagerService.java:1903) W/System.err( 1192): at com.android.server.am.ActiveServices.realStartServiceLocked(ActiveServices.java:1089) W/System.err( 1192): at com.android.server.am.ActiveServices.attachApplicationLocked(ActiveServices.java:1472) W/SchedPolicy( 1192): add_tid_to_cgroup failed to write '1268' (Permission denied); policy=1 W/ActivityManager( 1192): Failed setting process group of 1268 to -1 W/System.err( 1192): at com.android.server.am.ActivityManagerService.attachApplicationLocked(ActivityManagerService.java:4269) W/System.err( 1192): at com.android.server.am.ActivityManagerService.attachApplication(ActivityManagerService.java:4317) W/System.err( 1192): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:386) W/System.err( 1192): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1675) W/System.err( 1192): at android.os.Binder.execTransact(Binder.java:351) W/System.err( 1192): at dalvik.system.NativeStart.run(Native Method)
1192 0 0% S 71 549636K 42460K fg system system_server 1268 0 0% S 14 477920K 36224K fg u0_a27 com.android.systemui
From these logs I think system_server is trying to put
com.android.systemui into the bg because its using a lot of CPU, but it can't because it either doesn't have access or something else is going on.
Anyhow, attached some logs from a first boot scenario.
Any help or insight would be great.