diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-12-24 08:25:29 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-12-24 08:25:29 +0000 |
commit | 3ea10cc2923d999eafc009169eb60806b2d893d2 (patch) | |
tree | f104336fc3924ca5b5fa7266001732e5abfa9f2c /debuggerd/handler/debuggerd_handler.cpp | |
parent | c227b21fba16659d06daaad4740a53ce5f4c1b41 (diff) | |
parent | 35573d4dc1f82b8a7eb3aad9b44794eddc7b94cc (diff) |
Snap for 4517567 from 35573d4dc1f82b8a7eb3aad9b44794eddc7b94cc to pi-release
Change-Id: Ibb7c6f91530cc94c7dcf547f44b5cf7d45abd27d
Diffstat (limited to 'debuggerd/handler/debuggerd_handler.cpp')
-rw-r--r-- | debuggerd/handler/debuggerd_handler.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/debuggerd/handler/debuggerd_handler.cpp b/debuggerd/handler/debuggerd_handler.cpp index 02bc4b84f..96f3c7c54 100644 --- a/debuggerd/handler/debuggerd_handler.cpp +++ b/debuggerd/handler/debuggerd_handler.cpp @@ -395,9 +395,6 @@ static int debuggerd_dispatch_pseudothread(void* arg) { // crash_dump is ptracing us, fork off a copy of our address space for it to use. create_vm_process(); - input_read.reset(); - input_write.reset(); - // Don't leave a zombie child. int status; if (TEMP_FAILURE_RETRY(waitpid(crash_dump_pid, &status, 0)) == -1) { @@ -406,6 +403,14 @@ static int debuggerd_dispatch_pseudothread(void* arg) { } else if (WIFSTOPPED(status) || WIFSIGNALED(status)) { async_safe_format_log(ANDROID_LOG_FATAL, "libc", "crash_dump helper crashed or stopped"); } + + if (thread_info->siginfo->si_signo != DEBUGGER_SIGNAL) { + // For crashes, we don't need to minimize pause latency. + // Wait for the dump to complete before having the process exit, to avoid being murdered by + // ActivityManager or init. + TEMP_FAILURE_RETRY(read(input_read, &buf, sizeof(buf))); + } + return 0; } |