🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2623

Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++)

#2623
From: Paul Menage
Date: Sun, 15 Oct 1995 14:29
43 lines
2078 bytes
In article <5vpKEsfzcsB@khms.westfalen.de>, 
kai@khms.westfalen.de (Kai Henningsen) writes:
>
>For instance, lisp is usually completely bullet-proof. For a more  
>"mainstream" language, M3 *guarantees* (if it's implemented correctly)  
>that as long as you keep to writing "safe" modules, you *cannot* crash the  
>program, at worst you'll get a runtime error. (That makes life somewhat  
>harder for people writing "unsafe" modules, of course, as they have to  
>keep that guarantee - even the most idiotic use of their modules has to  
>stay safe.)

Unfortunately, by this definition, SRC Modula-3 ( at least the SOLsun
version ) is not correctly implemented:

----------------------------
MODULE Main;

PROCEDURE P()=
BEGIN
	P();
END P;

BEGIN
	P();
END Main.
-----------------------------

Causes 'Segmentation Fault (core dumped)' under SunOS 5.4

Although ThreadPosix.m3 does put sentinels at the end of stacks, it only
ever checks these at thread-switch time, so a thread that recurses too
deeply can cause arbitrary damage until the the virtual timer signal
kicks in.

Given the sophistication of most memory managers now days, wouldn't it
be possible to have an interface that a specific platform could
implement to give proper stack checking, and a default which implements
the current ThreadPosix behaviour ?

Paul

-- 
Paul Menage        Magdalene College, Cambridge      pbm1001@cam.ac.uk
Technical Details
Message-ID: <45r5sl$k27@lyra.csx.cam.ac.uk>
Path: arc1-ca.pugleaf.net!lyra.csx.cam.ac.uk!pbm1001
References: <DG920p.L2K@world.std.com> <Pine.SUN.3.91.951010144335.13726A@lagrange.uwaterloo.ca> <DG920p.L2K@world.std.com> <Pine.SUN.3.91.951011133320.1821B-100000@lagrange.uwaterloo.ca> <5vpKEsfzcsB@khms.westfalen.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!lyra.csx.cam.ac.uk!pbm1001
From: pbm1001@cam.ac.uk (Paul Menage)
Newsgroups: comp.lang.modula2,comp.lang.c,comp.lang.ada,comp.lang.c++,comp.lang.modula3
Subject: Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++)
Date: 15 Oct 1995 14:29:41 GMT
Organization: University of Cambridge, England
Message-ID: <45r5sl$k27@lyra.csx.cam.ac.uk>
References: <DG920p.L2K@world.std.com>  <Pine.SUN.3.91.951010144335.13726A@lagrange.uwaterloo.ca>  <DG920p.L2K@world.std.com>  <Pine.SUN.3.91.951011133320.1821B-100000@lagrange.uwaterloo.ca> <5vpKEsfzcsB@khms.westfalen.de>
NNTP-Posting-Host: hammer.thor.cam.ac.uk