summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Gao2018-05-15 19:49:59 -0500
committerJosh Gao2018-05-16 02:16:09 -0500
commitd2b15dd6749eefaa76a12e0466693e4336e9b8a7 (patch)
treef8df103d0e3688c78005bb3be3f4beab078dbbcd /debuggerd
parent48cf760bea211b43aa79675c6b73f846202865f9 (diff)
downloadplatform-system-core-d2b15dd6749eefaa76a12e0466693e4336e9b8a7.tar.gz
platform-system-core-d2b15dd6749eefaa76a12e0466693e4336e9b8a7.tar.xz
platform-system-core-d2b15dd6749eefaa76a12e0466693e4336e9b8a7.zip
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
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/handler/debuggerd_fallback.cpp11
1 files changed, 10 insertions, 1 deletions
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
304 304
305 crash_mutex.lock(); 305 crash_mutex.lock();
306 if (lock_count++ > 0) { 306 if (lock_count++ > 0) {
307 async_safe_format_log(ANDROID_LOG_ERROR, "libc", "recursed signal handler call, exiting"); 307 async_safe_format_log(ANDROID_LOG_ERROR, "libc", "recursed signal handler call, aborting");
308 signal(SIGABRT, SIG_DFL);
309 raise(SIGABRT);
310 sigset_t sigset;
311 sigemptyset(&sigset);
312 sigaddset(&sigset, SIGABRT);
313 sigprocmask(SIG_UNBLOCK, &sigset, nullptr);
314
315 // Just in case...
316 async_safe_format_log(ANDROID_LOG_ERROR, "libc", "abort didn't exit, exiting");
308 _exit(1); 317 _exit(1);
309 } 318 }
310 319