From: Mark Kettenis <kettenis@chello.nl>
To: eliz@gnu.org
Cc: cagney@gnu.org, gdb@sources.redhat.com
Subject: Re: [6.2] PROBLEMS file
Date: Wed, 21 Jul 2004 21:12:00 -0000 [thread overview]
Message-ID: <200407212059.i6LKxgQ9019045@copland.kettenis.dyndns.org> (raw)
In-Reply-To: <1659-Mon19Jul2004215127+0300-eliz@gnu.org>
Date: Mon, 19 Jul 2004 21:51:27 +0200
From: "Eli Zaretskii" <eliz@gnu.org>
> Date: Sun, 18 Jul 2004 23:25:19 -0400
> From: Andrew Cagney <cagney@gnu.org>
>
> gdb/1505: [regression] gdb prints a bad backtrace for a thread
>
> When backtracing a thread, gdb does not stop when it reaches the
> outermost frame, instead continuing until it hits garbage. This is
> sensitive to the operating system and thread library.
In most cases there is no way for GDB to tell what the outermost frame
is. Some people think that %ebp == 0 or %eip == 0 serves as a marker,
but they're mistaken. The usage as %ebp as a frame pointer is a
software comvention which isn't mandated by the ABI. More and more
code doesn't use %ebp as a frame pointer, makeing that register
available for other purposes. In that case, %ebp == 0 defenitely
shouldn't terminate the backtrace. And %eip == 0 can happen in the
case of a null-pointer function call.
FWIW, I've seen similar problems without any threading, in the DJGPP
port (when debugging Emacs). GDB 5.x doesn't have problems with the
same debuggee. I originally thought that it is specific to DJGPP
(perhaps because the DJGPP port of Emacs is compiled with -gcoff and
the line number table overflows the 64K limit inherent to COFF debug
info), but now that I see this PR, I begin to think that it's not
DJGPP-specific.
We'll just have to live with this. The days where we could trust the
"frame chain" on the i386 are over; there is too much frameless code
out there, and it will only increase. Without DWARF2 CFI we have to
rely on the prologue analyzer to properly unwind the stack. There
certainly is room for improvement in the prologue analyzer, but it
will probably never be perfect. There will always be cases where GDB
will get confused and lose track. In that case it will possibly
provide an endless or very long backtrace containing garbage.
So IMHO there is no regression here. PR 1505 should be closed. If
the length of the backtraces is a problem, we should probably set a
sensible backtrace limit.
Mark
next prev parent reply other threads:[~2004-07-21 21:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-19 3:51 Andrew Cagney
2004-07-19 21:01 ` Eli Zaretskii
2004-07-21 21:12 ` Mark Kettenis [this message]
2004-07-21 22:05 ` H. J. Lu
2004-07-22 20:58 ` Mark Kettenis
2004-07-22 21:33 ` Joel Brobecker
2004-07-22 21:38 ` H. J. Lu
2004-07-21 22:17 ` Andrew Cagney
2004-07-22 7:13 ` Eli Zaretskii
2004-07-22 13:04 ` Dave Korn
2004-07-22 15:17 ` Daniel Jacobowitz
2004-07-22 12:14 Michael Elizabeth Chastain
2004-07-22 18:28 ` Joel Brobecker
2004-07-22 19:26 ` Eli Zaretskii
2004-07-22 20:51 ` Mark Kettenis
2004-07-23 9:24 ` Eli Zaretskii
2004-07-23 11:22 ` Mark Kettenis
2004-07-23 12:03 ` Eli Zaretskii
2004-07-23 12:13 ` Eli Zaretskii
2004-07-23 12:16 ` Dave Korn
2004-07-23 13:36 ` Mark Kettenis
2004-07-23 16:17 ` Eli Zaretskii
2004-07-23 5:44 Michael Elizabeth Chastain
2004-07-23 20:44 ` Andrew Cagney
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=200407212059.i6LKxgQ9019045@copland.kettenis.dyndns.org \
--to=kettenis@chello.nl \
--cc=cagney@gnu.org \
--cc=eliz@gnu.org \
--cc=gdb@sources.redhat.com \
/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