From 90de25f1dfe637b7929454644e39d0436606c999 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Sat, 13 Jul 2024 23:16:13 -0500 Subject: [PATCH 1/4] Bump to v0.6.3 --- CHANGELOG.md | 20 ++++++++++++++++++++ CMakeLists.txt | 2 +- README.md | 14 +++++++------- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72b808c..b066605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog - [Changelog](#changelog) +- [v0.6.3](#v063) - [v0.6.2](#v062) - [v0.6.1](#v061) - [v0.6.0](#v060) @@ -18,6 +19,25 @@ - [v0.1.1](#v011) - [v0.1](#v01) +# v0.6.3 + +Added: +- Added a flag to disable inclusion of `` by cpptrace.hpp and the definition of formatter specializations + +Fixes: +- Fixed use after free during cleanup of split dwarf information https://github.com/jeremy-rifkin/cpptrace/issues/141 +- Fixed an issue with TCO by clang on arm interfering with unwinding skip counts for internal methods +- Fixed issue with incorrect object addresses being reported on macos when debug maps are used +- Fixed issue with handling of split dwarf emitted by clang under dwarf4 mode + +Other changes: +- Added note about signal-safe tracing requiring `_dl_find_object` to documentation and fixed errors in the signal-safe + tracing docs +- Added more configurations to unittest ci setup +- Optimized unittest ci matrix setup +- Added options for zstd and libdwarf sources if FetchContent is being used to bring the dependencies in +- Optimized includes in cpptrace.hpp + # v0.6.2 Fixes: diff --git a/CMakeLists.txt b/CMakeLists.txt index ba565a8..ac6d9a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ set(package_name "cpptrace") project( cpptrace - VERSION 0.6.2 + VERSION 0.6.3 DESCRIPTION "Simple, portable, and self-contained stacktrace library for C++11 and newer " HOMEPAGE_URL "https://github.com/jeremy-rifkin/cpptrace" LANGUAGES C CXX diff --git a/README.md b/README.md index 6871fde..ca75eb1 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ include(FetchContent) FetchContent_Declare( cpptrace GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git - GIT_TAG v0.6.2 # + GIT_TAG v0.6.3 # ) FetchContent_MakeAvailable(cpptrace) target_link_libraries(your_target cpptrace::cpptrace) @@ -600,7 +600,7 @@ include(FetchContent) FetchContent_Declare( cpptrace GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git - GIT_TAG v0.6.2 # + GIT_TAG v0.6.3 # ) FetchContent_MakeAvailable(cpptrace) target_link_libraries(your_target cpptrace::cpptrace) @@ -616,7 +616,7 @@ information. ```sh git clone https://github.com/jeremy-rifkin/cpptrace.git -git checkout v0.6.2 +git checkout v0.6.3 mkdir cpptrace/build cd cpptrace/build cmake .. -DCMAKE_BUILD_TYPE=Release @@ -659,7 +659,7 @@ you when installing new libraries. ```ps1 git clone https://github.com/jeremy-rifkin/cpptrace.git -git checkout v0.6.2 +git checkout v0.6.3 mkdir cpptrace/build cd cpptrace/build cmake .. -DCMAKE_BUILD_TYPE=Release @@ -677,7 +677,7 @@ To install just for the local user (or any custom prefix): ```sh git clone https://github.com/jeremy-rifkin/cpptrace.git -git checkout v0.6.2 +git checkout v0.6.3 mkdir cpptrace/build cd cpptrace/build cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME/wherever @@ -760,7 +760,7 @@ make install cd ~/scratch/cpptrace-test git clone https://github.com/jeremy-rifkin/cpptrace.git cd cpptrace -git checkout v0.6.2 +git checkout v0.6.3 mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=On -DCPPTRACE_USE_EXTERNAL_LIBDWARF=On -DCMAKE_PREFIX_PATH=~/scratch/cpptrace-test/resources -DCMAKE_INSTALL_PREFIX=~/scratch/cpptrace-test/resources @@ -780,7 +780,7 @@ cpptrace and its dependencies. Cpptrace is available through conan at https://conan.io/center/recipes/cpptrace. ``` [requires] -cpptrace/0.6.2 +cpptrace/0.6.3 [generators] CMakeDeps CMakeToolchain From 767ddeb10cb2b949ddfa12a68742829d5dfda0af Mon Sep 17 00:00:00 2001 From: Degen's Regens Date: Fri, 16 Aug 2024 17:24:40 +0200 Subject: [PATCH 2/4] size_t cannot be negative (#154) --- docs/signal-safe-tracing.md | 3 --- test/signal_tracer.cpp | 3 --- 2 files changed, 6 deletions(-) diff --git a/docs/signal-safe-tracing.md b/docs/signal-safe-tracing.md index bb8e57a..950c257 100644 --- a/docs/signal-safe-tracing.md +++ b/docs/signal-safe-tracing.md @@ -223,9 +223,6 @@ int main() { std::size_t res = fread(&frame, sizeof(frame), 1, stdin); if(res == 0) { break; - } else if(res == -1) { - perror("Something went wrong while reading from the pipe"); - break; } else if(res != 1) { std::cerr<<"Something went wrong while reading from the pipe"< Date: Fri, 16 Aug 2024 10:29:00 -0500 Subject: [PATCH 3/4] Remove some commented code --- test/signal_tracer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/signal_tracer.cpp b/test/signal_tracer.cpp index 2b5e773..f0dba04 100644 --- a/test/signal_tracer.cpp +++ b/test/signal_tracer.cpp @@ -9,11 +9,9 @@ int main() { cpptrace::object_trace trace; while(true) { cpptrace::safe_object_frame frame; - // std::size_t res = read(STDIN_FILENO, &frame, sizeof(frame)); std::size_t res = fread(&frame, sizeof(frame), 1, stdin); if(res == 0) { break; - //} else if(res != sizeof(frame)) { } else if(res != 1) { std::cerr<<"Oops, size mismatch "< Date: Sun, 18 Aug 2024 00:53:44 -0500 Subject: [PATCH 4/4] Fix -g on msvc --- test/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 02cf00a..6136004 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,11 +7,17 @@ set( ${warning_options} $<$:-Wno-infinite-recursion> ) +set( + debug + $<$>:-g> + $<$:/DEBUG> +) + macro(add_test_dependencies exec_name) target_compile_features(${exec_name} PRIVATE cxx_std_11) target_link_libraries(${exec_name} PRIVATE ${target_name}) target_compile_options(${exec_name} PRIVATE ${warning_options}) - target_compile_options(${exec_name} PRIVATE -g) + target_compile_options(${exec_name} PRIVATE ${debug}) if(CPPTRACE_BUILD_TESTING_SPLIT_DWARF) target_compile_options(${exec_name} PRIVATE -gsplit-dwarf) endif() @@ -42,7 +48,7 @@ if(UNIX) add_executable(signal_demo signal_demo.cpp) target_compile_features(signal_demo PRIVATE cxx_std_11) target_link_libraries(signal_demo PRIVATE ${target_name}) - target_compile_options(signal_demo PRIVATE -g) + target_compile_options(signal_demo PRIVATE ${debug}) if(CPPTRACE_BUILD_TESTING_SPLIT_DWARF) target_compile_options(signal_demo PRIVATE -gsplit-dwarf) endif() @@ -53,7 +59,7 @@ if(UNIX) add_executable(signal_tracer signal_tracer.cpp) target_compile_features(signal_tracer PRIVATE cxx_std_11) target_link_libraries(signal_tracer PRIVATE ${target_name}) - target_compile_options(signal_tracer PRIVATE -g) + target_compile_options(signal_tracer PRIVATE ${debug}) endif() # primarily a workaround for github actions issue https://github.com/actions/runner-images/issues/8659 @@ -77,11 +83,12 @@ if(NOT CPPTRACE_SKIP_UNIT) unit/raw_trace.cpp unit/object_trace.cpp unit/stacktrace.cpp + unit/from_current.cpp ) target_compile_features(unittest PRIVATE cxx_std_20) target_link_libraries(unittest PRIVATE ${target_name} GTest::gtest_main GTest::gmock_main) target_compile_options(unittest PRIVATE ${warning_options} $<$>:-Wno-pedantic -Wno-attributes>) - target_compile_options(unittest PRIVATE -g) + target_compile_options(unittest PRIVATE ${debug}) if(CPPTRACE_BUILD_TESTING_SPLIT_DWARF) target_compile_options(unittest PRIVATE -gsplit-dwarf) endif()