I wrote a segmentation fault handler but the problem is, the instruction at which the fault is happening is restarted after going to the handler, and this causes the handler to go to infinite loop.
I want the handler to work such that after reaching the handler, the instruction following the faulty instruction should be executed such that it does not go to infinite loop. Can anyone please help me with some code snippet?
I am using C and Linux.
I have figured out an alternate and perhaps easier way to write a segmentation fault handler. Although user78863 answer and effort is praiseworthy, but seeing the complexity of code and difficult in porting, i think my solution is better. So i will accept my answer.
Here is the link to the code: Can we reset sigsetjmp to return "0" again (Reset sigsetjmp)?