Scenario 1: Simple condition handling

Refer to Figure 1 throughout the following discussion.

Figure 1. Scenario 1: Division by zero with no user condition handlers present
The divide-by-zero exception occurs in Routine B. There are no condition handlers.

In this scenario, no C/C++ handlers created by a call to signal(), PL/I ON-units, or user-written condition handlers registered using the CEEHDLR service are established at any stack frame in the application.

  1. A divide-by-zero exception occurs in routine B.
  2. The divide-by-zero exception is enabled by the language of the stack frame in which it occurred because it is a problem that, if it remains unhandled, causes termination.
  3. The following occurs in the condition step:
    • If any user-written condition handlers have been registered using the CEEHDLR callable service on the routine B's stack frame, they are given control. No handlers have been registered, so the condition is percolated.
    • If a C/C++ signal handler is registered, or if a PL/I ON-unit is established on the stack frame, it is given control. Neither one exists on routine B's stack frame, so the condition is percolated.
    • If any user-written condition handlers have been registered using CEEHDLR on routine A's stack frame, they are given control. No handlers have been registered, so the condition is percolated.
    • If a C/C++ signal handler is registered or if a PL/I ON-unit is established on routine A's stack frame, it is given control. No C/C++ signal handler or PL/I ON-unit has been established for the stack frame, so the condition is percolated.
    • After the oldest stack frame (in this case, that for routine A) has been checked, HLL and Language Environment default actions occur. Assume that the HLL percolates the condition to Language Environment.

      Language Environment examines the severity of the unhandled divide-by-zero condition (severity 3), promotes the condition to T_I_U, and requests that the stack be redriven. This is the end of the condition step and the beginning of the termination imminent step.

  4. The following occurs during the termination imminent step:
    • The stack frame for routine B is revisited, and if a user-written condition handler is present, it is given control. No handlers are registered, so T_I_U is percolated.
    • If a C/C++ signal handler or PL/I ON-unit can respond to the T_I_U condition, it is given control. In this case, there are none, so the condition is percolated.
    • The stack frame for routine A is revisited, and checked for user-written condition handlers registered for the T_I_U condition, C/C++ signal handlers or PL/I ON-units. No handlers are registered, so T_I_U is percolated.
    • Language Environment takes the default action for the unhandled T_I_U condition, which terminates the enclave.