Re: C dangerous?
From: Julian V. Noble (jvn_at_virginia.edu)
Date: 02/18/04
- Next message: Peter Nilsson: "Re: 32x32 and 64x64 signed integer multiplication"
- Previous message: Peter Nilsson: "Re: 32x32 and 64x64 signed integer multiplication"
- In reply to: Bill Cunningham: "C dangerous?"
- Next in thread: Erik: "Re: C dangerous?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 17 Feb 2004 20:27:59 -0500
Bill Cunningham wrote:
>
> I read an article in a book about Perl and Common Gateway Interface and it
> mentioned C. It said that C could damage your computer. I don't know wether
> it meant the standard or compiler issuses. I was a little upset. Well more
> upset. I sent Dennis Ritchie and email. I don't know if he'll respond if he
> gets it. Sometimes he does sometimes not. How can C damage your computer?
>
> Bill
>
> -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
> http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
> -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
It is not C, per se, as someone else mentioned, but any language
that lets you overwrite memory. Protected memory systems offer some
--well, protection-- against this by setting a permission level and
detecting attempted memory stores outside the bounds permissible for
that level of access. It doesn't work 100%, though, and can be
circumvented by a clever enough programmer. And it can happen by
accident, especially with over-complex and error-prone OS's like
M$ WinDoze.
In my case, a crashing program (I think it was written in C, but it
surely had some assembler) overwrote the CRAM that stored the settings
on my computer. Naturally I had never thought of writing them down.
And in those days there was no plug-n-play: the OS had to have stored
details about the hard drive, etc. Once that all was erased, I had
the dickens of a time getting everything working again. And that was
in the days when a decent machine with 4 Mb Ram and a 30 Mb hard drive,
running at 25 MHz, cost $3K. So I recall spending a very interesting
day on the phone with Gateway. Tod do them justice, the guy was very
conscientious about looking up the data on my obsolete (it was 2 years
old) computer and instructing me how to reset the CRAM.
Fortunately computers are better designed nowadays, and I don't think it
is possible to turn up the brightness on a CRT enough to burn out the
cathode or make a hole in the phosphor (it surely used to be possible).
I don't think a runaway program can plow up the ferrite coating by
grinding a disk head against it. The display has safety hardware to
prevent this, and drives do also. There would have to be an improbable
cascade of failures before a bad program could chew up a computer.
The worst that can happen is that it might reconfigure your machine
in unpleasant ways, since I think the configuration settings are
still programmable (otherwise you couldn't set them by hitting F2
or whatever during the bootup). This is inconvenient, but not
necessarily catastrophic. And of course you can print them out
by invoking the configuration program and hitting Shift-PrtScrn.
The Gateway guy taught me that trick after my fiasco. I now do
it on every new machine I acquire (even if it has a sytem restore
partition on the hard drive).
--
Julian V. Noble
Professor Emeritus of Physics
jvn@lessspamformother.virginia.edu
^^^^^^^^^^^^^^^^^^
http://galileo.phys.virginia.edu/~jvn/
"God is not willing to do everything and thereby take away
our free will and that share of glory that rightfully belongs
to us." -- N. Machiavelli, "The Prince".
- Next message: Peter Nilsson: "Re: 32x32 and 64x64 signed integer multiplication"
- Previous message: Peter Nilsson: "Re: 32x32 and 64x64 signed integer multiplication"
- In reply to: Bill Cunningham: "C dangerous?"
- Next in thread: Erik: "Re: C dangerous?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]