Skip to content

Commit

Permalink
prefer libunwind on x86-64 even with -fno-omit-frame-pointer
Browse files Browse the repository at this point in the history
Libunwind is mostly safe on x86-64 and most of OS (e.g. libc) is
compiled without frame pointers anyways. Even when libc is built with
frame pointers, various libc asm routines (e.g. memcpy) are not. And
even for code built with frame pointers we actually sometimes get
SIGPROF inside function prologues, before frame pointer is
established. Which then causes imperfect backtraces.

Libunwind should handle this all (when it doesn't crash or deadlock).
  • Loading branch information
alk committed Feb 15, 2021
1 parent f4aa2a4 commit 37087ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stacktrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static GetStackImplementation *all_impls[] = {

// ppc and i386 implementations prefer arch-specific asm implementations.
// arm's asm implementation is broken
#if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__PPC__)
#if defined(__i386__) || defined(__ppc__) || defined(__PPC__)
#if !defined(NO_FRAME_POINTER)
#define TCMALLOC_DONT_PREFER_LIBUNWIND
#endif
Expand Down

0 comments on commit 37087ec

Please sign in to comment.