The operating system defines a class of error conditions called exceptions, and specifies the default actions that are taken when these exceptions occur. The system default action in most cases is to terminate the thread that caused the exception.
Exception values have the following 32-bit format:
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 ┌───┬─┬─────────────────────────┬───────────────────────────────┐ │Sev│C│ Facility │ Code │ └───┴─┴─────────────────────────┴───────────────────────────────┘
Sev
00
Exceptions that are specific to OS/2 Version 2.X (for example, XCPT_SIGNAL) have a facility code of 1.
System exceptions include both synchronous and asynchronous exceptions. Synchronous exceptions are caused by events that are internal to a thread's execution. For example, synchronous exceptions could be caused by invalid parameters, or by a thread's request to end its own execution.
Asynchronous exceptions are caused by events that are external to a thread's execution. For example, an asynchronous exception can be caused by a user's entering a Ctrl+C or Ctrl+Break key sequence, or by a process' issuing DosKillProcess to end the execution of another process.
The Ctrl+Break and Ctrl+C exceptions are also known as signals, or as signal exceptions.
The following tables show the symbolic names of system exceptions, their numerical values, and related information fields.
Portable, Non-Fatal, Software-Generated Exceptions
┌─────────────────────────────────────┬──────────┐│Exception Name │Value │ ├─────────────────────────────────────┼──────────┤ │XCPT_GUARD_PAGE_VIOLATION │0x80000001│ │ ExceptionInfo[0] - R/W flag │ │ │ ExceptionInfo[1] - FaultAddr │ │ ├─────────────────────────────────────┼──────────┤ │XCPT_UNABLE_TO_GROW_STACK │0x80010001│ └─────────────────────────────────────┴──────────┘
Portable, Fatal, Hardware-Generated Exceptions
┌─────────────────────────────────────┬──────────┬─────────────┐ │Exception Name │Value │Related Trap │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_ACCESS_VIOLATION │0xC0000005│0x09, 0x0B, │ │ ExceptionInfo[0] - Flags │ │0x0C, 0x0D, │ │ XCPT_UNKNOWN_ACCESS 0x0 │ │0x0E │ │ XCPT_READ_ACCESS 0x1 │ │ │ │ XCPT_WRITE_ACCESS 0x2 │ │ │ │ XCPT_EXECUTE_ACCESS 0x4 │ │ │ │ XCPT_SPACE_ACCESS 0x8 │ │ │ │ XCPT_LIMIT_ACCESS 0x10 │ │ │ │ ExceptionInfo[1] - FaultAddr │ │ │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_INTEGER_DIVIDE_BY_ZERO │0xC000009B│0 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_FLOAT_DIVIDE_BY_ZERO │0xC0000095│0x10 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_FLOAT_INVALID_OPERATION │0xC0000097│0x10 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_ILLEGAL_INSTRUCTION │0xC000001C│0x06 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_PRIVILEGED_INSTRUCTION │0xC000009D│0x0D │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_INTEGER_OVERFLOW │0xC000009C│0x04 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_FLOAT_OVERFLOW │0xC0000098│0x10 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_FLOAT_UNDERFLOW │0xC000009A│0x10 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_FLOAT_DENORMAL_OPERAND │0xC0000094│0x10 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_FLOAT_INEXACT_RESULT │0xC0000096│0x10 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_FLOAT_STACK_CHECK │0xC0000099│0x10 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_DATATYPE_MISALIGNMENT │0xC000009E│0x11 │ │ ExceptionInfo[0] - R/W flag │ │ │ │ ExceptionInfo[1] - Alignment │ │ │ │ ExceptionInfo[2] - FaultAddr │ │ │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_BREAKPOINT │0xC000009F│0x03 │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_SINGLE_STEP │0xC00000A0│0x01 │ └─────────────────────────────────────┴──────────┴─────────────┘
Portable, Fatal, Software-Generated Exceptions
┌─────────────────────────────────────┬──────────┬─────────────┐ │Exception Name │Value │Related Trap │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_IN_PAGE_ERROR │0xC0000006│0x0E │ │ ExceptionInfo[0] - FaultAddr │ │ │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_PROCESS_TERMINATE │0xC0010001│ │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_ASYNC_PROCESS_TERMINATE │0xC0010002│ │ │ ExceptionInfo[0] - TID of │ │ │ │ terminating thread │ │ │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_NONCONTINUABLE_EXCEPTION │0xC0000024│ │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_INVALID_DISPOSITION │0xC0000025│ │ └─────────────────────────────────────┴──────────┴─────────────┘
Non-Portable, Fatal Exceptions
┌─────────────────────────────────────┬──────────┬─────────────┐ │Exception Name │Value │Related Trap │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_INVALID_LOCK_SEQUENCE │0xC000001D│ │ ├─────────────────────────────────────┼──────────┼─────────────┤ │XCPT_ARRAY_BOUNDS_EXCEEDED │0xC0000093│0x05 │ └─────────────────────────────────────┴──────────┴─────────────┘
Unwind Operation Exceptions
┌─────────────────────────────────────┬──────────┐ │Exception Name │Value │ ├─────────────────────────────────────┼──────────┤ │XCPT_UNWIND │0xC0000026│ ├─────────────────────────────────────┼──────────┤ │XCPT_BAD_STACK │0xC0000027│ ├─────────────────────────────────────┼──────────┤ │XCPT_INVALID_UNWIND_TARGET │0xC0000028│ └─────────────────────────────────────┴──────────┘
Fatal Signal Exceptions
┌─────────────────────────────────────┬──────────┐ │Exception Name │Value │ ├─────────────────────────────────────┼──────────┤ │XCPT_SIGNAL │0xC0010003│ │ ExceptionInfo[ 0 ] - Signal │ │ │ Number │ │ └─────────────────────────────────────┴──────────┘