From f39383103b888a38e486e8066d7c35838e2f98d4 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 30 Jul 2015 08:15:57 -0700 Subject: [PATCH] bionic no longer sends SIGPIPE to debuggerd. Static binaries don't get the signal handler installed (that's done by the dynamic linker) so we don't need to worry about seeing SIGPIPE crashes from old binaries. Bug: http://b/20659371 Change-Id: I3b5566634fadd3e822262561188d29814bccd1fd --- debuggerd/crasher.c | 7 ------- debuggerd/debuggerd.cpp | 1 - debuggerd/test/tombstone_test.cpp | 2 +- debuggerd/tombstone.cpp | 1 - 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/debuggerd/crasher.c b/debuggerd/crasher.c index af86fe9c8..b5064b485 100644 --- a/debuggerd/crasher.c +++ b/debuggerd/crasher.c @@ -157,12 +157,6 @@ static int do_action(const char* arg) } else if (!strcmp(arg, "SIGFPE")) { raise(SIGFPE); return EXIT_SUCCESS; - } else if (!strcmp(arg, "SIGPIPE")) { - int pipe_fds[2]; - pipe(pipe_fds); - close(pipe_fds[0]); - write(pipe_fds[1], "oops", 4); - return EXIT_SUCCESS; } else if (!strcmp(arg, "SIGTRAP")) { raise(SIGTRAP); return EXIT_SUCCESS; @@ -189,7 +183,6 @@ static int do_action(const char* arg) fprintf(stderr, " LOG_ALWAYS_FATAL call LOG_ALWAYS_FATAL\n"); fprintf(stderr, " LOG_ALWAYS_FATAL_IF call LOG_ALWAYS_FATAL\n"); fprintf(stderr, " SIGFPE cause a SIGFPE\n"); - fprintf(stderr, " SIGPIPE cause a SIGPIPE\n"); fprintf(stderr, " SIGSEGV cause a SIGSEGV at address 0x0 (synonym: crash)\n"); fprintf(stderr, " SIGSEGV-non-null cause a SIGSEGV at a non-zero address\n"); fprintf(stderr, " SIGSEGV-unmapped mmap/munmap a region of memory and then attempt to access it\n"); diff --git a/debuggerd/debuggerd.cpp b/debuggerd/debuggerd.cpp index 787b7aad6..599995cfd 100644 --- a/debuggerd/debuggerd.cpp +++ b/debuggerd/debuggerd.cpp @@ -408,7 +408,6 @@ static void handle_request(int fd) { case SIGBUS: case SIGFPE: case SIGILL: - case SIGPIPE: case SIGSEGV: #ifdef SIGSTKFLT case SIGSTKFLT: diff --git a/debuggerd/test/tombstone_test.cpp b/debuggerd/test/tombstone_test.cpp index a771a39f5..d945d27ba 100644 --- a/debuggerd/test/tombstone_test.cpp +++ b/debuggerd/test/tombstone_test.cpp @@ -76,7 +76,7 @@ class TombstoneTest : public ::testing::Test { resetLogs(); elf_set_fake_build_id(""); siginfo_t si; - si.si_signo = SIGPIPE; + si.si_signo = SIGABRT; ptrace_set_fake_getsiginfo(si); } diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp index 114c7e48a..e283923d2 100644 --- a/debuggerd/tombstone.cpp +++ b/debuggerd/tombstone.cpp @@ -81,7 +81,6 @@ static const char* get_signame(int sig) { case SIGBUS: return "SIGBUS"; case SIGFPE: return "SIGFPE"; case SIGILL: return "SIGILL"; - case SIGPIPE: return "SIGPIPE"; case SIGSEGV: return "SIGSEGV"; #if defined(SIGSTKFLT) case SIGSTKFLT: return "SIGSTKFLT";