From f9ab949a9e71839ccec74a29704580cf2d8fc38e Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> Date: Thu, 12 Sep 2024 23:12:11 -0500 Subject: [PATCH] Bump hard_max_frames to 400 --- README.md | 4 ++-- cmake/OptionVariables.cmake | 2 +- src/unwind/unwind.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b4df041..b7311df 100644 --- a/README.md +++ b/README.md @@ -1073,7 +1073,7 @@ back-end such as addr2line, for example, you can configure the library to do so. | N/A | `CPPTRACE_UNWIND_WITH_NOTHING` | all | Unwinding is not done, stack traces will be empty. | Some back-ends (execinfo and `CaptureStackBackTrace`) require a fixed buffer has to be created to read addresses into -while unwinding. By default the buffer can hold addresses for 200 frames (beyond the `skip` frames). This is +while unwinding. By default the buffer can hold addresses for 400 frames (beyond the `skip` frames). This is configurable with `CPPTRACE_HARD_MAX_FRAMES`. **Symbol resolution** @@ -1135,7 +1135,7 @@ Back-ends: Back-end configuration: - `CPPTRACE_BACKTRACE_PATH=`: Path to libbacktrace backtrace.h, needed when compiling with clang/ - `CPPTRACE_HARD_MAX_FRAMES=`: Some back-ends write to a fixed-size buffer. This is the size of that buffer. - Default is `200`. + Default is `400`. - `CPPTRACE_ADDR2LINE_PATH=`: Specify the absolute path to the addr2line binary for cpptrace to invoke. By default the config script will search for a binary and use that absolute path (this is to prevent against path injection). diff --git a/cmake/OptionVariables.cmake b/cmake/OptionVariables.cmake index 90ee11d..541c0b1 100644 --- a/cmake/OptionVariables.cmake +++ b/cmake/OptionVariables.cmake @@ -143,7 +143,7 @@ option(CPPTRACE_DEMANGLE_WITH_NOTHING "" OFF) # ---- Back-end configurations ---- set(CPPTRACE_BACKTRACE_PATH "" CACHE STRING "Path to backtrace.h, if the compiler doesn't already know it. Check /usr/lib/gcc/x86_64-linux-gnu/*/include.") -set(CPPTRACE_HARD_MAX_FRAMES "" CACHE STRING "Hard limit on unwinding depth. Default is 200.") +set(CPPTRACE_HARD_MAX_FRAMES "" CACHE STRING "Hard limit on unwinding depth. Default is 400.") set(CPPTRACE_ADDR2LINE_PATH "" CACHE STRING "Absolute path to the addr2line executable you want to use.") option(CPPTRACE_ADDR2LINE_SEARCH_SYSTEM_PATH "" OFF) diff --git a/src/unwind/unwind.hpp b/src/unwind/unwind.hpp index 28bab60..285ed43 100644 --- a/src/unwind/unwind.hpp +++ b/src/unwind/unwind.hpp @@ -12,7 +12,7 @@ namespace detail { #ifdef CPPTRACE_HARD_MAX_FRAMES constexpr std::size_t hard_max_frames = CPPTRACE_HARD_MAX_FRAMES; #else - constexpr std::size_t hard_max_frames = 200; + constexpr std::size_t hard_max_frames = 400; #endif CPPTRACE_FORCE_NO_INLINE