From: Jim Blandy <jimb@codesourcery.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mark.kettenis@xs4all.nl, gdb-patches@sourceware.org
Subject: Re: [RFC] Move the frame zero PC check earlier
Date: Mon, 22 May 2006 23:15:00 -0000 [thread overview]
Message-ID: <vt264jx8xkp.fsf@theseus.home.> (raw)
In-Reply-To: <usln5zxx3.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 19 May 2006 21:12:24 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> Cc: Mark Kettenis <mark.kettenis@xs4all.nl>, gdb-patches@sourceware.org
>> From: Jim Blandy <jimb@codesourcery.com>
>> Date: Fri, 19 May 2006 10:38:36 -0700
>>
>> > I think it was already suggested in this lengthy thread to display
>> > some kind of message to alert the user. For example:
>> >
>> > (Backtrace terminated due to zero return address.)
>> >
>> > Would this make everybody fairly happy to zero in on a solution?
>>
>> (UNFAIR UNHAPPINESS ABOUT NON-ZERO SOLUTIONS FOR EVERYBODY!!!)
>>
>> Well, no: the stacks we'd like to display are healthy and well-formed,
>> according to the conventions of the system; there's nothing
>> non-standard about them at all. So they ought to display as normal
>> stacks --- on those systems.
>
> Sorry, I'm too dumb today to see what's humor here and what's for
> real. It sounds like you want to see no message at all, and OTOH, you
> also objected to having a user option for turning the message on and
> off. That leaves us at an impasse.
The first sentence was meant to be funny. The following paragraph was
completely serious. I don't think we're at an impasse.
Right now, on systems that terminate their stacks with zero return
addresses, GDB displays well-formed stacks incorrectly, showing an
extra frame after the oldest real frame. Everyone agrees, including
Mark, that this behavior is wrong, and should be fixed.
Daniel's original proposal, which Joel and I think is fine, was to
make GDB treat a null return address as a proper end-of-stack on all
systems. This would be a simple, localized change. It would fix the
bug observed on zero-return-addr-stack-end systems.
The drawback Mark pointed out is that, on a system that does not use a
zero return address to indicate the end of the stack, if a stack has
been corrupted by having some return address overwritten with a zero,
GDB will display that stack as ending normally. That is, because
Daniel's proposed change would affect all systems, not just systems
which intentionally use zero return addresses, it could make certain
kinds of corruption somewhat less apparent: instead of ending with a
weird frame with a 0x00000000 PC, the backtrace will simply end at the
prior frame. You'll still have a stack that ends before you'd expect,
but it won't end in a mess.
The compromise is to do something which makes the interpretation of
zero return addresses specific to those ABI's that use it. Daniel
suggested a gdbarch flag, but Mark wants to pursue having the
unwinders on such ABI's make the decision.
next prev parent reply other threads:[~2006-05-22 23:11 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-10 18:03 Daniel Jacobowitz
2006-05-11 10:42 ` Andrew STUBBS
2006-05-11 22:24 ` Jim Blandy
2006-05-11 22:32 ` Daniel Jacobowitz
2006-05-12 6:21 ` Jim Blandy
2006-05-12 12:46 ` Daniel Jacobowitz
2006-05-13 10:14 ` Mark Kettenis
2006-05-13 15:17 ` Daniel Jacobowitz
2006-05-13 15:46 ` Daniel Jacobowitz
2006-05-13 17:08 ` Mark Kettenis
2006-05-13 16:49 ` Mark Kettenis
2006-05-13 18:53 ` Daniel Jacobowitz
2006-05-16 21:38 ` Daniel Jacobowitz
2006-05-16 22:19 ` Mark Kettenis
2006-05-16 22:46 ` Daniel Jacobowitz
2006-05-16 23:53 ` PAUL GILLIAM
2006-05-18 1:35 ` Joel Brobecker
2006-05-18 9:31 ` Jim Blandy
2006-05-18 10:09 ` Andrew STUBBS
2006-05-18 17:36 ` Jim Blandy
2006-05-18 18:09 ` PAUL GILLIAM
2006-05-18 20:04 ` Jim Blandy
2006-05-18 20:43 ` Mark Kettenis
2006-05-18 23:31 ` Jim Blandy
2006-05-20 22:26 ` Mark Kettenis
2006-05-21 2:12 ` Daniel Jacobowitz
2006-07-21 15:52 ` Andrew STUBBS
2006-07-22 11:23 ` Mark Kettenis
2006-07-24 19:32 ` Daniel Jacobowitz
2006-07-26 22:16 ` Mark Kettenis
2006-07-26 22:25 ` Daniel Jacobowitz
2006-05-19 3:32 ` Daniel Jacobowitz
2006-05-20 21:30 ` Mark Kettenis
2006-05-19 12:26 ` Eli Zaretskii
2006-05-19 18:12 ` Jim Blandy
2006-05-19 18:53 ` Eli Zaretskii
2006-05-22 23:15 ` Jim Blandy [this message]
2006-05-15 13:57 ` Andrew STUBBS
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=vt264jx8xkp.fsf@theseus.home. \
--to=jimb@codesourcery.com \
--cc=eliz@gnu.org \
--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