XL Fortran for AIX 8.1

User's Guide


Fixing Run-Time Problems

XL Fortran issues error messages during the running of a program in either of the following cases:

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

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 Options for Compatibility for a list of these options and Chapter 14, Porting Programs to XL Fortran for a general discussion of porting.

Mismatched Sizes or Types for Arguments

To detect arguments of different sizes or types, which might produce incorrect execution and results, you can compile with the -qextchk option. This option warns you of any problems at link time.

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" in the XL Fortran for AIX Language Reference.)  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" in the XL Fortran for AIX Language Reference.

If you have installed the XL Fortran run-time 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 this catalog is not installed on the system, only the message number appears. Some of the settings in Setting Run-Time 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 ksh, or through the smit command.

Tracebacks and Core Dumps

If a run-time 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.
  X = 0               ! The program continues.
END IF

See Installing an Exception Handler for instructions about exception handlers and XL Fortran Run-Time Exceptions for information about the causes of run-time exceptions.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]