comp.lang.ada
 help / color / mirror / Atom feed
* problems/risks due to programming language, stories requested
@ 1990-02-20 22:28 Gerald Baumgartner
  1990-02-21 16:49 ` Richard A Hammond
                   ` (3 more replies)
  0 siblings, 4 replies; 66+ messages in thread
From: Gerald Baumgartner @ 1990-02-20 22:28 UTC (permalink / raw)



For a research project I am collecting information about the risk of
choosing the wrong programming language. In particular I am looking
for problems that could have been avoided if another (a better)
programming language would have been used.

I know of these three such stories:

     1.	There is the famous story that a Mariner probe got lost
	because of the Fortran statement `DO 3 I = 1.3' (1.3 instead
	of 1,3) (see Peter Neumann: A Few Old War Stories Reappear.
	ACM SIGSOFT 11(5), Oct. 1986, pp. 16-18). It is a nice story
	but, as far as I know, NASA used Jovial at that time and not
	Fortran.

     2. One of the security holes the Internet Worm took advantage of
	was in fingerd (the finger deamon). The deamon uses the gets
	routine for input. This routine, written in C, reads input
	without checking for bounds on the buffer involved. By
	overrunning the buffer, the worm rewrote the stack frame (see
	Eugene H. Spafford: Crisis and Aftermath. Communications of
	the ACM 32(6), June 1989).

	There would be no security hole in the finger daemon if a
	programming language would have been used for the I/O
	routines, where the compiler takes care of boundary checks for
	arrays. Pascal doesn't work since variable length strings are
	needed, but Ada would be fine. A language a la ML, where these
	checks are done at compile time, would be even better.

     3. The AT&T breakdown a month ago was caused by a break statement
	in C. See the following mail (multiple forwarding headers deleted):

Subject: AT&T software problem
Subject: Cautionary note on C programming...AT&T learns from experience
>From: kent@wsl.dec.com
Subj:	I've always thought C looked like line noise.
Subj:	the bug
Subj:	AT&T's bug, for you C users out there...
Subj:	I C what they mean!
Subj:	"c" considered dangerous to telephones
Subj:	Be careful from where you break! (else no long distance calls will make it thru...)
Subj:	C switch breaks AT&T switches!
Subj:	your "c users" list might appreciate this....


I received the following on AT&T's famous bug (and have deleted multiple 
forwarding headers):

| | Subject: AT&T Bug
| | Date: Fri Jan 19 12:18:33 1990
| | 
| | This is the bug that cause the AT&T breakdown
| | the other day (no, it wasn't an MCI virus):
| | 
| | In the switching software (written in C), there was a long
| | "do . . . while" construct, which contained
| |    a "switch" statement, which contained 
| |       an "if" clause, which contained a
| |          "break," which was intended for
| |       the "if" clause, but instead broke from
| |    the "switch" statement.
| | 

	Again it looks like this bug wouldn't have occurred in another
	programming language.

You C what I mean? Do you know other stories like these, if possible
with references? I don't want to praise Ada or pick at C and Fortran;
I am looking for any story where a proveably inappropriate/insecure
programming language has been used.


Gerald Baumgartner   gb@cs.purdue.edu   ...!{decwrl,gatech,ucbvax}!purdue!gb

^ permalink raw reply	[flat|nested] 66+ messages in thread
* Re: problems/risks due to programming language
@ 1990-02-23  6:46 Scott MacHaffie
  0 siblings, 0 replies; 66+ messages in thread
From: Scott MacHaffie @ 1990-02-23  6:46 UTC (permalink / raw)


In article <8126@hubcap.clemson.edu% billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu writes:
%From machaffi@fred.cs.washington.edu (Scott MacHaffie):
%% No, it is necessary to use a statement to indicate that the current case
%% statement is finished...like an "end case" or the next "when =% " in ADA.
%
%   Such a statement already exists: either the next "case Value:", or 
%   the } which ends the switch.  Why is it necessary to use a "break"?

example:
	switch (x) { /* x is a character, for example */
		case '0': case '1': ... case '9':
			print_digit(x);
			break;
		case 'a': ... case 'z':
			print_lowercase(x);
			break;
	}
The semantics of a C switch/case statement are different than the semantics
of an ada case/when.

%   The problem cannot simply be defined out of existence by saying,
%   in essence, that good programmers don't make mistakes.  All human
%   programmers make mistakes, and a well-designed language will help
%   to minimize this particular tendency.  In this case, C does not. 

Good programmers understand the language they are using -- good programmers
are literate. No language can eliminate errors. Good software engineering
practices should be used to (try to) catch language-specific errors.

%%%   This is certainly true; Brooks and others have noted that the good
%%%   software engineering practices which are routinely introduced in
%%%   conjunction with the Ada language are responsible for more of the 
%%%   resulting improvements than the fact that the Ada language was
%% 
%% Well, these practices are certainly NOT being introduced in the 
%% universities (at least not here).
%
%   In that case, I strongly suggest that you immediately bring 
%   this fact to the attention of the software engineering faculty 
%   at washington.edu.  At other universities (e.g., Clemson), Ada
%   *is* introduced in conjunction with software engineering.

Software engineering faculty?  I wish. None of the undergraduate classes
here touch software engineering, and I think at most one of the graduate
classes does. Anyone who wants to be a software engineer here has to
pick it up from other sources.

			Scott MacHaffie

^ permalink raw reply	[flat|nested] 66+ messages in thread
[parent not found: <10811@june.cs.washington.edu% <8126@hubcap.clemson.edu% <10838@june.cs.washington.edu>]
* Re: problems/risks due to programming language
@ 1990-02-24 19:39 Erland Sommarskog
  0 siblings, 0 replies; 66+ messages in thread
From: Erland Sommarskog @ 1990-02-24 19:39 UTC (permalink / raw)


Scott MacHaffie (machaffi@fred.cs.washington.edu.cs.washington.edu) writes:
)Bill Wolfe (billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu) writes:
))   the NEXT case.  In other words, C requires the programmer to use a
))   dangerous construct on a routine basis.
)
)(the dangerous construct is the "break" statement)
)But if "break" were renamed "end case" then there wouldn't be any problem?
)
))   code associated with the else part.  Thus, we have an inconsistency
))   in C's design: with one flow-of-control construct (the switch), it is
))   necessary to use a dangerous GOTO to achieve normal processing, whereas
)
)No, it is necessary to use a statement to indicate that the current case
)statement is finished...like an "end case" or the next "when =) " in ADA.

I don't speak C, so I might have missunderstood something, but I'm
under the impression that you may exclude the "break" statement
achieving the effect that you execute the code for the next case too.
Sometimes possibly a nifty feature, but it seems to me that is a good
source of errors. Whether it's called "break" or "end case" has no
importance. You may inadvertantly forget it in both cases.

)I don't use LINT. I use compilers that check certain things I want checked,
)like "no prototypes in scope".  LINT does not catch the kinds of mistakes
)that I make.  How many ADA programmers do you know of use LINT?

Ada programmers don't use lint, they don't have to.

From another article by Scott MacHaffie:
)Good programmers understand the language they are using -- good programmers
)are literate. No language can eliminate errors. Good software engineering
)practices should be used to (try to) catch language-specific errors.

And good languages should have as few unnecessary traps as possible
to help the software engineer spend his efforts on essentials.
-- 
Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se

^ permalink raw reply	[flat|nested] 66+ messages in thread
[parent not found: <5432@crdgw1.crd.ge.com) <8103@hubcap.clemson.edu) <10811@june.cs.washington.edu) <806@enea.se>]

end of thread, other threads:[~1990-03-26 20:37 UTC | newest]

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1990-02-20 22:28 problems/risks due to programming language, stories requested Gerald Baumgartner
1990-02-21 16:49 ` Richard A Hammond
1990-02-21 20:15   ` problems/risks due to programming language William Thomas Wolfe, 2847 
1990-02-21 22:49     ` Richard A Hammond
1990-02-21 23:14     ` John F Nixon
1990-02-22  5:39     ` Scott MacHaffie
1990-02-22 20:13       ` William Thomas Wolfe, 2847 
1990-02-23 17:32         ` Richard A Hammond
1990-02-25 20:23           ` David Kassover
1990-02-22 20:48       ` Jeff Lawhorn
1990-02-23  2:00       ` Douglas Miller
1990-02-22 16:05         ` Dan L. Pierson
1990-02-22 20:28           ` David Kassover
1990-02-24 19:52           ` Erland Sommarskog
1990-02-23 17:45         ` Mike Harrison
1990-02-27  2:02           ` Douglas Miller
1990-02-22 18:28     ` Mike Percy
1990-02-23  2:09     ` Douglas Miller
1990-02-22  0:25   ` problems/risks due to programming language, stories requested David Kassover
1990-02-22  3:42     ` Richard A Hammond
1990-02-22 16:08       ` David Kassover
1990-02-22 16:21       ` David Kassover
1990-02-23 18:11 ` Thomas Vachuska
1990-02-24  0:13 ` Mark Brader
1990-02-27 19:30 ` Bill Leonard
1990-02-28 18:57   ` Paul Snively
1990-02-28 21:35     ` Jason Coughlin
1990-03-01 19:00       ` Barry Margolin
1990-03-02 13:31         ` Richard A Hammond
1990-03-02 19:26           ` William Thomas Wolfe, 2847 
1990-03-02 22:19             ` Richard A Hammond
1990-03-06 21:54               ` John Boone
1990-03-03 20:18             ` Charles E Eaker
1990-03-03 21:11               ` Invalid analogy William Thomas Wolfe, 2847 
1990-03-03 23:26                 ` I Wish
1990-03-05 19:51                 ` John F Nixon
1990-03-09 17:20                 ` Tony Sanders
1990-03-01 15:33     ` problems/risks due to programming language, stories requested Jeff Dalton
1990-03-01 21:42       ` Chuck Lins
1990-03-02 19:19     ` David F. Carlson
1990-03-02 22:15       ` William Thomas Wolfe, 2847 
1990-03-06 10:11         ` jbaker
1990-03-08 15:19           ` Lou Steinberg
1990-03-08 21:44             ` Gianfranco Ciardo
1990-03-09 16:18               ` David Kassover
1990-03-09 16:55               ` Erann Gat
1990-03-10 17:50               ` Andrew P. Mullhaupt
1990-03-12  4:06                 ` Peter da Silva
1990-03-12 16:58                 ` Jeff Clark
1990-03-12 20:20                 ` Proposal comp.lang.jihad (was Re: problems/risks due to blah etc.) What`s in a name?
1990-03-09 20:13         ` problems/risks due to programming language, stories requested Tony Sanders
1990-03-13 22:11           ` Erland Sommarskog
1990-03-19  1:01           ` Ada vs C, objectivity requested Lucio de Re
1990-03-26 20:37             ` Karl Heuer
1990-03-15 15:31         ` problems/risks due to programming language, stories requested jaws
1990-03-02 23:27       ` Jim Giles
1990-03-03  2:23         ` Vincent Manis
1990-03-03  2:10       ` problems/risks due to programming language Karl Heuer
1990-03-02 23:01     ` problems/risks due to programming language, stories requested William J. Bouma
1990-03-14  4:46     ` Lindsay Groves
  -- strict thread matches above, loose matches on Subject: below --
1990-02-23  6:46 problems/risks due to programming language Scott MacHaffie
     [not found] <10811@june.cs.washington.edu% <8126@hubcap.clemson.edu% <10838@june.cs.washington.edu>
1990-02-23 18:55 ` B. S. Oplinger
1990-02-24 19:39 Erland Sommarskog
     [not found] <5432@crdgw1.crd.ge.com) <8103@hubcap.clemson.edu) <10811@june.cs.washington.edu) <806@enea.se>
1990-02-26 18:48 ` What`s in a name?
1990-02-26 22:02   ` Karl Heuer
1990-03-02 10:57   ` Erland Sommarskog

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