Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

User-specific error handling (Unix and Linux systems)

On Unix and Linux systems, you can program a user-specific error handling, for example to allow a service to be continued even if there are serious errors or to enable additional diagnostic documents to be created.

The following functions are available:

  • KCX_REG_USER_SIGNAL_HANDLER

    Registration of the user signal routine that is called when a signal occurs. The signal routine must also be created. If you register multiple signal routines, the last registered routine is always called.

    Registration of the user signal routine in a utmwork process is effective until the process is terminated, provided it is not explicitly deregistered prior to this.

  • KCX_UN_REG_USER_SIGNAL_HANDLER

    Deregistration of the user signal routine if the user signal routine had previously been registered. This routine should be called immediately before the PEND.

  • KCX_SET_RELOAD_FLAG

    Exchanging the utmwork process after PEND RE.

    Calling this function initiates exchange of the utmwork process when the current program unit run is terminated with PEND RE.

    We recommend always calling this function for Cobol runtime errors in the UTM application to eliminate the delayed effects of this error, i.e. to ensure the application is capable of running continuously.

    For all other PEND calls (except for PEND ER), the utmwork process is not replaced.
  • KCX_WRITE_DUMP

    Creates a UTM dump.

    This function enables an application program to write a UTM dump for a reason defined by the user without the service being aborted. UTM outputs the ROOT area and the stack information (as for the PEND ER dump) and creates a memory dump (core dump).

Information on how to program these functions can be found on "Programming user-specific error handling (Unix and Linux systems)" (C/C++) and "Programming user-specific error handling (Unix and Linux systems)" (COBOL).

User signal routine

The user signal routine is executed by openUTM instead of the default error handling when a signal occurs in the application program. The user signal routine is called under the following conditions:

  • When the signals SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGPWR and SIGABRT occur in the application program.

  • With SIGALRM after expiry of the program runtime timer in the application program.

The use of a user signal routine enables:

  • Program errors to be handled within the UTM service.

  • Specific error messages to be output to the UPIC client.

  • The UTM service to be continued despite errors in the application program.

The user signal routine replaces the default error handling in openUTM, i.e. abnormal service termination with PENDER / XTnn (nn = signal number), output of K017 to terminal clients, for UPIC clients in UPIC log file (+ error code "CM_DEALLOCATED_ABEND"), PEND ER dump, and exchange of the utmwork process.

The user signal routine should only initiate “clear-up actions” and then terminate the program with PEND RE. Typical “clear-up actions” in a dialog program include the following KDCS calls:

  • RSET to reset the transaction data,

  • MPUT NE with appropriate error message to the client,

  • PEND RE to specify the follow-up program that will run after this error situation.

The last registered signal routine is always called.

In addition, UTM replaces the affected utmwork process after the next PEND RE KDCS call.

An example can be found on "Programming user-specific error handling (Unix and Linux systems)" (C program) or "Programming user-specific error handling (Unix and Linux systems)" (COBOL program).

Please note that no timer functions such as the C library function alarm() may be used in the application program, at least not if a timer has been generated for the current TAC (KDCDEF generation TAC RTIME= <rtime>).