From 88f5fc451ebdede7341cefe349dd63fed886f140 Mon Sep 17 00:00:00 2001 From: Ivan Penkov Date: Thu, 24 Feb 2022 02:53:01 +0000 Subject: [PATCH] Never use frame pointer unwinding on a Windows x64 stack. MSVC never generates code that works with frame pointer chasing, and LLVM does the same. Change-Id: I9943160d200509c079fb91394c1a5d789dc188e5 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3486523 Reviewed-by: Mark Mentovai --- src/processor/stackwalker_amd64.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/processor/stackwalker_amd64.cc b/src/processor/stackwalker_amd64.cc index f346a4ee..6e2f86b4 100644 --- a/src/processor/stackwalker_amd64.cc +++ b/src/processor/stackwalker_amd64.cc @@ -289,7 +289,10 @@ StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack, new_frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get())); // If CFI was not available or failed, try using frame pointer recovery. - if (!new_frame.get()) { + // Never try to use frame pointer unwinding on Windows x64 stack. MSVC never + // generates code that works with frame pointer chasing, and LLVM does the + // same. Stack scanning would be better. + if (!new_frame.get() && system_info_->os_short != "windows") { new_frame.reset(GetCallerByFramePointerRecovery(frames)); }