Quote Originally Posted by jacek View Post
In theory yes, but not in practice. You intercept SIGSEGV and then what?
It depends what happened and what your app does.

All you can do is to do some cleanup/logging and exit.
True, but sometimes it's all you need. Flushing all unsaved data might be crucial.

You won't know why the signal was sent.
Yes, but sometimes you can deduce that information if you know your app tends to crash in a specific part of the code. Ability to intercept the signal might save your butt sometimes.

You can't be sure if your data is still intact and even whether the stack is valid.
If all you need is to clean up (and you shouldn't try to do anything more), the stack doesn't have to be valid - you'll be pushing to the stack, not popping from it.