Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: mark.kettenis@xs4all.nl (Mark Kettenis)
Cc: gdb-patches@sourceware.org
Subject: Re: [commit] Fix backtrace past "clone" on powerpc
Date: Sun, 04 May 2008 13:14:00 -0000	[thread overview]
Message-ID: <200805041152.m44Bqb1q011164@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <200805040904.m4494C2X021017@brahms.sibelius.xs4all.nl> from "Mark Kettenis" at May 04, 2008 11:04:12 AM

Mark Kettenis wrote:

> > Date: Sun, 4 May 2008 02:43:13 +0200 (CEST)
> > From: "Ulrich Weigand" <uweigand@de.ibm.com>
> > 
> > The patch below fixes this by having rs6000_frame_this_id return the null
> > frame ID in that case (just like many other targets do already).
> 
> Please think a bit more about this.  Is base == 0 a strong enough
> condition on PowerPC?

base == 0 at this point means we read 0 from the stack frame back chain
word.  This condition is in fact defined by the PowerPC ABI to indicate
the top-most stack frame; that's why glibc's clone uses that convention
for the initial frame of the new thread.  There doesn't seem to be any
additional indication of that (if there's no debug info for glibc).

> What happens if you have a buffer overflow that
> overwrites the piece of the stack where the stack pointer was saved
> with zero?  Will the backtrace now terminate without printing an
> error?

I guess that may happen (unless the function in question provides
debug info, in which case we'll use the DWARF-2 unwinder instead of
the prologue-parsing unwinder).  However, in the case of buffer
overflow on the stack all bets are off in any case how the unwinder
will react, depending on what was clobbered ...

I don't think attempting to handle this particular case justifies
treating a correct, ABI-conforming situation as error.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


      reply	other threads:[~2008-05-04 11:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-04  4:04 Ulrich Weigand
2008-05-04 11:53 ` Mark Kettenis
2008-05-04 13:14   ` Ulrich Weigand [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=200805041152.m44Bqb1q011164@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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