Throwing an exception from within a signal handler

后端 未结 7 1979
半阙折子戏
半阙折子戏 2020-11-30 03:56

We have a library that deals with many aspects of error reporting. I have been tasked to port this library to Linux. When running though my little test suite, one of the

7条回答
  •  野性不改
    2020-11-30 04:41

    Throwing out of a signal handler is probably not a good idea as the stack is not necessairly set up in the same way as for function calls thus unwinding from a signal handler may not work as expected.

    Important note must be taken for any register used by the C++ ABI that are saved and re-used by the signal handling mechanism.

提交回复
热议问题