summaryrefslogtreecommitdiffstats
path: root/debuggerd/debuggerd.c
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2011-07-29 12:36:47 -0700
committerAndy McFadden <fadden@android.com>2011-07-29 12:36:47 -0700
commit44e12eceecd0be8ba832a003733bfc859b2ccd9d (patch)
tree0e10600b188d146edabe41a7a47002ed834753f6 /debuggerd/debuggerd.c
parentc349636c7cec0abe3a92c220a6d828edbd21208b (diff)
downloadsystem_core-44e12eceecd0be8ba832a003733bfc859b2ccd9d.zip
system_core-44e12eceecd0be8ba832a003733bfc859b2ccd9d.tar.gz
system_core-44e12eceecd0be8ba832a003733bfc859b2ccd9d.tar.bz2
debuggerd can't handle debuggerd crashes
When a process receives a fatal signal, it connects to debuggerd and initiates a conversation over a socket. When the crashing process is debuggerd, the conversation stalls forever, and you stop getting native crash details. This resets the signal handlers to SIG_DFL, so that debuggerd simply crashes and gets restarted. Bug 5035703 Change-Id: Ie081d710d046f701bca7e7d8ea3e1d24766d9f61
Diffstat (limited to 'debuggerd/debuggerd.c')
-rw-r--r--debuggerd/debuggerd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/debuggerd/debuggerd.c b/debuggerd/debuggerd.c
index 685f147..892bc99 100644
--- a/debuggerd/debuggerd.c
+++ b/debuggerd/debuggerd.c
@@ -695,6 +695,18 @@ int main()
struct sigaction act;
int logsocket = -1;
+ /*
+ * debuggerd crashes can't be reported to debuggerd. Reset all of the
+ * crash handlers.
+ */
+ signal(SIGILL, SIG_DFL);
+ signal(SIGABRT, SIG_DFL);
+ signal(SIGBUS, SIG_DFL);
+ signal(SIGFPE, SIG_DFL);
+ signal(SIGSEGV, SIG_DFL);
+ signal(SIGSTKFLT, SIG_DFL);
+ signal(SIGPIPE, SIG_DFL);
+
logsocket = socket_local_client("logd",
ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_DGRAM);
if(logsocket < 0) {