Results 1 to 1 of 1
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Nov 2007
Need help in catching and handling SIGSEGV signal
Need assistance regarding SIGSEGV signal handling.
I want the signal handler to catch the signal do some coding there, and return to main.
I succeeded in catching the signal SIGSEGV.
But the control does not return to main from signal handler function.
Please guide me to solve this problem.
I have written a sample code to catch the SIGSEGV signal and handle it.
My Sample Code:
int main ( )
int* ptr = (int*)0;
signal( SIGSEGV, seg);
*ptr = 1;
printf("End of main\n");
Goes on like this infinitely and control does not return to main.