To catch or not to catch

Should applications capture bad signals like SIGSEV, SIGBUS?

+3
source share
4 answers

These signals are generated in cases “should never happen” when your program is in undefined state. If you catch them, ongoing execution will be extremely problematic, as this will almost certainly cause more, possibly even more serious errors. In addition, if you do not catch them, the OS can perform functions such as creating useful diagnostic tools, such as core dumps. Therefore, I would say “no” if you do not want a core dump, and your error handling makes something very simple, for example, logging and ending.

+7
source

- , . , , . , - , .

+4

, . , . , - , SIGSEV SIGBUS.

/postmortem, , . , , .

, postmortem , SIGSEV SIGBUS .

+1

, , SIGSEGV SIGBUS: : mmaped , * ptr = x , , . - - .

0

Source: https://habr.com/ru/post/1737122/


All Articles