Is there a point to trapping “segfault”?

后端 未结 6 1706
时光说笑
时光说笑 2021-01-03 04:03

I know that, given enough context, one could hope to use constructively (i.e. recover) from a segfault condition.

But, is the effort worth it? If yes, in w

6条回答
  •  春和景丽
    2021-01-03 04:21

    No. I think it is a waste of time - a seg fault indicates there is something wrong in your code, and you will be better advised to find this by examining a core dump and/or your source code. The one time I tried trapping a seg fault lead me off into a hall of mirrors which I could have avoided by simply thinking about the source code. Never again.

提交回复
热议问题