From b035a19e4f29b1f711b288ea830db745cf8e1e91 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Tue, 1 Mar 2016 17:56:00 -0800 Subject: [PATCH] Do not do local unwinds through .oat or .dex maps. Bug: 27391690 (cherry picked from commit 4265ed7cc897c54c55bb18bb341859b5df0f4966) Change-Id: I88a49537544b507a3b0bfa61eafc27400a05281b --- libbacktrace/UnwindCurrent.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libbacktrace/UnwindCurrent.cpp b/libbacktrace/UnwindCurrent.cpp index 67e583f08..f985f528c 100644 --- a/libbacktrace/UnwindCurrent.cpp +++ b/libbacktrace/UnwindCurrent.cpp @@ -23,6 +23,7 @@ #define UNW_LOCAL_ONLY #include +#include #include #include "BacktraceLog.h" @@ -124,6 +125,16 @@ bool UnwindCurrent::UnwindFromContext(size_t num_ignore_frames, ucontext_t* ucon num_ignore_frames--; } } + + // For now, do not attempt to do local unwinds through .dex, or .oat + // maps. We can only unwind through these if there is a compressed + // section available, almost all local unwinds are done by ART + // which will dump the Java frames separately. + // TODO: Come up with a flag to control this. + if (android::base::EndsWith(frame->map.name, ".dex") + || android::base::EndsWith(frame->map.name, ".oat")) { + break; + } ret = unw_step (cursor.get()); } while (ret > 0 && num_frames < MAX_BACKTRACE_FRAMES);