When the active exception handler is called after a program check
or ABEND, it receives a pointer to the CIB (Condition Information
Block) for the error. It can examine the CIB and associated MCH (Machine
Check Handler record) to determine what the error is. The handler
can fix up whatever is required or take dumps, etc. When it is finished,
the only valid things it can do are:
- Long jump back to some earlier pre-defined recovery point (any
of the several longjump-type functions may be used -- longjmp(), _longjmp(),
siglongjmp(), setcontext(), or C++ throw.)
- Issue exit() or _exit()
- Issue pthread_exit()
- Issue __cabend(), abort(), etc
What it cannot do is return. If it returns, the system will
automatically do pthread_exit(-1) if POSIX(ON) is in effect, or exit(-1)
if not.
When the active exception handler is given control, the handler
is suspended, along with all other handlers already registered. This
means that any future program checks/ABENDs will cause the usual signal
processing to occur. The active handler is re-enabled once it longjumps
back. If it exits or returns, it is not re-activated, and termination
starts with no active exception handler. If an exception handler
needs exception handling recovery for its own program checks or ABENDs,
it must register its own exception handler. As usual, this new handler
will become active, and will get control for any program checks/ABENDs
occurring in the outer exception handler or any routines it calls.