Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [downstream patch FYI] workaround stale frame_info * (PR 13866)
Date: Wed, 06 Jun 2012 20:16:00 -0000	[thread overview]
Message-ID: <4FCFBA71.70207@redhat.com> (raw)
In-Reply-To: <87d35cgrik.fsf@fleche.redhat.com>

On 06/06/2012 08:38 PM, Tom Tromey wrote:

> Despite the difficulties perhaps we should try to write a static
> analyzer for this.  I am not sure if it could be made reliable enough,
> but maybe it could.  The problem cases are when the analyzer must
> account for cleanups -- but in this case we might be able to get away
> with ignoring them.


If that doesn't work, or if it's too much trouble, we could consider putting
in a variant of my validation patch.  Instead of garbage collecting dead frames
at some specific points, keep say, a FIFO of the last N dead frames (don't free
them, but mark them dead, catching uses of those).  N could be low.  That'd
keep the extra memory bounded.  If this is considered expensive (unlikely),
we could guard it behind the new --development flag (kind of like
checking in gcc).

> Another idea is to simply get rid of frame_info and have only a
> frame_id-based API.

Most, a large majority of frame_info objects I see (when not a transient
use like get_current_frame passed directly to some frame.c function) of what I
see is in the unwinders, where that'd unnecessary, and wouldn't really work.
Most other places tend to already be careful with frame_info lifetime.  There's
execution commands (of which "until" was particularly bad), and a handful of
other things.  There are some paths in handle_inferior_event on software
single-step targets that might be hitting stale frame_info (hey, where
else would problems be, right?), but in all honesty, I don't think there
are that many related lurking bugs to worry that much about.

-- 
Pedro Alves


  reply	other threads:[~2012-06-06 20:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-04 19:14 Jan Kratochvil
2012-05-18 17:44 ` Tom Tromey
2012-05-18 18:01   ` Pedro Alves
2012-05-18 18:04     ` Jan Kratochvil
2012-05-18 19:16     ` Tom Tromey
2012-06-05 19:17 ` Pedro Alves
2012-06-05 19:39   ` Jan Kratochvil
2012-06-05 19:41     ` Pedro Alves
2012-06-05 19:50     ` Pedro Alves
2012-06-06 19:38     ` Tom Tromey
2012-06-06 20:16       ` Pedro Alves [this message]
2012-06-05 19:24 ` Pedro Alves
2012-06-05 19:52   ` Pedro Alves

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=4FCFBA71.70207@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=tromey@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