Article View: comp.lang.modula2
Article #2588Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++)
From: Marc E. Fiuczynski
Date: Sat, 07 Oct 1995 05:41
Date: Sat, 07 Oct 1995 05:41
42 lines
3120 bytes
3120 bytes
Viet-Trung Luu <vluu@mobius04.math.uwaterloo.ca> wrote:
>On 4 Oct 1995, Theodore Dennison wrote:
>> Using C:
>> Symptom : Machine 3 locks up.
>>
>> Actual Bug : C code on Machine 1 has "off by one" error.
>>
>> Using Ada:
>> Symptom : Code on machine 1 core dumps, with PC pointing to line of code
>> where error is.
>
>While I agree that C isn't great in the way of "safety", I have a few
>objections to this argument of yours. The problem was evidently a
>programming error. However, even technically valid code can generate
>garbage -- and that would be a programming error also.
>
>Although C makes programming errors harder to detect and also more
>dangerous, it is not entirely responsible for the crash of the network.
>In general, I'd have to say that it was the fault of the device driver
>which didn't check the data that it was given. Similar situations occur
>in other circumstances. For example, the 'Doze and Mac APIs don't check
>the data that they're given very carefully. Therefore, application
>programs are often able to crash the system. Is it acceptable that it's
>possible to crash the system in this way? I have to say "no".
All that is being said is with a language that does some checking for you,
you can avoid nasty little bugs that creep CAN creep into your C programs.
We have built an operating system in Modula3. All of us were C weenies
before we started, and it took about a month of hacking in M3 to convince
ourselves that
1) the base overhead of M3 produced code is within a few percent of C code.
2) typing BEGIN..END is not that big of deal.
3) M3 saved us from a bunch of nasty off by one errors, by printing a nice
little runtime error message with the line number and file where it broke,
allowing us to fix it in a matter of minutes, rather than hours or days of
figuring out why my datastructures first element suddenly has some weirdo
value in it.
and our group pretty much agrees that if we did our work
in C that we would be pretty darn far from
--
http://www.cs.washington.edu/homes/mef
Technical Details
Message-ID:
<DG2D4G.D3u@beaver.cs.washington.edu>Path:
arc1-ca.pugleaf.net!news.u.washington.edu!uw-beaver!newsReferences:
<438nkr$bd@classic.eng.octel.com> <nelsoni.812298479@rintintin.Colorado.EDU> <44epau$qof@saba.info.ucla.edu> <44hcri$rsm@theopolis.orl.mmc.com> <44rv1u$dfk@apollo.ekfido.kodak.com> <44uccq$lkd@theopolis.orl.mmc.com> <Pine.ULT.3.91.951005143816.2986A-100000@mobius04.math.uwaterloo.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2,comp.lang.modula3,comp.lang.c,comp.lang.c++,comp.lang.ada Path: arc1-ca.pugleaf.net!news.u.washington.edu!uw-beaver!news From: "Marc E. Fiuczynski" <mef@cs.washington.edu> Subject: Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++) Content-Type: text/plain; charset=us-ascii Sender: news@beaver.cs.washington.edu (Nancy Johnson-Burr) Content-Transfer-Encoding: 7bit Organization: Univeristy of Washington, Dept. of CS&E Message-ID: <DG2D4G.D3u@beaver.cs.washington.edu> References: <438nkr$bd@classic.eng.octel.com> <nelsoni.812298479@rintintin.Colorado.EDU> <44epau$qof@saba.info.ucla.edu> <44hcri$rsm@theopolis.orl.mmc.com> <44rv1u$dfk@apollo.ekfido.kodak.com> <44uccq$lkd@theopolis.orl.mmc.com> <Pine.ULT.3.91.951005143816.2986A-100000@mobius04.math.uwaterloo.ca> X-Mailer: Mozilla 1.1N (Windows; I; 32bit) Mime-Version: 1.0 X-Nntp-Posting-Host: makapuu.cs.washington.edu Date: Sat, 7 Oct 1995 05:41:04 GMT