After you get a SIGSEGV, you are screwed. You can probably recover if you
do a lot of work, but overall it's not worth it. Also in a signal handler
you are not guaranteed malloc() will work, the kernel may not allow you to
allocate more memory. Also your signal handler for SIGSEGV will keep
getting called because the SIGSEGV keeps coming until the program exits.
Note that you are not recommended to use functions such as printf() in a
signal handler (see:
https://www.securecoding.cert.org/confluence/display/seccode/SIG30-C.+Call+only+asynchronous-safe+functions+within+signal+handlers).

It might be worth looking into things like libsigsegv:
http://libsigsegv.sourceforge.net/

I hope this can help!
_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to