From: "Kevin G. Rhoads" <T_Rhoads@NoSpam.CLASSIC.MSN.COM>
Subject: Re: Mysterious data corruption in Fortran with -automatic
Date: 1998/06/05 [thread overview]
Message-ID: <01bd908c$0be7be40$LocalHost@stupidwin95> (raw)
In-Reply-To: 3577C554.9F50B096@nonexistant.com
>This is actually a danger sign; it is a clear sign that some
>part of memory is being incorrectly written to. Inserting the
>write statement simply changes the place that gets written to,
>but doesn't do away with the bad behaviour.
Well it can do that, BUT inserting a write can also--
-change the use-tagging for variables referenced
-can cause additional components of the run-time library to be linked in
-can shift a variable from automatically register allocated into storage
('cause it has to be passed to . . . in the RTL)
-can trigger shifts of code from local to distant (N.B. - this is
NOT just an x86 perversion, the 68k family (for example) has
16 bit offset instructions that are often used to save 2 bytes of
address and the corresponding bus-traffic delays --so that many
68k targetting compilers had 64k limits on code in a "single"
chunk, and any 32 bit machine which offers 16 bit "local"
addressing modes can have this issue)
And, in fact, for
-compilers which arrange storage so that data is before code,
-or use Harvard architecture (separate code and data address spaces)
-or use segmented addressing,
inserting a write may well NOT change where the variables
are addressed or located.
YES - Uninitialized variables can lead to all sorts of intermittent
errors. That's why many compilers have tests for this and while
such automatic testing is not perfect, it is something one should
habitually require one's code to pass.
Similarly, all variables should be declared - which Fortran standards
do not require, but many compilers offer the option to enforce.
And depending upon the persistence of an unSAVEd variable
is (in essence) another variant of the uninitialized variable. But
putting in a global SAVE (no variables specified) and trying
that variant periodically will help uncover this bug.
--
Kevin G. Rhoads, Ph.D.
T_Rhoads@NO_SPAM.Classic.MSN.COM
KRhoads@NO_SPAM.CmpNetMail.com
next prev parent reply other threads:[~1998-06-05 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 ` Thorsten Ohl
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` William Clodius
1998-06-05 4:00 ` William Clodius
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-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 ` 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 [this message]
1998-06-05 4:00 ` Robert O'Dowd
1998-06-05 4:00 ` Kevin G. Rhoads
1998-06-05 4:00 ` Stuart Brook
1998-06-05 4:00 ` Jeffrey J. Potoff
1998-06-05 4:00 ` Jeffrey J. Potoff
1998-06-05 4:00 ` Harald Anlauf
1998-06-05 4:00 ` Kevin G. Rhoads
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 ` SUMMARY: Code errors which can masquerade as compiler bugs " Kevin G. Rhoads
1998-06-11 4:00 ` 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