public inbox for dwz@sourceware.org
 help / color / mirror / Atom feed
* [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
@ 2021-03-16  9:17 mliska at suse dot cz
  2021-03-16 10:08 ` [Bug default/27588] " vries at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: mliska at suse dot cz @ 2021-03-16  9:17 UTC (permalink / raw)
  To: dwz

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

            Bug ID: 27588
           Summary: dwz: libxul.so: loclistptr attribute, yet no
                    .debug_loc section
           Product: dwz
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: default
          Assignee: nobody at sourceware dot org
          Reporter: mliska at suse dot cz
                CC: dwz at sourceware dot org
  Target Milestone: ---

Happens for libxul.so (thunderbird package) when using GCC 11 (-gdwarf-5):

$ dwz libxul.so
/home/marxin/Programming/dwz/dwz: libxul.so: loclistptr attribute, yet no
.debug_loc section

Please get the shared library here:
https://splichal.eu/tmp/libxul.so.zst

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
@ 2021-03-16 10:08 ` vries at gcc dot gnu.org
  2021-03-16 10:36 ` mliska at suse dot cz
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-03-16 10:08 UTC (permalink / raw)
  To: dwz

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vries at gcc dot gnu.org

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
So, this is related to this CU:
...
  Compilation Unit @ offset 0x37d3:
   Length:        0x8f (32-bit)
   Version:       3
   Abbrev Offset: 0x602
   Pointer Size:  8
 <0><37de>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <37df>   DW_AT_low_pc      : 0x4a89440
    <37e7>   DW_AT_high_pc     : 0x4a8d580
    <37ef>   DW_AT_stmt_list   : 0x12e55
    <37f3>   DW_AT_name        :
/home/abuild/rpmbuild/BUILD/thunderbird-78.8.1/third_party/dav1d/src/x86/cdef.asm
    <3845>   DW_AT_producer    : NASM 2.15.05
    <3852>   DW_AT_language    : 32769  (MIPS assembler)
 <1><3854>: Abbrev Number: 2 (DW_TAG_subprogram)
    <3855>   DW_AT_low_pc      : 0x4a89440
    <385d>   DW_AT_frame_base  : 0x0 (location list)
 <1><3861>: Abbrev Number: 0
 <0><3862>: Abbrev Number: 0
 <-1><3863>: Abbrev Number: 0
...

The dwarf version of the CU is 3, so a .debug_loc section is expected to
contain the location list for DW_AT_frame_base.

However, the binary does not contain a .debug_loc section:
...
$ readelf -S -W libxul.so | grep .debug_
  [31] .debug_aranges    PROGBITS        0000000000000000 7d238a0 02a5d0 00    
 0   0 16
  [32] .debug_pubnames   PROGBITS        0000000000000000 7d4de70 c25c3f 00    
 0   0  1
  [33] .debug_info       PROGBITS        0000000000000000 8973aaf 143b0f2 00   
  0   0  1
  [34] .debug_abbrev     PROGBITS        0000000000000000 9daeba1 001195 00    
 0   0  1
  [35] .debug_line       PROGBITS        0000000000000000 9dafd36 730cdf 00    
 0   0  1
  [36] .debug_str        PROGBITS        0000000000000000 a4e0a15 159d458 01 
MS  0   0  1
  [37] .debug_pubtypes   PROGBITS        0000000000000000 ba7de6d 000c60 00    
 0   0  1
  [38] .debug_ranges     PROGBITS        0000000000000000 ba7eacd 98b200 00    
 0   0  1
  [39] .debug_line_str   PROGBITS        0000000000000000 c409ccd 0001b8 01  MS
 0   0  1
  [40] .debug_loclists   PROGBITS        0000000000000000 c409e85 000060 00    
 0   0  1
  [41] .debug_rnglists   PROGBITS        0000000000000000 c409ee5 000042 00    
 0   0  1
...

So, I'd say the error message is correct.

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
  2021-03-16 10:08 ` [Bug default/27588] " vries at gcc dot gnu.org
@ 2021-03-16 10:36 ` mliska at suse dot cz
  2021-03-16 10:38 ` mliska at suse dot cz
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mliska at suse dot cz @ 2021-03-16 10:36 UTC (permalink / raw)
  To: dwz

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

--- Comment #2 from Martin Liska <mliska at suse dot cz> ---
All right, so it's likely nasm issue, there's reduced test-case:

$ cat cdef.asm
%define ARCH_X86_64 1
%ifndef public_prefix
%endif
%define WIN64  0
%if WIN64 ; Windows x64 ;=================================================
    %if vzeroupper_required
    %endif
%endif
%macro BRANCH_INSTR 0-*
%endmacro
%if ARCH_X86_64
%macro DUP4 1-*
%endmacro
    ret
%endif ; ARCH_X86_64

$ cat a.c
int main(int argc, char **argv)
{
  return 0;
}

$ nasm -o cdef.o -f elf64 -F dwarf cdef.asm && gcc a.c -O2 -g -shared cdef.o -o
x.so && dwz x.so

Apparently, cdef.o contains the section you're seeking for:

$ readelf -SW cdef.o | grep debug_loc
  [11] .debug_loc        PROGBITS        0000000000000000 0005c0 000000 00     
0   0  1

but the final x.so is somehow corrupted it seems:
$ readelf -w  x.so >/dev/null
readelf: Warning: Bogus end-of-siblings marker detected at offset e6 in
.debug_info section
readelf: Warning: Bogus end-of-siblings marker detected at offset e7 in
.debug_info section
readelf: Warning: Bogus end-of-siblings marker detected at offset e8 in
.debug_info section
readelf: Warning: Further warnings about bogus end-of-sibling markers
suppressed

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
  2021-03-16 10:08 ` [Bug default/27588] " vries at gcc dot gnu.org
  2021-03-16 10:36 ` mliska at suse dot cz
@ 2021-03-16 10:38 ` mliska at suse dot cz
  2021-03-16 10:49 ` vries at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mliska at suse dot cz @ 2021-03-16 10:38 UTC (permalink / raw)
  To: dwz

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

--- Comment #3 from Martin Liska <mliska at suse dot cz> ---
$ eu-readelf -w  x.so
...
 Compilation unit at offset 160:
 Version: 3, Abbreviation section offset: 118, Address size: 8, Offset size: 4
 [    ab]  compile_unit         abbrev: 1
           low_pc               (addr) +0x00000000000005d0 <frame_dummy+0x20>
           high_pc              (addr) +0x00000000000005d0 <frame_dummy+0x20>
           stmt_list            (data4) 182
           name                 (string) "cdef.asm"
           producer             (string) "NASM 2.15.05"
           language             (data2) Mips_Assembler (32769)
 [    d8]    subprogram           abbrev: 2
             low_pc               (addr) +0x00000000000005d0 <frame_dummy+0x20>
eu-readelf: DIE [d8] cannot get attribute 'frame_base' (data4) value:
.debug_loc section missing

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
                   ` (2 preceding siblings ...)
  2021-03-16 10:38 ` mliska at suse dot cz
@ 2021-03-16 10:49 ` vries at gcc dot gnu.org
  2021-03-16 11:12 ` mliska at suse dot cz
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-03-16 10:49 UTC (permalink / raw)
  To: dwz

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |NOTABUG
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Martin Liska from comment #2)
> All right, so it's likely nasm issue, there's reduced test-case:
> 
> $ cat cdef.asm
> %define ARCH_X86_64 1
> %ifndef public_prefix
> %endif
> %define WIN64  0
> %if WIN64 ; Windows x64 ;=================================================
>     %if vzeroupper_required
>     %endif
> %endif
> %macro BRANCH_INSTR 0-*
> %endmacro
> %if ARCH_X86_64
> %macro DUP4 1-*
> %endmacro
>     ret
> %endif ; ARCH_X86_64
> 
> $ cat a.c
> int main(int argc, char **argv)
> {
>   return 0;
> }
> 
> $ nasm -o cdef.o -f elf64 -F dwarf cdef.asm && gcc a.c -O2 -g -shared cdef.o
> -o x.so && dwz x.so
> 
> Apparently, cdef.o contains the section you're seeking for:
> 
> $ readelf -SW cdef.o | grep debug_loc
>   [11] .debug_loc        PROGBITS        0000000000000000 0005c0 000000 00  
> 0   0  1
> 

Yes, the section is there, but empty, so indeed an asm issue.

This ( https://bugzilla.nasm.us/show_bug.cgi?id=3392631 ) looks related.

Marking this resolved-notabug.

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
                   ` (3 preceding siblings ...)
  2021-03-16 10:49 ` vries at gcc dot gnu.org
@ 2021-03-16 11:12 ` mliska at suse dot cz
  2021-03-16 14:21 ` vries at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mliska at suse dot cz @ 2021-03-16 11:12 UTC (permalink / raw)
  To: dwz

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

--- Comment #5 from Martin Liska <mliska at suse dot cz> ---
> This ( https://bugzilla.nasm.us/show_bug.cgi?id=3392631 ) looks related.

Yep, thanks for the pointer!

> 
> Marking this resolved-notabug.

Sure.

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
                   ` (4 preceding siblings ...)
  2021-03-16 11:12 ` mliska at suse dot cz
@ 2021-03-16 14:21 ` vries at gcc dot gnu.org
  2021-03-16 14:23 ` mliska at suse dot cz
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-03-16 14:21 UTC (permalink / raw)
  To: dwz

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

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Martin Liska from comment #5)
> > This ( https://bugzilla.nasm.us/show_bug.cgi?id=3392631 ) looks related.
> 
> Yep, thanks for the pointer!
> 
> > 
> > Marking this resolved-notabug.
> 
> Sure.

FWIW, proposed a --devel-skip-producer option here (
https://sourceware.org/pipermail/dwz/2021q1/001121.html ).  When used on this
example with "--devel-skip-producer NASM", dwz manages to finish.

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
                   ` (5 preceding siblings ...)
  2021-03-16 14:21 ` vries at gcc dot gnu.org
@ 2021-03-16 14:23 ` mliska at suse dot cz
  2021-05-17  8:57 ` vries at gcc dot gnu.org
  2023-01-16 10:14 ` mliska at suse dot cz
  8 siblings, 0 replies; 10+ messages in thread
From: mliska at suse dot cz @ 2021-03-16 14:23 UTC (permalink / raw)
  To: dwz

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

--- Comment #7 from Martin Liska <mliska at suse dot cz> ---
> FWIW, proposed a --devel-skip-producer option here (
> https://sourceware.org/pipermail/dwz/2021q1/001121.html ).  When used on
> this example with "--devel-skip-producer NASM", dwz manages to finish.

Good proposal, I like it!

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
                   ` (6 preceding siblings ...)
  2021-03-16 14:23 ` mliska at suse dot cz
@ 2021-05-17  8:57 ` vries at gcc dot gnu.org
  2023-01-16 10:14 ` mliska at suse dot cz
  8 siblings, 0 replies; 10+ messages in thread
From: vries at gcc dot gnu.org @ 2021-05-17  8:57 UTC (permalink / raw)
  To: dwz

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

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Martin Liska from comment #7)
> > FWIW, proposed a --devel-skip-producer option here (
> > https://sourceware.org/pipermail/dwz/2021q1/001121.html ).  When used on
> > this example with "--devel-skip-producer NASM", dwz manages to finish.
> 
> Good proposal, I like it!

This has been committed, but to clarify: this is a developer-only option for
experimentation purposes.  There will be more work involved getting this
functionality into a release.  See f.i. comment at
https://sourceware.org/pipermail/dwz/2021q1/001138.html .

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

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

* [Bug default/27588] dwz: libxul.so: loclistptr attribute, yet no .debug_loc section
  2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
                   ` (7 preceding siblings ...)
  2021-05-17  8:57 ` vries at gcc dot gnu.org
@ 2023-01-16 10:14 ` mliska at suse dot cz
  8 siblings, 0 replies; 10+ messages in thread
From: mliska at suse dot cz @ 2023-01-16 10:14 UTC (permalink / raw)
  To: dwz

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

Martin Liska <mliska at suse dot cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://sourceware.org/bugz
                   |                            |illa/show_bug.cgi?id=27767

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

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

end of thread, other threads:[~2023-01-16 10:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16  9:17 [Bug default/27588] New: dwz: libxul.so: loclistptr attribute, yet no .debug_loc section mliska at suse dot cz
2021-03-16 10:08 ` [Bug default/27588] " vries at gcc dot gnu.org
2021-03-16 10:36 ` mliska at suse dot cz
2021-03-16 10:38 ` mliska at suse dot cz
2021-03-16 10:49 ` vries at gcc dot gnu.org
2021-03-16 11:12 ` mliska at suse dot cz
2021-03-16 14:21 ` vries at gcc dot gnu.org
2021-03-16 14:23 ` mliska at suse dot cz
2021-05-17  8:57 ` vries at gcc dot gnu.org
2023-01-16 10:14 ` mliska at suse dot cz

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