public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
From: "George, Jini Susan" <JiniSusan.George@amd.com>
To: Mark Wielaard <mark@klomp.org>,
	"Sharma, Alok Kumar" <AlokKumar.Sharma@amd.com>,
	"dwz@sourceware.org" <dwz@sourceware.org>
Cc: "E, Nagajyothi" <Nagajyothi.E@amd.com>,
	"Achra, Nitika" <Nitika.Achra@amd.com>
Subject: RE: [PATCH] DWZ aborted "write_types: Assertion `ref && ref->die_dup == NULL'"
Date: Fri, 5 Feb 2021 13:21:16 +0000	[thread overview]
Message-ID: <BY5PR12MB496586F29232A0B8CC753A5090B29@BY5PR12MB4965.namprd12.prod.outlook.com> (raw)
In-Reply-To: <3b76b14ca5608a8cb0b31b34767d322aab31e7e8.camel@klomp.org>

[AMD Public Use]

Hi Mark, 

This was triggering with the gdb test case gdb.dwarf2/dw4-sig-types.exp  when compiled with clang. 

Thanks,
Jini.

-----Original Message-----
From: Mark Wielaard <mark@klomp.org> 
Sent: Friday, February 5, 2021 6:39 PM
To: Sharma, Alok Kumar <AlokKumar.Sharma@amd.com>; dwz@sourceware.org
Cc: George, Jini Susan <JiniSusan.George@amd.com>; E, Nagajyothi <Nagajyothi.E@amd.com>; Achra, Nitika <Nitika.Achra@amd.com>
Subject: Re: [PATCH] DWZ aborted "write_types: Assertion `ref && ref->die_dup == NULL'"

[CAUTION: External Email]

Hi Alok,

On Fri, 2021-02-05 at 06:09 +0000, Sharma, Alok Kumar via Dwz wrote:
> Would you please review the attached patch containing modification of 
> assert condition.
> It was required to fix an abort which seem to be incorrect.
>
> There is an assert condition as "ref && ref->die_dup == NULL".
> As per definition of "struct dw_die", the structure fields starting 
> from 'die_dup' are present only if 'die_toplevel' is 1. In line with 
> this at multiple places in code, full/paritial memory is allocated for 
> pointer of type dw_die.
> Ex.  die = pool_alloc (dw_die, offsetof (struct dw_die, die_dup)); Due 
> to this, since memory is not allocated for field die_dup onwards, it 
> may contain junk values. Macro 'die_safe_dupe' must be used in place 
> of directly accessing 'die_dup' field whenever required.
>
>       * dwz.c (write_types): Use 'die_safe_dup' to access field 'die_dup'.

I think you analysis and the code fix are correct. Thanks.

This was probably missed before because -fdebug-types-section isn't the default, so we are not seeing many DWARF files with debug types.

Do you have an example where this triggers?

Thanks,

Mark

  reply	other threads:[~2021-02-05 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05  6:09 Sharma, Alok Kumar
2021-02-05 13:09 ` Mark Wielaard
2021-02-05 13:21   ` George, Jini Susan [this message]
2021-02-06  3:01     ` Mark Wielaard

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=BY5PR12MB496586F29232A0B8CC753A5090B29@BY5PR12MB4965.namprd12.prod.outlook.com \
    --to=jinisusan.george@amd.com \
    --cc=AlokKumar.Sharma@amd.com \
    --cc=Nagajyothi.E@amd.com \
    --cc=Nitika.Achra@amd.com \
    --cc=dwz@sourceware.org \
    --cc=mark@klomp.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).