In fact, I have been wondering about the very same issue. Indeed, it
seems to be possible to catch SIGSEGV in userspace, there even is a
library for this
http://libsigsegv.sourceforge.net/
I have never used it myself, but it would certainly be interesting to
hear about any experience you might make.
It is often argued that after a segfault the memory may be corrupt any
you can't trust anything. True - after a fatal error, it is advisable to
quit the program as soon as possible. However, in most cases, it should
be possible to display a meaningful message, blame the most likely
villain or maybe even try an emergency save.
On 15.10.2011 14:18, Gor Gyolchanyan wrote:
Thanks for the detailed answer.
Example of when i would like to recover from a segfault:
I have different independent parts of an app, which MAY cooperate. If,
however, one of them crashes (e.g. they come from different sources)
the other one will continue to work but without the cooperation
functionality.