aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Peraza <jperaza@chromium.org>2018-07-06 13:22:17 -0700
committerJoshua Peraza <jperaza@chromium.org>2018-07-06 21:22:45 +0000
commit89e7a8615f3d39c802ce27c21ce62646f10291ef (patch)
tree47c8aecd8c92e467b7826e44a89cf19a24e17647
parentIgnore duplicate module list entries. (diff)
downloadbreakpad-89e7a8615f3d39c802ce27c21ce62646f10291ef.tar.xz
iOS: disable using CFI in stackwalking
dump_syms produces incomplete CFI info on iOS because it doesn't support converting compact unwind to Breakpad symbols. Attempting to use incomplete CFI can result in infinte stack traces. Bug: google-breakpad:764 Change-Id: Id042aa515d17928cb5503a79038607d95c56238d Reviewed-on: https://chromium-review.googlesource.com/1128252 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
-rw-r--r--src/processor/stackwalker_arm.cc13
-rw-r--r--src/processor/stackwalker_arm_unittest.cc8
2 files changed, 15 insertions, 6 deletions
diff --git a/src/processor/stackwalker_arm.cc b/src/processor/stackwalker_arm.cc
index dabb4fd2..1313416f 100644
--- a/src/processor/stackwalker_arm.cc
+++ b/src/processor/stackwalker_arm.cc
@@ -40,6 +40,7 @@
#include "google_breakpad/processor/memory_region.h"
#include "google_breakpad/processor/source_line_resolver_interface.h"
#include "google_breakpad/processor/stack_frame_cpu.h"
+#include "google_breakpad/processor/system_info.h"
#include "processor/cfi_frame_info.h"
#include "processor/logging.h"
#include "processor/stackwalker_arm.h"
@@ -249,10 +250,14 @@ StackFrame* StackwalkerARM::GetCallerFrame(const CallStack* stack,
scoped_ptr<StackFrameARM> frame;
// See if there is DWARF call frame information covering this address.
- scoped_ptr<CFIFrameInfo> cfi_frame_info(
- frame_symbolizer_->FindCFIFrameInfo(last_frame));
- if (cfi_frame_info.get())
- frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get()));
+ // TODO(jperaza): Ignore iOS CFI info until it is properly collected.
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=764
+ if (!system_info_ || system_info_->os != "iOS") {
+ scoped_ptr<CFIFrameInfo> cfi_frame_info(
+ frame_symbolizer_->FindCFIFrameInfo(last_frame));
+ if (cfi_frame_info.get())
+ frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get()));
+ }
// If CFI failed, or there wasn't CFI available, fall back
// to frame pointer, if this is configured.
diff --git a/src/processor/stackwalker_arm_unittest.cc b/src/processor/stackwalker_arm_unittest.cc
index 8a0fd5e9..2ca7a02a 100644
--- a/src/processor/stackwalker_arm_unittest.cc
+++ b/src/processor/stackwalker_arm_unittest.cc
@@ -782,8 +782,12 @@ TEST_F(CFI, RejectBadExpressions) {
class StackwalkerARMFixtureIOS : public StackwalkerARMFixture {
public:
StackwalkerARMFixtureIOS() {
- system_info.os = "iOS";
- system_info.os_short = "ios";
+ // iOS_test is used instead of iOS because the stackwalker has a check to
+ // avoid using CFI for iOS dumps. This is a workaround for bad CFI being
+ // produced by dump_syms for iOS.
+ // https://bugs.chromium.org/p/google-breakpad/issues/detail?id=764
+ system_info.os = "iOS_test";
+ system_info.os_short = "ios_test";
}
};