Segmentation fault handling

后端 未结 7 1363
轻奢々
轻奢々 2020-11-27 05:23

I have an application which I use to catch any segmentation fault or ctrl-c. Using the below code, I am able to catch the segmentation fault but the handler is being called

7条回答
  •  不知归路
    2020-11-27 06:00

    Looks like at least under Linux using the trick with -fnon-call-exceptions option can be the solution. It will give an ability to convert the signal to general C++ exception and handle it by general way. Look the linux3/gcc46: "-fnon-call-exceptions", which signals are trapping instructions? for example.

提交回复
热议问题