From 6d747cacae4f3c39d9360b62aca4ecf01b180727 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Wed, 2 Aug 2017 12:54:05 -0700 Subject: [PATCH] zygote: always log process exit reason. Multiple people have run into problems where apps disappear without a trace. Always log process exit, so that it's clear when a process is intentionally exiting. (The amount of extraneous logging this generates is probably minimal.) Test: none Change-Id: I77169da4d0f05dabfe38490757975ad7ad0247b2 --- core/jni/com_android_internal_os_Zygote.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index cb53106dbf28b..4953fd34aca66 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -108,13 +108,9 @@ static void SigChldHandler(int /*signal_number*/) { // changes its locking strategy or its use of syscalls within the // lazy-init critical section, its use here may become unsafe. if (WIFEXITED(status)) { - if (WEXITSTATUS(status)) { - ALOGI("Process %d exited cleanly (%d)", pid, WEXITSTATUS(status)); - } + ALOGI("Process %d exited cleanly (%d)", pid, WEXITSTATUS(status)); } else if (WIFSIGNALED(status)) { - if (WTERMSIG(status) != SIGKILL) { - ALOGI("Process %d exited due to signal (%d)", pid, WTERMSIG(status)); - } + ALOGI("Process %d exited due to signal (%d)", pid, WTERMSIG(status)); if (WCOREDUMP(status)) { ALOGI("Process %d dumped core.", pid); }