Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: "Kevin G. Rhoads" <T_Rhoads@NoSpam.CLASSIC.MSN.COM>
Subject: SUMMARY: Code errors which can masquerade as compiler bugs  Re: Mysterious data corruption in Fortran with -automatic
Date: 1998/06/06	[thread overview]
Message-ID: <01bd91bc$ac64ac80$LocalHost@stupidwin95> (raw)
In-Reply-To: wxsollf8zz.fsf@earth.ox.ac.uk


Summary:

Compiler bugs are real, but should be one of the
*last*
things to check.

Most language specific comments were directed to Fortran and C.


Programmer errors which

a) manifest or disappear depending upon compiler, settings, machine, data
b) can be misinterpreted as compiler bugs

include:

1) Uninitialized variables
2) Aliasing - can occur in any language by passing the same 
variable by reference to two or more parameters in the 
argument list of a function or subroutine -- in addition to 
the more commonly noted pointer aliasing -- in Fortran, 
we can add passing a variable by reference to a parameter 
when it is accessed by COMMON block as well
3) assumptions about persistence/lifetime -- particularly local variables: 
are they static or automatic -- in Fortran use SAVE as needed
4) assumptions about precedence and execution order in 
expressions -- in Fortran use parentheses (in C add also the 
comma operator) -- and C programmers working in other 
languages particularly beware that other languages DO 
NOT guarantee short-circuit evaluation nor strict 
left-to-right evaluation of Boolean/Logical expressions as does
the C standard
5) assumptions about memory layout (e.g., byte order), 
machine level format of types (e.g., ones-complement, 
twos-complement or sign-magnitude) and packing -- 
these assumptions also make code non-portable and are 
not limited to memory, Fortran unformatted files are 
another place to check for this
6) incorrect subroutine/function calls
   i) mismatched arguments - wrong size or type 
      (e.g., passing a 4 byte integer to a parameter expecting 
       a two byte integer will work on Intel boxes and blow up
       on any big-endian machine)
   ii) incorrect number of arguments (C, many other languages 
       will crash obviously)
7) array bounds overruns
8) string length overruns
9) insufficient stack

---------------------------------------
SPECULATION:
I also note that the respondents *seemed* to divide into two camps:
one group felt compiler bugs were real, but quite rare
another group seemed to feel compiler bugs were not uncommon

Perhaps this reflects platforms: workstation vs. wintel
Perhaps this is just randomness, a reflection of the small number of total
respondents.

Investigating this seems destined to create more flame than
aught else.
If someone with an asbestos beany-copter wishes to ask 
this question, go right ahead.

I am not touching it.
-- 
Kevin G. Rhoads, Ph.D.
T_Rhoads@NO_SPAM.Classic.MSN.COM
KRhoads@NO_SPAM.CmpNetMail.com



  parent reply	other threads:[~1998-06-06  4:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-04  4:00 Mysterious data corruption in Fortran with -automatic Keith Refson - real email address in signature
1998-06-04  4:00 ` Thorsten Ohl
1998-06-04  4:00 ` Kevin G. Rhoads
1998-06-04  4:00   ` Jeffrey J. Potoff
1998-06-04  4:00     ` Kevin G. Rhoads
1998-06-05  4:00       ` Ian Pattie
1998-06-05  4:00         ` Jeffrey J. Potoff
1998-06-05  4:00           ` Kevin G. Rhoads
1998-06-06  4:00           ` Rob Komar
1998-06-05  4:00       ` Ian Chivers
1998-06-05  4:00         ` Kevin G. Rhoads
1998-06-05  4:00       ` William Clodius
1998-06-05  4:00       ` Thorsten Ohl
1998-06-05  4:00         ` Kevin G. Rhoads
1998-06-05  4:00           ` William Clodius
1998-06-04  4:00     ` Kevin G. Rhoads
1998-06-05  4:00       ` Catherine Rees Lay
1998-06-04  4:00     ` Kevin G. Rhoads
1998-06-05  4:00       ` Harald Anlauf
1998-06-05  4:00         ` Kevin G. Rhoads
1998-06-05  4:00       ` Keith Refson - real email address in signature
1998-06-05  4:00         ` Kevin G. Rhoads
1998-06-05  4:00         ` Robert O'Dowd
1998-06-05  4:00           ` John Appleyard
1998-06-05  4:00             ` Keith Refson - real email address in signature
1998-06-05  4:00           ` Kevin G. Rhoads
1998-06-05  4:00       ` Robert O'Dowd
1998-06-05  4:00         ` Kevin G. Rhoads
1998-06-05  4:00           ` Jeffrey J. Potoff
1998-06-05  4:00           ` Stuart Brook
1998-06-05  4:00       ` Jeffrey J. Potoff
1998-06-08  4:00       ` Paul Winalski
1998-06-04  4:00     ` Stuart Brook
1998-06-04  4:00       ` Kevin G. Rhoads
1998-06-05  4:00         ` Stuart Brook
1998-06-05  4:00       ` Toon Moene
1998-06-06  4:00 ` Kevin G. Rhoads [this message]
1998-06-11  4:00   ` SUMMARY: Code errors which can masquerade as compiler bugs " Ron Sverdlove x2517
1998-06-08  4:00 ` Steve Lionel
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox