summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorIvan Lozano <ivanlozano@google.com>2018-11-19 10:43:47 -0800
committerIvan Lozano <ivanlozano@google.com>2018-11-27 09:00:54 -0800
commitdf3cec925fce86b99c6ef6a88decd1870c55dcc0 (patch)
tree09f603f5acc2efa45251aa5e5babd76d7025c887 /debuggerd
parentee9d6382d13411614c27b25de8c97273f066a8d3 (diff)
downloadsystem_core-df3cec925fce86b99c6ef6a88decd1870c55dcc0.tar.gz
system_core-df3cec925fce86b99c6ef6a88decd1870c55dcc0.tar.bz2
system_core-df3cec925fce86b99c6ef6a88decd1870c55dcc0.zip
Tombstone support for XOM-related SIGSEGVs.
Make XOM related crashes a little less mysterious by adding an abort cause explaining the crash. Bug: 77958880 Test: Abort cause in tombstone for a XOM-related crash. Change-Id: I7af1bc251d9823bc755ad98d8b3b87c12bbaecba
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/libdebuggerd/tombstone.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/debuggerd/libdebuggerd/tombstone.cpp b/debuggerd/libdebuggerd/tombstone.cpp
index 0b8a9362b..11792635d 100644
--- a/debuggerd/libdebuggerd/tombstone.cpp
+++ b/debuggerd/libdebuggerd/tombstone.cpp
@@ -78,7 +78,7 @@ static void dump_header_info(log_t* log) {
_LOG(log, logtype::HEADER, "ABI: '%s'\n", ABI_STRING);
}
-static void dump_probable_cause(log_t* log, const siginfo_t* si) {
+static void dump_probable_cause(log_t* log, const siginfo_t* si, BacktraceMap* map) {
std::string cause;
if (si->si_signo == SIGSEGV && si->si_code == SEGV_MAPERR) {
if (si->si_addr < reinterpret_cast<void*>(4096)) {
@@ -94,6 +94,14 @@ static void dump_probable_cause(log_t* log, const siginfo_t* si) {
} else if (si->si_addr == reinterpret_cast<void*>(0xffff0f60)) {
cause = "call to kuser_cmpxchg64";
}
+ } else if (si->si_signo == SIGSEGV && si->si_code == SEGV_ACCERR) {
+ for (auto it = map->begin(); it != map->end(); ++it) {
+ const backtrace_map_t* entry = *it;
+ if (si->si_addr >= reinterpret_cast<void*>(entry->start) &&
+ si->si_addr < reinterpret_cast<void*>(entry->end) && entry->flags == PROT_EXEC) {
+ cause = "execute-only (no-read) memory access error; likely due to data in .text.";
+ }
+ }
} else if (si->si_signo == SIGSYS && si->si_code == SYS_SECCOMP) {
cause = StringPrintf("seccomp prevented call to disallowed %s system call %d", ABI_STRING,
si->si_syscall);
@@ -125,8 +133,6 @@ static void dump_signal_info(log_t* log, const ThreadInfo& thread_info, Memory*
_LOG(log, logtype::HEADER, "signal %d (%s), code %d (%s%s), fault addr %s\n",
thread_info.siginfo->si_signo, get_signame(thread_info.siginfo),
thread_info.siginfo->si_code, get_sigcode(thread_info.siginfo), sender_desc, addr_desc);
-
- dump_probable_cause(log, thread_info.siginfo);
}
static void dump_thread_info(log_t* log, const ThreadInfo& thread_info) {
@@ -426,6 +432,7 @@ static bool dump_thread(log_t* log, BacktraceMap* map, Memory* process_memory,
if (thread_info.siginfo) {
dump_signal_info(log, thread_info, process_memory);
+ dump_probable_cause(log, thread_info.siginfo, map);
}
if (primary_thread) {