As it seems from other posts, the story is not completely true;
there was indeed such an error somewhere sometime with NASA,
but the error that destroyed the Mariner spacecraft was different (a missing hyphen on a hand-written variable specification, which had not been translated correctly to computer code).

I believe that there are similar pitfalls in other languages, too, although FORTRAN is very special, because it allows spaces even in the middle of identifiers (and numbers), such as

   DO  3  I    =   1 . 10

which in every other programming language would disqualify as an assignment statement
because of the spaces around the DO symbol.

My favorite PL/1 example from a real world program is this:

   IF 9 < ZZ < 20 THEN DO; ...

someone with a math background obviously coded this :-)
the expectation was, that the statement be executed if ZZ is in the range 10 to 19.

Unfortunately, this is translated by PL/1 as follows:

   IF (9 < ZZ) < 20 THEN DO;

9 < ZZ is a result of type BIT(1) and yields '0'B or '1'B, depending on ZZ;
this result is converted to decimal, so that it can be compared to the decimal constant 20
and the result therefore is ALWAYS FALSE.

This is clearly not what the coder had intended.

We detected this luckily, using a site-written PL/1 diagnosing tool, which complained because of the implied type conversion (BIT(1) to decimal). About 2 percent of the total PL/1 code base had similar logic errors, which were undetected before we scanned all the source codes with our new tool in 2007. After that, we changed the deployment processes, so that the new tool
runs with every software deployment.

Kind regards

Bernd


Am 29.03.2022 um 17:03 schrieb David Spiegel:
Hi gil,
I remember reading the article approximately 40 years ago.
It was in Datamation, which was an IT magazine.
You've never heard of Datamation before? ... How many years have you been in this business?

The story was related to an unmanned spaceship (i.e. Venus Probe) whose trajectory was calculated by a FORTRAN program
with the following statements:
DO 3  I=1.3
.
.
3

Since there was a period between "1" and "3" (instead of a comma), the loop ran precisely once and assigned 1.3 to DO3I (FORTRAN removes blanks before compile) a variable which is automatically declared REAL, because its first letter
is outside the INTEGER Range I-N.

Here is another reference (not Datamation) (which does not mention the financial loss)
Please see:
IEEE Xplore Full-Text PDF: <https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=4392951>
Page 58

Regards,
David


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to