0

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

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
Bryon
  • 939
  • 13
  • 25

1 Answers1

0

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 function sigsegv_install_handler and/or stackoverflow_install_handler.

Bruno Haible
  • 1,203
  • 8
  • 8
  • Hi Bruno. Thank you for taking the time to help me. I did look in that documentation that you referenced. Then (and just now when I looked again) I found no reference for sigsegv except in the discussion about signal.h. Am I missing something? Also - what is the way to install it on Fedora (which was the question)? – Bryon May 21 '23 at 07:58
  • Not every Gnulib module has HTML-formatted documentation. For the sigsegv module, you need to look in the sigsegv.in.h file, to understand how to use the module. – Bruno Haible May 21 '23 at 11:14
  • Thanks @bruno. Now I know where to look. So your answer is partially correct as it is not documented anywhere I can find (not even in the PDF version). But I have enough to start experimenting. Thanks again – Bryon May 22 '23 at 03:45