public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@unknown>
To: raulir@voimax.voima.jkl.fi
Cc: egcs@cygnus.com
Subject: Re: Stack variables
Date: Tue, 20 Jan 1998 10:07:00 -0000	[thread overview]
Message-ID: <760.885309234@unknown> (raw)
In-Reply-To: <199801172114.XAA24914@fishy.pp.sci.fi>

  In message < 199801172114.XAA24914@fishy.pp.sci.fi >you write:
  > Since there were no checks, it eventually overwrote its stack. When I
  > debugged it with GDB, I just got a notification "SIGSEGV received", and
  > stack trace gave only one address: 0. Nothing else. Eventually I figured
  > it out, but I think that it shouldn't be this easy to screw your stack..
Welcome to the wonderful world of unix.

  > I usually use Electric Fence to debug programs, but in this case it was of
  > no use since it can't put an unmapped page before/after a stack variable.
  > After a while I thought of a simple solution: What about having a
  > debugging option in gcc that would allocate all stack variables with
  > malloc()? This would slow down the program, yes, but since it would be a
  > debugging option, it wouldn't matter.
It's an interesting thought, but separating the stack variables from
other uses of the stack might be rather difficult.  There's also significant
code in the compiler which knows special things about the stack or frame
poiner (look for stack_pointer_rtx in reload*.c and many other files).

jeff

  reply	other threads:[~1998-01-20 10:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-17 22:30 Rauli Ruohonen
1998-01-20 10:07 ` Jeffrey A Law [this message]
1998-01-22  1:45   ` amylaar
1998-01-22  2:29   ` Marc Lehmann

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=760.885309234@unknown \
    --to=law@unknown \
    --cc=egcs@cygnus.com \
    --cc=raulir@voimax.voima.jkl.fi \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).