From: Joel Brobecker <brobecker@adacore.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: gdb@sourceware.org
Subject: Re: More info on PR/9711 (quadratic slowdown for deep stack traces)
Date: Wed, 02 Sep 2009 04:52:00 -0000 [thread overview]
Message-ID: <20090902045232.GM4379@adacore.com> (raw)
In-Reply-To: <8ac60eac0909012041i1a9d4f8fmbd13d19ec8039ef0@mail.gmail.com>
> AFAIR, the real problem showed up while debugging GDB itself, when I
> made it go into infinite recursion loop. Making programs spin into the
> ground via infinite recursion is not that uncommon (IMHO) and when
> that happens, you do get 100_000 or more frames, and usually you only
> care about the outermost 10 of so. It is quite annoying if GDB takes
> several minutes to tell you what these 10 interesting frames are.
I should probably say that I am not contesting the fact that the problem
can happen in real life. I did assume that, given the requirements
for it to happen, the problem was not that common, and perhaps I was
mistaken. It's always hard to say how common an issue is.
That being said, here are the current parameters:
- I will submit a patch tomorrow that implements the first idea
that I floated. Namely, if the previous frame has already been
computed, then have get_prev_frame return that. This cuts down
most of the time spent during the register value computation
(roughly 60% with 10_000 frames).
- I don't see how, right now, we could get rid of the quadratic
behavior. It's embedded in the current design: We now get register
values, and values cannot store the frame directly, it has to be
the frame ID. This means a frame lookup from ID, which is the
second loop causing the n^2 behavior.
I am hoping that Daniel, who has more experience than I do in the
area of unwinding, might be able to suggest something that would
help us get rid of the double loop. But, assuming that my patch
is approved, do you think that we should delay the release in order
to get this changed into an O(n) behavior?
--
Joel
next prev parent reply other threads:[~2009-09-02 4:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-01 20:48 Joel Brobecker
2009-09-02 3:42 ` Paul Pluzhnikov
2009-09-02 4:52 ` Joel Brobecker [this message]
2009-09-02 4:57 ` Paul Pluzhnikov
2009-09-02 11:43 ` Daniel Jacobowitz
2009-09-02 16:24 ` Joel Brobecker
2009-09-03 18:40 ` Joel Brobecker
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=20090902045232.GM4379@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb@sourceware.org \
--cc=ppluzhnikov@google.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