I am trying to trap a segmentation fault and the old LD_PRELOAD approach has been deprecated in 2022 (https://www.marcusfolkesson.se/blog/libsegfault/)
I was reading about this new contribution sigsegv and would like to use it. However I am unable to install the library. https://lists.gnu.org/archive/html/bug-gnulib/2021-05/msg00072.html
I am running Fedora and tried sudo dnf install -y libsigsegv-dev
to no avail (thanks for nothing ChatGPT :)
Where can I find this library and how do you install it on Fedora? Thanks
There are indeed two options for easily catching SIGSEGV on Unix platforms:
Use of the Gnulib module
sigsegv
. The Gnulib documentation describes how to integrate it into the build system of your package.Use of libsigsegv as a pre-installed library.
In both cases,
#include <sigsegv.h>
in your package, and use the functionsigsegv_install_handler
and/orstackoverflow_install_handler
.