Is here any C library with a function like install_default_signal_handlers()
which will install some default signal handler for SIGSEGV and related signals, where the signal handler will print a backtrace?
The signal handler, and also the installation of the signal handler should be provided by the library.
I think backward-cpp does it for C++ with backward::SignalHandling sh;
.
There is also Google Breakpad but this might be overkill.
There is libSegFault which seems to do that but it only seems to be available on some Unixes (part of GlibC, and there is a FreeBSD implementation), not on MacOSX.
Some related discussion is here but this discusses mostly the code to print the backtrace but I search for a library which provides the signal handler for me.