...
The effects of std::terminate()
are to call the terminate_handler
function in effect immediately after evaluating the throw-expression. The default terminate_handler
calls std::abort()
, which has the effect of causing abnormal process termination to occur. Abnormal process termination is the typical vector for denial of service attacks. A user-defined terminate_handler
may be set by calling std::set_terminate()
. In either case, std::terminate()
must not return. Attempting to return from a user-defined terminate_handler
or from a SIGABRT
handler invoked as a result of calling std::abort()
leads to undefined behavior.
Consequently, programs should take steps to prevent std::terminate()
from being invoked for at least two reasons:
...