linux-assembly.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stephen Pelc" <stephen@mpeforth.com>
To: linux-assembly@vger.kernel.org
Subject: Re: More about stacks
Date: Thu, 15 Sep 2005 15:19:28 +0100	[thread overview]
Message-ID: <43299100.16210.5C22D29@localhost> (raw)
In-Reply-To: <432892CD.3090907@colannino.org>

> The question I wanted to ask the list was that I know when you
> want to expand the stack to make room for more data (particularly
> when you're setting up local variables in C) you simply do a sub
> on %esp, but my question is, how do you know when you do this
> that you aren't violating data from some other process, or maybe
> even data belonging to other sections of your code, .data for
> example.

In the main you don't know. A solution we have used before is to 
define your own stack, defining read-only guard-bands on either 
side of it. If the guard bands are written to, an exception is 
triggered. One of our clients had this problem when using too 
many layers of callback functions and consumed over 1Mb of stack 
space!

Stephen


--
Stephen Pelc, stephen@mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 23 80 631441, fax: +44 23 80 339691
web: http://www.mpeltd.demon.co.uk - free VFX Forth downloads

      parent reply	other threads:[~2005-09-15 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-14 21:14 More about stacks James Colannino
2005-09-14 23:07 ` Richard Cooper
2005-09-20  1:45   ` Herbert Poetzl
2005-09-15 14:19 ` Stephen Pelc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43299100.16210.5C22D29@localhost \
    --to=stephen@mpeforth.com \
    --cc=linux-assembly@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).