aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2016-03-07 15:55:09 -0800
committerChristopher Ferris <cferris@google.com>2016-03-08 11:07:43 -0800
commit40e1c65f702a967458470ba5a8f35cf2683b37ae (patch)
treeb9c087360433557d34ba2fd1654da8f5e0b3575f
parent6292bbbc3f678648fb5a1ec8222d33f6a5bb992a (diff)
downloadlibunwind-40e1c65f702a967458470ba5a8f35cf2683b37ae.tar.gz
Do not try non-dwarf local unwinds for x86.
The frame-chain unwind code in libunwind never really works and it has a high probability of trying to access unmapped memory. When doing a remote unwind, this will simply result in the unwind stopping. When doing a local unwind, this can lead to crashes. Disable this method for local unwinds. Bug: 26807329 (cherry picked from commit 936e80b1ede36884588abe481406d73344826d5b) Change-Id: I0032ffd833b0b9e8931defef31e2277e41186abc
-rw-r--r--src/x86/Gstep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/x86/Gstep.c b/src/x86/Gstep.c
index 308f220b..b037b71a 100644
--- a/src/x86/Gstep.c
+++ b/src/x86/Gstep.c
@@ -44,6 +44,12 @@ unw_step (unw_cursor_t *cursor)
/* Try DWARF-based unwinding... */
ret = dwarf_step (&c->dwarf);
+#if !defined(UNW_LOCAL_ONLY)
+ /* Do not use this method on a local unwind. There is a very high
+ * probability this method will try to access unmapped memory, which
+ * will crash the process. Since this almost never actually works,
+ * it should be okay to skip.
+ */
if (ret < 0)
{
/* DWARF failed, let's see if we can follow the frame-chain
@@ -110,6 +116,7 @@ unw_step (unw_cursor_t *cursor)
else
c->dwarf.ip = 0;
}
+#endif
/* ANDROID support update. */
if (ret >= 0)