From d2b15dd6749eefaa76a12e0466693e4336e9b8a7 Mon Sep 17 00:00:00 2001 From: Josh Gao Date: Tue, 15 May 2018 17:49:59 -0700 Subject: [PATCH] debuggerd: fix CrasherTest.seccomp_crash_oom. Switch from _exit to raising SIGABRT when we recurse in the fallback handler, so that waiters see an abort instead of a regular exit. Bug: http://b/79717060 Test: debuggerd_test32 Test: debuggerd_test64 Change-Id: Iddee1cb1b759690adf07bbb8cd0fda2faac87571 --- debuggerd/handler/debuggerd_fallback.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/debuggerd/handler/debuggerd_fallback.cpp b/debuggerd/handler/debuggerd_fallback.cpp index dea2e17eb..079a574d3 100644 --- a/debuggerd/handler/debuggerd_fallback.cpp +++ b/debuggerd/handler/debuggerd_fallback.cpp @@ -304,7 +304,16 @@ static void crash_handler(siginfo_t* info, ucontext_t* ucontext, void* abort_mes crash_mutex.lock(); if (lock_count++ > 0) { - async_safe_format_log(ANDROID_LOG_ERROR, "libc", "recursed signal handler call, exiting"); + async_safe_format_log(ANDROID_LOG_ERROR, "libc", "recursed signal handler call, aborting"); + signal(SIGABRT, SIG_DFL); + raise(SIGABRT); + sigset_t sigset; + sigemptyset(&sigset); + sigaddset(&sigset, SIGABRT); + sigprocmask(SIG_UNBLOCK, &sigset, nullptr); + + // Just in case... + async_safe_format_log(ANDROID_LOG_ERROR, "libc", "abort didn't exit, exiting"); _exit(1); }