0

I'm trying to make an application that handles crashes on its own. I was able to find out how to handle SIGSEGV (How to generate a stacktrace when my gcc C++ app crashes) - but it seems like the OpenCV error handler comes into action whenever something goes wrong.

This causes my custom signal handler to never execute. Any hints on how to get this working?

Community
  • 1
  • 1
Utkarsh Sinha
  • 3,295
  • 4
  • 30
  • 46

1 Answers1

1

Edit: this solution works on linux only

It is possible to replace an action. But using the signal function won't do the job.

You have to use sigaction to replace the previous signal handler. Take a look: http://man7.org/linux/man-pages/man2/sigaction.2.html

MasterID
  • 1,510
  • 1
  • 11
  • 15