delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/02/06/07:06:35

Date: Thu, 6 Feb 2003 14:04:02 +0200 (EET)
From: Esa A E Peuha <peuha AT cc DOT helsinki DOT fi>
Sender: peuha AT sirppi DOT helsinki DOT fi
To: djgpp-workers AT delorie DOT com
Subject: Re: Checking for stack overflow
In-Reply-To: <6480-Wed05Feb2003174159+0200-eliz@is.elta.co.il>
Message-ID: <Pine.OSF.4.51.0302061333090.25864@sirppi.helsinki.fi>
References: <Pine DOT OSF DOT 4 DOT 51 DOT 0302051407240 DOT 1814 AT sirppi DOT helsinki DOT fi>
<6480-Wed05Feb2003174159+0200-eliz AT is DOT elta DOT co DOT il>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 5 Feb 2003, Eli Zaretskii wrote:

> Why not jump to __djgpp_traceback_exit instead?

After printing "out of stack", you mean?  Maybe, but the traceback
doesn't seem very useful to me in this case.

> I don't think we should have this working by default, only given some
> switch to GCC.  Stack checking is a run-time overhead, so we shouldn't
> force it on users, IMHO.

Gcc already has -fstack-check for this; it just doesn't do anything
useful currently.

Here's another thought: how about having an uncommitted memory page just
below the stack?  Then stack overflow would be just like dereferencing a
null pointer; caught with no run-time overhead (but only on DOS machines
unfortunately).

-- 
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019