public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/27464] New: CU referenced from PU (--odr-mode=link case) (bis)
@ 2021-02-24 17:37 vries at gcc dot gnu.org
  2021-02-24 17:39 ` [Bug default/27464] " vries at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-24 17:37 UTC (permalink / raw)
  To: dwz

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

            Bug ID: 27464
           Summary: CU referenced from PU (--odr-mode=link case) (bis)
           Product: dwz
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: default
          Assignee: nobody at sourceware dot org
          Reporter: vries at gcc dot gnu.org
                CC: dwz at sourceware dot org
  Target Milestone: ---

Using the same assert as in PR25424, and using the tentative patch series, we
run into:
...
$ dwz cc1.dwz-processed -o 1 -lnone --odr 
dwz: /home/vries/dwz/dwz.git/dwz.c:12601: write_die: Assertion `IMPLIES
(cu->cu_kind == CU_PU, die_cu (refd)->cu_kind == CU_PU)' failed.
Aborted (core dumped)
...

This is related to the duplicate chain:
...
 28dd83f O b500801d 621b6872  pointer_type (type: 28dd72f die_struct
structure_type)
 2903769 O b500801d 621b6872  pointer_type (type: 28dd72f die_struct
structure_type)
...
which are both in the same CU:
...
 <0><28d281f>: Abbrev Number: 200 (DW_TAG_compile_unit)

 <1><28dd72f>: Abbrev Number: 35 (DW_TAG_structure_type)
    <28dd730>   DW_AT_name        : (indirect string, offset: 0x1b2ca6):
die_struct
    <28dd734>   DW_AT_byte_size   : 80
    <28dd735>   DW_AT_decl_file   : 87
    <28dd736>   DW_AT_decl_line   : 3069
    <28dd738>   DW_AT_decl_column : 63
    <28dd739>   DW_AT_sibling     : <0x28dd83b>
 <1><28dd83f>: Abbrev Number: 9 (DW_TAG_pointer_type)
    <28dd840>   DW_AT_byte_size   : 8
    <28dd841>   DW_AT_type        : <0x28dd72f>

 <1><2903769>: Abbrev Number: 9 (DW_TAG_pointer_type)
    <290376a>   DW_AT_byte_size   : 8
    <290376b>   DW_AT_type        : <0x28dd72f>

 <0><2911617>: Abbrev Number: 177 (DW_TAG_compile_unit)
...

The dup chain is forced to a partial unit, but the die_struct DIE is not,
because it's not part of a duplicate chain, and it's not marked as a singleton.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug default/27464] CU referenced from PU (--odr-mode=link case) (bis)
  2021-02-24 17:37 [Bug default/27464] New: CU referenced from PU (--odr-mode=link case) (bis) vries at gcc dot gnu.org
@ 2021-02-24 17:39 ` vries at gcc dot gnu.org
  2021-02-25 14:47 ` vries at gcc dot gnu.org
  2021-02-27 10:38 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-24 17:39 UTC (permalink / raw)
  To: dwz

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Tentative fix:
...
diff --git a/dwz.c b/dwz.c
index 7bd18e3..89a231f 100644
--- a/dwz.c
+++ b/dwz.c
@@ -8445,6 +8445,9 @@ partition_dups (void)
              if (s)
                mark_singletons (die_cu (s), s, s, &ob2);
            }
+         else if (cnt_ref_cus (die) == 1)
+           mark_singletons (die_cu (die), die, die, &ob2);
+
          arr = (dw_die_ref *) obstack_base (&ob2);
        }

...

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug default/27464] CU referenced from PU (--odr-mode=link case) (bis)
  2021-02-24 17:37 [Bug default/27464] New: CU referenced from PU (--odr-mode=link case) (bis) vries at gcc dot gnu.org
  2021-02-24 17:39 ` [Bug default/27464] " vries at gcc dot gnu.org
@ 2021-02-25 14:47 ` vries at gcc dot gnu.org
  2021-02-27 10:38 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-25 14:47 UTC (permalink / raw)
  To: dwz

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

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/pipermail/dwz/2021q1/000975.html

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug default/27464] CU referenced from PU (--odr-mode=link case) (bis)
  2021-02-24 17:37 [Bug default/27464] New: CU referenced from PU (--odr-mode=link case) (bis) vries at gcc dot gnu.org
  2021-02-24 17:39 ` [Bug default/27464] " vries at gcc dot gnu.org
  2021-02-25 14:47 ` vries at gcc dot gnu.org
@ 2021-02-27 10:38 ` vries at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: vries at gcc dot gnu.org @ 2021-02-27 10:38 UTC (permalink / raw)
  To: dwz

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/git/?p=dwz.git;a=commit;h=c4153b701db20bbb0f5be90c8806743464639935

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-27 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 17:37 [Bug default/27464] New: CU referenced from PU (--odr-mode=link case) (bis) vries at gcc dot gnu.org
2021-02-24 17:39 ` [Bug default/27464] " vries at gcc dot gnu.org
2021-02-25 14:47 ` vries at gcc dot gnu.org
2021-02-27 10:38 ` vries at gcc dot gnu.org

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