Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Keith Seitz <keiths@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Prevent inline function parameters from crashing the DWARF reader
Date: Tue, 16 Oct 2018 22:15:00 -0000	[thread overview]
Message-ID: <87o9btbkt1.fsf@tromey.com> (raw)
In-Reply-To: <20181012212141.29423-1-keiths@redhat.com> (Keith Seitz's message	of "Fri, 12 Oct 2018 14:21:41 -0700")

>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> However, as demonstrated in this Fedora bugzilla:
Keith>   https://bugzilla.redhat.com/show_bug.cgi?id=1638798

Keith> the abstract_origin of the parameter DIE may be in an entirely different
Keith> CU.  This CU will have no builder defined for it, so the call to
Keith> get_current_context_stack is made on an uninitialized builder, and GDB
Keith> segfaults.

I was curious what happened before, so I checked out the commit
before 804d27291b2922f01fe5cc2d9ae759533d4a2f6f, and ran it on the
executable in that bug.

I set a breakpoint conditional on curr==0 and it never hit.

Now, I am not totally sure that this was correct before, but I suppose
what was going on was that the earlier code was installing these symbols
into the referencing CU's symtab.

Abstractly, at least, that seems reasonable.  So maybe that approach
should be taken again.

Also, when I look at new_symbol, I see a bunch of uses of cu->builder,
so I wonder if there are ways to make those spots crash as well.
So maybe this indicates some different approach is needed as well.

Sorry about this.  I didn't anticipate this at all.  I can try to take
it over if you'd like.

Maybe one idea would be to temporarily set the referenced CU's builder
to the referencing CU's builder somehow.

Tom


  parent reply	other threads:[~2018-10-16 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 21:21 Keith Seitz
2018-10-13 18:49 ` Sergio Durigan Junior
2018-10-16 22:15 ` Tom Tromey [this message]
2018-10-16 22:29   ` Keith Seitz

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=87o9btbkt1.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@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