[PATCH] DWZ aborted "write_types: Assertion `ref && ref->die_dup == NULL'"

Sharma, Alok Kumar AlokKumar.Sharma@amd.com
Fri Feb 5 06:09:57 GMT 2021


Hi all,

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'.


Regards,
Alok
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-DWZ-aborted-write_types-Assertion-ref-ref-die_dup-NU.patch
Type: application/octet-stream
Size: 1454 bytes
Desc: 0001-DWZ-aborted-write_types-Assertion-ref-ref-die_dup-NU.patch
URL: <https://sourceware.org/pipermail/dwz/attachments/20210205/5eb911f7/attachment.obj>


More information about the Dwz mailing list