Is it possible to recover from SEGV?

Yuri yuri at rawbw.com
Sun Oct 12 00:41:11 UTC 2008


Let's say I have signal(3) handler set.
And I know exactly what instruction caused SEGV and why.

Is there a way to access from signal handler CPU registers as they
were before signal, modify some of them, clear the signal and
continue from the instruction that caused SEGV initially?

I see that if signal handler doesn't terminate the process signal is being
generated again and again. I understand it the way that the faulty
instruction is being rerun if signal handler didn't terminate the process.
rusage.ru_nsignals is also being incremented every time signal handler
is being called.

Yuri

PS: Of course I understand why SEGVs happen in general. I am trying to
understand if it's possible to use SEGV beyond the way it's commonly used.



More information about the freebsd-hackers mailing list