Re: Strange error msg.

From: Dick Hendrickson (
Date: 12/07/04

Date: Tue, 07 Dec 2004 17:10:36 GMT

Squirrel wrote:
> I am maintaining a Fortran program of ~ 10000 lines of code which _used_
> to behave friendly. Now, the program randomly crashes with the following
> message:
> jwe0020i-u An error was detected during an abnormal termination process.
> The behaviour is not exactly reproducable, sometimes a simple restart of
> the program doesn't end up in an error.
The causes of all unreproducable errors are usually an
array subscript error, an argument mismatch, or failure
to initialize variables before using them.

Turn on as many compiler checking options as you can find.
All good compilers have an array subscript bounds check

Most compilers have a way to force checking of argument
lists for agreement. It's easy to leave out an argument
or get them out of order if there's a ton of them in a call.
Also, it's common to mix up type, where you pass a double
to a single precision argument, or vice versa (especially
easy to do with constants--pass 1.0 to a subroutine that
expects a double precision argument). It's a darn good
idea(tm) to put your subroutines in modules, ala F90,
if you have the time to do it. This essentially forces
the compiler to make a slew of compile time error checks.

Many compilers have an option to check for unitialized
variables at compile time or (better) at run time.
Remember, Fortran doesn't preset memory to zero before
a program starts. At the least, put in IMPLICIT NONE
statements into each routine, that will at least catch
spelling errors, like typing l1l1l10O when you meant
l1ll110O ;) .

Dick Hendrickson

> Has anybody got an idea, where to start searching for a coding error?
> Compiler: Lahey LF59, 5.6h
> OS: Windows XPProfessional, SP2

Relevant Pages

  • Re: Comparision of C Sharp and C performance
    ...     double dif; ... compile time with runtime operations. ... you assume that all C compilers will do the constant division ... you don't evaluate an invariant in a for loop IF the preprocessor ...
  • How does the intrinsic present work?
    ... I was wondering how the intrinsic inquiry function "present" is implemented ... in present compilers... ... If it is evaluated at compile time and if a subroutine with optional ...
  • Illegal internal write?
    ... as that term is used in those Fortran standards? ... END PROGRAM testnoforall ... Five f95 compilers that I tried accepted the program at compile time. ...
  • Breakem good and hard...
    ... will fail in as many different C compilers as possible, ... time or compile time. ...
  • Re: Another C# critique (major rewrite!)
    ... >> In the case of a const implementation I'd prefer compile time ... >> validation for all languages though. ... > familiarize myself with compilers. ...