Chapter Contents

Previous

Next
SIGILL

SIGILL



Illegal Instruction


Default handling
Ignoring the signal
Information returned by siginfo
Notes on defining a handler
The SIGILL signal is raised when an attempt is made to execute an invalid, privileged, or ill-formed instruction. SIGILL is usually caused by a program error that overlays code with data or by a call to a function that is not linked into the program load module.


Default handling

By default, SIGILL causes program termination with an appropriate ABEND code (0C1 for an operation error, 0C2 for a privileged operation error, 0C3 for an execute error, or 0C6 for a specification error).


Ignoring the signal

The SIGILL signal cannot be ignored. If you code SIG_IGN as the second argument to signal , the call to signal is rejected.


Information returned by siginfo

If you call siginfo in a handler for SIGILL , siginfo returns a pointer to a structure of type ILL_t . This structure is defined as:

typedef struct {
   int int_code;  /* interrupt code                         */
   char *EPIE;    /* pointer to hardware program check info */
   } ILL_t;

The int_code field of this structure contains the program code indicating what type of illegal instruction occurred. Refer to "Default handling" above.

The EPIE field is a pointer to a control block containing hardware information available at the time the signal occurred. (This information includes program status word and registers.) For information on the EPIE format, see IBM publication MVS/XA Supervisor Services and Macro Instructions. (Although an EPIE is provided only by the XA versions of the MVS and CMS operating systems, one is created by the run-time library for all MVS and CMS systems.)


Notes on defining a handler

If you define a handler for SIGILL , you can call siginfo and test the int_code field of the structure (returned by a call to siginfo ) to determine what error occurred. Note that a handler for SIGILL cannot return to the point of interrupt; an attempt to do so causes the program to terminate as described in the SIGILL section, Default handling.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.