Skip to content

feat: add cpptrace for better stack traces output#347

Draft
kdrienCG wants to merge 2 commits intomasterfrom
feature/kdrienCG/cpptrace
Draft

feat: add cpptrace for better stack traces output#347
kdrienCG wants to merge 2 commits intomasterfrom
feature/kdrienCG/cpptrace

Conversation

@kdrienCG
Copy link
Copy Markdown

@kdrienCG kdrienCG commented Apr 14, 2026

This PR adds cpptrace as a new third party library to have more powerful stack traces outputs from thrown exceptions in GEOS.

The main benefit of this library is the output of the complete unwinding, even in STL, of errors (addressed partially with <stacktrace> from C++23)

Both methods, with uberenv/Spack and the older scripts/config-build.py, are supported.

On top of that, an option has been added to select the desired backend used by cpptrace to gather symbols (between libdwarf, libbacktrace and addr2line).

Via uberenv/Spack:

./scripts/uberenv/uberenv.py --spec "+cpptrace ^cpptrace symbols=libdwarf" ... # or libbacktrace, or addr2line

Via scripts/config-build.py:
as a command-line argument:

python scripts/config-build.py \
	-hc ../GEOS/host-configs/your-platform.cmake \
	-bt Release \
	-DENABLE_CPPTRACE=ON \
	-DCPPTRACE_SYMBOLS_BACKEND=libbacktrace # or without this line to use the default backend

or directly in the host-config:

set(ENABLE_CPPTRACE          ON           CACHE BOOL   "")
set(CPPTRACE_SYMBOLS_BACKEND libbacktrace CACHE STRING "") # or without this line to use the default backend

More info on symbols backends: https://github.com/jeremy-rifkin/cpptrace#library-back-ends

@kdrienCG kdrienCG self-assigned this Apr 14, 2026
@kdrienCG kdrienCG added enhancement New feature or request dependencies Pull requests that update a dependency file labels Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant