summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwittman <wittman@chromium.org>2015-10-15 15:07:35 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-15 22:08:30 +0000
commit4c7da618ef084822c587c62a77bfce0bbbe25608 (patch)
tree4352804294731c1e351646f63383519304fc789f
parentdbde4d0b8dffa1f06ab264f36dda051386772b0b (diff)
downloadchromium_src-4c7da618ef084822c587c62a77bfce0bbbe25608.zip
chromium_src-4c7da618ef084822c587c62a77bfce0bbbe25608.tar.gz
chromium_src-4c7da618ef084822c587c62a77bfce0bbbe25608.tar.bz2
Stack sampling profiler: work around invalid BoringSSL assembly
BoringSSL's custom x86_64 assembly code doesn't follow the Microsoft x64 calling convention, but still has unwind information. This gives wrong results unwinding the stack in some cases, generating instruction pointers that don't point within known modules. This change works around this case in the profiler code until the BoringSSL code can be fixed. BUG=542919 Review URL: https://codereview.chromium.org/1404403002 Cr-Commit-Position: refs/heads/master@{#354375}
-rw-r--r--base/profiler/win32_stack_frame_unwinder.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/base/profiler/win32_stack_frame_unwinder.cc b/base/profiler/win32_stack_frame_unwinder.cc
index ea589bb..2f09e8e 100644
--- a/base/profiler/win32_stack_frame_unwinder.cc
+++ b/base/profiler/win32_stack_frame_unwinder.cc
@@ -205,7 +205,13 @@ bool Win32StackFrameUnwinder::TryUnwind(CONTEXT* context) {
} else {
// We're not at the end of the stack. This frame is untrustworthy and we
// can't safely unwind from here.
- if (unwind_info_present_for_all_frames_) {
+ if (!image_base) {
+ // A null image_base means that the the last unwind produced an invalid
+ // instruction pointer. This has been observed where unwind information
+ // was present for a function but was inconsistent with the actual
+ // function code, in particular in BoringSSL. See
+ // https://crbug.com/542919.
+ } else if (unwind_info_present_for_all_frames_) {
// Unwind information was present for all previous frames, so we can
// be confident this is case 2. Record the module to be blacklisted.
LeafUnwindBlacklist::GetInstance()->BlacklistModule(