Fixing runtime problems

XL Fortran issues error messages during the running of a program in either of the following cases:
  • XL Fortran detects an input/output error. Setting runtime options explains how to control these kinds of messages.
  • XL Fortran detects an exception error, and the default exception handler is installed (through the -qsigtrap option or a call to SIGNAL). To get a more descriptive message than Core dumped, you may need to run the program from within gdb.

    The causes for runtime exceptions are listed in XL Fortran runtime exceptions.

You can investigate errors that occur during the execution of a program by using a symbolic debugger, such as gdb.

Duplicating extensions from other systems

Some ported programs may not run correctly if they rely on extensions that are found on other systems. XL Fortran supports many such extensions, but you need to turn on compiler options to use some of them. See Portability and migration for a list of these options and Porting programs to XL Fortran for a general discussion of porting.

Mismatched sizes or types for arguments

Arguments of different sizes or types might produce incorrect execution and results. To do the type-checking during the early stages of compilation, specify interface blocks for the procedures that are called within a program.

Working around problems when optimizing

If you find that a program produces incorrect results when it is optimized and if you can isolate the problem to a particular variable, you might be able to work around the problem temporarily by declaring the variable as VOLATILE. This prevents some optimizations that affect the variable. (See VOLATILE.)  Because this is only a temporary solution, you should continue debugging your code until you resolve your problem, and then remove the VOLATILE keyword. If you are confident that the source code and program design are correct and you continue to have problems, contact your support organization to help resolve the problem.

Input/Output errors

If the error detected is an input/output error and you have specified IOSTAT on the input/output statement in error, the IOSTAT variable is assigned a value according to Conditions and IOSTAT values.

If you have installed the XL Fortran runtime message catalog on the system on which the program is executing, a message number and message text are issued to the terminal (standard error) for certain I/O errors. If you have specified IOMSG on the input/output statement, the IOMSG variable is assigned the error message text if an error is detected, or the content of IOMSG variable is not changed. If this catalog is not installed on the system, only the message number appears. Some of the settings in Setting runtime options allow you to turn some of these error messages on and off.

If a program fails while writing a large data file, you may need to increase the maximum file size limit for your user ID. You can do this through a shell command, such as ulimit in bash.

Tracebacks and core dumps

If a runtime exception occurs and an appropriate exception handler is installed, a message and a traceback listing are displayed. Depending on the handler, a core file might be produced as well. You can then use a debugger to examine the location of the exception.

To produce a traceback listing without ending the program, call the xl__trbk procedure:
IF (X .GT. Y) THEN    ! X > Y indicates that something is wrong.
  PRINT *, 'Error - X should not be greater than Y'
  CALL XL__TRBK       ! Generate a traceback listing.
END IF

See Installing an exception handler for instructions about exception handlers and XL Fortran runtime exceptions for information about the causes of runtime exceptions.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us