Windows Default Exception Handling

The VisualAge C++ library provides a default exception handling function, _Exception. This function is the C language exception handler. By default, _Exception is registered automatically for every process or thread launched by functions provided by VisualAge C++. The default handler maps recognized Windows exceptions to C signals, which are then passed by the run-time library to the appropriate signal handlers.

The table below shows which types of Windows exceptions are recognized by _Exception, the names of the exceptions, and the C signals to which each exception type is mapped. These are the only Windows exceptions handled by _Exception. The table also shows whether the program can continue if the corresponding signal handler is SIG_IGN or if a user-defined signal handler returns. A No means that the program terminates unless the signal has a handler that calls longjmp to jump to transfer control.

If the signal handler value is set to SIG_DFL, the default action taken for each of these exceptions is to terminate the program with an exit code of 99.

Windows Exception C Signal Continuable?
Divide by zero

EXCEPTION_INT_DIVIDE_BY_ZERO

SIGFPE No
NPX387 error

EXCEPTION_FLOAT_DENORMAL_OPERAND

EXCEPTION_FLT_DIVIDE_BY_ZERO

EXCEPTION_FLT_INEXACT_RESULT

EXCEPTION_FLT_INVALID_OPERATION

EXCEPTION_FLT_OVERFLOW

EXCEPTION_FLT_STACK_CHECK

EXCEPTION_FLT_UNDERFLOW

SIGFPE No; except for EXCEPTION_FLT-
_INEXACT_RESULT
Overflow occurred

EXCEPTION_INT_OVERFLOW

This exception is never caused by code generated by VisualAge C++.

SIGFPE Yes; resets the overflow flag
Bound opcode failed

EXCEPTION_ARRAY_BOUNDS_EXCEEDED

This exception is never caused by code generated by VisualAge C++.

SIGFPE No
Opcode not valid

EXCEPTION_ILLEGAL_INSTRUCTION

EXCEPTION_PRIVILEGED_INSTRUCTION

SIGILL No
General Protection fault

EXCEPTION_ACCESS_VIOLATION

EXCEPTION_DATATYPE_MISALIGNMENT

SIGSEGV No
Ctrl-Break

CTRL_BREAK_EVENT

SIGBREAK Yes
Ctrl-C

CTRL_C_EVENT

SIGINT Yes
End process

CTRL_CLOSE_EVENT

SIGTERM Yes


Signal and Exception Handling
Signal and Exception Handlers in DLLs


Handle Floating-Point Exceptions
Write or Register an Exception Handler


Asynchronous Exceptions
Exception Handlers in Multithreaded Programs
Default Signal Handlers