[M3devel] SEGV mapping to RuntimeError

Jay K jay.krell at cornell.edu
Sun Feb 20 02:30:01 CET 2011


I just don't think because the Green Book says something, or because it is inherent in the
design, that is necessarily true or inherent in the implementation.
There are bugs *everywhere*, and they gradually chip away at all aspects of correctness.
 
Much of this, there is nothing you can do about.
The integer divide bug is an example that there is precious little you can do about.
You can check that the errata is fixed, and not depend on the correctness until
you have first check for it, but inevitably tons and tons of code will run
before your correctness check (e.g. booting the OS) and so the state is already not guaranteed.
 
I've also had my code fail to page in. That is another thing you can't do anything about,
in usermode...except maybe keep your code to under a page in size. :)
Simple progressing from one line of code to the next, or pieces within the line, can fail.
 
But SIGSEGV I think is in another realm. It is a sign of problems that should generally
be ignored.
There is a term "fail fast" -- at a sign of problem, fail. Don't press on.
There are arguments either way.
The world, really, the larger human enterprise and setting, is not fail fast.
We have lots of problems, yet almost everything almost always goes on.
 
 
 
 - Jay

 
> To: jay.krell at cornell.edu
> Date: Sat, 19 Feb 2011 16:59:04 -0800
> From: mika at async.caltech.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] SEGV mapping to RuntimeError
> 
> Jay K writes:
> >--_e4a53a7c-4058-44e7-bcce-18b6ae35efbe_
> >Content-Type: text/plain; charset="iso-8859-1"
> >Content-Transfer-Encoding: quoted-printable
> >
> >
> >NIL might be a special case.
> >But by and large=2C continuing to do anything after a SIGSEGV is a bad idea=
> >.
> >You think (you say) you are continuing on and preserving state=2C but the s=
> >tate
> >of the world is now arbitrarily altered and unknown and all future computat=
> >ion
> >based on it is suspect. Best to throw it away. And avoid incorrect results
> >when there is a such a strong hint that things have gone awry.
> 
> Let's try this again.
> 
> The Green Book unequivocally says that non-UNSAFE code can't get the
> world into a "state arbitrarily altered and unknown." That doesn't
> depend on the special case NIL, that's inherent in the design of the
> language and runtime.
> 
> Yet non-UNSAFE code can (for efficiency reasons of the implementation)
> cause a SIGSEGV. 
> 
> If the state of the world is somehow arbitrarily altered and unknown I
> would suggest tracking down the bugs (in UNSAFE code, compiler, C code,
> wherever) and fixing them rather than repeating the C programmer's mantra
> that SIGSEGV is or ought to be fatal to the point that you need to start
> from a clean slate.
> 
> This sort of thing is precisely what Modula-3 was invented for!!!!
> Why do you think (crazy) people still use the programming language,
> fifteen years after it's been declared dead? 
> 
> By the way, every year that I teach a class, I always ask the students
> what programming languages they use/learn/want to learn. Over the years
> I've seen a steady progression of C++, Java, Python... until last year.
> The most popular answer was "C". I must say it felt a bit odd to be,
> technologically, 20 years ahead of people 20 years younger. Now,
> I always used to feel a bit bad about forcing students to study a
> "dead" programming language that would not help them in employment,
> research, etc. (Modular-3? What's that?) But better than a language
> that should be dead.
> 
> Mika
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20110220/0122a968/attachment-0002.html>


More information about the M3devel mailing list