🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #13014

Re: catering to bad code

#13014
From: firth
Date: Thu, 19 Feb 1987 20:51
36 lines
2107 bytes
In article <14833@amdcad.UUCP> phil@amdcad.UUCP (Phil Ngai) writes:
>In a Unix system I am designing, I am considering catering to bad
>code. That is, like the VAX I propose to make location 0 contain a
>readable 0. I think that code which gets ported to a Sun machine often
>has to have this kind of thing cleaned up. 
>
>What do people think of this? Is it kind of disgusting?

On the VAX-11 under VMS, the bottom 512 bytes of the program virtual
address space is mapped out, and trying to access it crashes your
code.

When I ported systems code to the Vax, this was the SINGLE MOST USEFUL
THING ON THE MACHINE.  I simply could not believe how many old and
trusted programs were in fact wrong, and finally broke.  All those
places where the code looked at p->next before checking for p==NULL.

Tricky code is one thing.  But, in my opinion, for truly "bad" code,
ie code that explicitly violates the semantics of the language
standard, the best remedy is to crash it disgustingly as hard and as
soon as possible.  Then it gets fixed.

>Just how much code has this problem? Did every program you ported to a
>Sun have to be fixed, or 10%, or something in between? 

Too much (again in my opinion), and partly because too many implementors
are "kind" to bad code.

> Phil Ngai +1 408 982 7840
> UUCP: {ucbvax,decwrl,hplabs,allegra}!amdcad!phil
> ARPA: amdcad!phil@decwrl.dec.com

But please remember that this is just the eccentric and intolerant 
opinion of

Robert Firth
Technical Details
Message-ID: <554@aw.sei.cmu.edu.sei.cmu.edu>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!seismo!rochester!pt.cs.cmu.edu!sei.cmu.edu!firth
References: <14833@amdcad.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!rutgers!seismo!rochester!pt.cs.cmu.edu!sei.cmu.edu!firth
From: firth@sei.cmu.edu.UUCP
Newsgroups: comp.arch
Subject: Re: catering to bad code
Message-ID: <554@aw.sei.cmu.edu.sei.cmu.edu>
Date: Thu, 19-Feb-87 15:51:37 EST
Article-I.D.: aw.554
Posted: Thu Feb 19 15:51:37 1987
Date-Received: Fri, 20-Feb-87 21:32:16 EST
References: <14833@amdcad.UUCP>
Sender: netnews@sei.cmu.edu
Reply-To: firth@bd.sei.cmu.edu.UUCP (PUT YOUR NAME HERE)
Organization: Carnegie-Mellon University, SEI, Pgh, Pa
Lines: 36