public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/24195] dwz: dwz.c:8562: adjust_exprloc: Assertion `refd != NULL && !refd->die_remove' failed.
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <bug-24195-11298-6HBXi3XOjf@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-24195-11298@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=24195

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 11601
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11601&action=edit
Tentative patch

AFAIU, the problem is here in read_exprloc when handling a
DW_OP_GNU_parameter_ref:
...
          if (ref->die_ck_state == CK_KNOWN)
            {
              ref->die_ck_state = CK_BAD;
              while (!ref->die_root
                     && ref->die_parent->die_ck_state == CK_KNOWN)
                {
                  ref = ref->die_parent;
                  ref->die_ck_state = CK_BAD;
                }
            }
          else
            ref->die_ck_state = CK_BAD;
          if (unlikely (low_mem))
            {
              ref->die_referenced = 1;
              /* As .debug_loc adjustment is done after                         
                 write_info finishes, we need to keep the referenced            
                 DIEs around uncollapsed.  */
              if (need_adjust)
                ref->die_intercu_referenced = 1;
            }
...

The loop does not use a loop-private iteration variable, and consequently not
the ref, but the root parent of the ref gets marked with die_referenced and
die_intercu_referenced.

The tentative patch fixes this by moving the CK_BAD marking down.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2019-02-09  8:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  0:00 [Bug default/24195] New: Segfault for LTO GCC binary marxin.liska at gmail dot com
2019-01-01  0:00 ` [Bug default/24195] dwz: dwz.c:8562: adjust_exprloc: Assertion `refd != NULL && !refd->die_remove' failed vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org [this message]
2019-01-01  0:00 ` vries at gcc dot gnu.org
2019-01-01  0:00 ` vries at gcc dot gnu.org

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=bug-24195-11298-6HBXi3XOjf@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=dwz@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).