Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Doug Evans" <dje@google.com>
To: "Jim Blandy" <jimb@codesourcery.com>
Cc: gdb@sourceware.org
Subject: Re: protection from dangling pointers in dwarf info when .so's go away
Date: Fri, 14 Dec 2007 00:04:00 -0000	[thread overview]
Message-ID: <e394668d0712131604n2292947bqce0ba27908a732db@mail.gmail.com> (raw)
In-Reply-To: <m3hcimy1n0.fsf@codesourcery.com>

On Dec 13, 2007 8:56 AM, Jim Blandy <jimb@codesourcery.com> wrote:
>
>
> Daniel Jacobowitz <drow at false.org> writes:
> > On Thu, Dec 13, 2007 at 12:16:36AM -0800, Doug Evans wrote:
> >> What happens if TYPE_OBJFILE (type) != TYPE_OBJFILE
> >> (TYPE_VPTR_BASETYPE (baseclass)) ?
> >
> > Precisely what you saw, but how does this happen?  The baseclass links
> > should normally point through to other types in the same objfile.
> >
> > I'm guessing that there was inadequate debug info for a base class,
> > leading GDB to do name resolution into a shared library with better
> > debug info (probably because it defined the class's key method)?
>
> If I remember right, the way we usually handle this is by leaving the
> types from the main executable 'incomplete', as if it had just seen
> 'struct foo' but no definition for it.  When we need the full
> definition of 'struct foo', we look it up by name, find it whereever
> it happens to be available, and use it there.  So we do an extra name
> lookup, because that allows the reference to break naturally when
> objfiles are freed.
>
> But there shouldn't be pointers between objfiles, for the reasons
> stated.

It turns out all that's needed is for the baseclass in question live in a .so.
I filed 2384, and will submit a proposed patch shortly.


      reply	other threads:[~2007-12-14  0:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-13  1:58 Doug Evans
2007-12-13  3:27 ` Daniel Jacobowitz
2007-12-13  8:16   ` Doug Evans
2007-12-13 13:19     ` Daniel Jacobowitz
2007-12-13 16:56       ` Jim Blandy
2007-12-14  0:04         ` Doug Evans [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=e394668d0712131604n2292947bqce0ba27908a732db@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb@sourceware.org \
    --cc=jimb@codesourcery.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