Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site opus.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!hao!cires!nbires!opus!rcd From: rcd@opus.UUCP (Dick Dunn) Newsgroups: net.lang Subject: Re: Runtime trapping of program bugs Message-ID: <1023@opus.UUCP> Date: Wed, 16-Jan-85 23:25:51 EST Article-I.D.: opus.1023 Posted: Wed Jan 16 23:25:51 1985 Date-Received: Sat, 19-Jan-85 01:39:04 EST References: <5143@rochester.UUCP> <19@decvax.UUCP> Organization: NBI,Inc, Boulder CO Lines: 25 > Some very old Fortran compilers initialized all variables to > an "illegal" floating point constant (I think -0 was used on > the 7090) to trap the fairly common error where a variable > was read before it was initialized. The PDP-11 floating-point > format has an "illegal float" defined for just that purpose, > but I don't think it's used by any '11 language. The CDC 6x00,Cyber machines had (oops, have) an illegal form; the value is something which would be called "negative indefinite" (where "indefinite" is what you get from 0.0/0.0). It produces an exception (arithmetic error mode 4 to the cognoscenti) when used, and it will be identifiable because it's something that the floating-point unit won't generate. The value is determined by the high-order (exponent) bits so that you can play around with the lower bits. The exponent has the effect of a no-op if executed, but there's enough room in the rest of the word to tuck away an instruction which will bomb out and even get the address of the word in the bottom (so that if it gets picked up and moved about, you'll still know where it came from). We modified a CDC loader to initialize memory to this sort of pattern. After some intense complaints from a few disgruntled (and unfortunately influential) users, the initialization to bogus value was made an option so that these folks could still get initialization to 0 and keep running their programs with uninitialized-variable bugs. -- Dick Dunn {hao,ucbvax,allegra}!nbires!rcd (303)444-5710 x3086 ...A friend of the devil is a friend of mine.