From 3089bed197a4fbfcc3fb741aa0ed6b3e162e392c Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 14 Jul 2014 15:07:04 -0700 Subject: [PATCH] Zygote: make libprocessgroup failures non-fatal createProcessGroup can fail if the kernel does not support the cpuacct cgroup. Print a more useful error message, and don't runtime abort. Bug: 16243791 Change-Id: Ibbf081bda58a99c83b8070f55d151905c706b378 --- core/jni/com_android_internal_os_Zygote.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 989b60eef0d28..64366e5a0467e 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -439,8 +439,11 @@ static pid_t ForkAndSpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArra if (!is_system_server) { int rc = createProcessGroup(uid, getpid()); if (rc != 0) { - ALOGE("createProcessGroup(%d, %d) failed: %s", uid, pid, strerror(-rc)); - RuntimeAbort(env); + if (rc == -EROFS) { + ALOGW("createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?"); + } else { + ALOGE("createProcessGroup(%d, %d) failed: %s", uid, pid, strerror(-rc)); + } } }