delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/02/05/10:44:50

Date: Wed, 05 Feb 2003 17:42:02 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp-workers AT delorie DOT com
Message-Id: <6480-Wed05Feb2003174159+0200-eliz@is.elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <Pine.OSF.4.51.0302051407240.1814@sirppi.helsinki.fi> (message
from Esa A E Peuha on Wed, 5 Feb 2003 14:35:31 +0200 (EET))
Subject: Re: Checking for stack overflow
References: <Pine DOT OSF DOT 4 DOT 51 DOT 0302051407240 DOT 1814 AT sirppi DOT helsinki DOT fi>
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

> Date: Wed, 5 Feb 2003 14:35:31 +0200 (EET)
> From: Esa A E Peuha <peuha AT cc DOT helsinki DOT fi>
> 
> Gcc apparently allows to define freely what instructions are used to
> allocate space from the stack.  Since we have a fixed stack size, it
> would be good to check esp againt the stack limit every time it's
> changed.  However, this needs two global symbols in crt0.o; one a
> variable to hold the current stack limit (equal to ___djgpp_stack_limit
> when esp points to application stack and equal to exception_stack when
> that is used), and the other a routine to jump to when the stack is
> overflown (which would print "out of stack" and exit since there's
> nothing else it can do).

Why not jump to __djgpp_traceback_exit instead?

> These symbols would need to be implemented
> first (preferrably before the 2.04 release), and gcc changed later to
> use them.  Does that sound like something worth doing?

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.

- Raw text -


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