public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/28004] New: DW_AT_ranges with form DW_FORM_sec_offset problem
@ 2021-06-22  5:26 simark at simark dot ca
  2021-06-22  5:26 ` [Bug gdb/28004] " simark at simark dot ca
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: simark at simark dot ca @ 2021-06-22  5:26 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 28004
           Summary: DW_AT_ranges with form DW_FORM_sec_offset problem
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simark at simark dot ca
  Target Milestone: ---

Using the repro files I will provide subsequently (it might be a bit large, I
might have to host it externally), extracted to /tmp/repro, run this a first
time:

$ ./gdb -nx --data-directory=data-directory -iex "set index-cache on" -iex "set
sysroot /tmp/repro" /tmp/repro/gdb  /tmp/repro/core -ex bt -batch
...
warning: (Internal error: pc 0x7ff8feb2c21d in read in psymtab, but not in
symtab.)
...

This message is not expected and is already a symptom.  Run it a second time,
this time the index from the index-cache gets picked up.

$ ./gdb -nx --data-directory=data-directory -iex "set index-cache on" -iex "set
sysroot /tmp/repro" /tmp/repro/gdb  /tmp/repro/core -ex bt -batch
...
/home/smarchi/src/binutils-gdb/gdb/dwarf2/read.c:5014: internal-error:
compunit_symtab* dw2_find_pc_sect_compunit_symtab(objfile*,
bound_minimal_symbol, CORE_ADDR, obj_section*, int): Assertion `result != NULL'
failed.
...

Bisects to:

commit 9f6c202e573b796a9e7328cc5fdab7c0c63776bf                                 
Author: Tom de Vries <tdevries@suse.de>                                         
Date:   Mon Jan 25 16:32:31 2021 +0100                                          

    [gdb/symtab] Handle DW_AT_ranges with DW_FORM_sec_off in partial DIE

The test binary happens to be a gdb executable I was trying to debug, but it
doesn't really matter.  I generated a core from it to make the problem easy to
reproduce.  I included only the necessary libraries from my system to allow
reproducing.  They are from Arch Linux x86-64 packages:

 - libc-2.33.so from package glibc 2.33-5
 - libstdc++.so.6.0.29 from package gcc-libs 11.1.0-1

The main point is that libstdc++.so contains DWARF5 debug information, with
DW_AT_ranges using DW_FORM_sec_offset form.  It looks like we are processing
the ranges wrong when using the psymtab reader (hence the strange warning we
get the first time).  And that makes us produce an invalid index in the cache,
which, when we load the second time, confuses the GDB index reader.

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

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

end of thread, other threads:[~2021-08-06 16:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22  5:26 [Bug gdb/28004] New: DW_AT_ranges with form DW_FORM_sec_offset problem simark at simark dot ca
2021-06-22  5:26 ` [Bug gdb/28004] " simark at simark dot ca
2021-06-22  5:29 ` simark at simark dot ca
2021-06-25  7:03 ` vries at gcc dot gnu.org
2021-06-25 12:47 ` vries at gcc dot gnu.org
2021-06-25 14:23 ` vries at gcc dot gnu.org
2021-06-25 14:30 ` vries at gcc dot gnu.org
2021-06-25 21:40 ` vries at gcc dot gnu.org
2021-06-27 13:14 ` simark at simark dot ca
2021-07-26 16:17 ` vries at gcc dot gnu.org
2021-07-29 19:19 ` simark at simark dot ca
2021-07-29 21:27 ` vries at gcc dot gnu.org
2021-08-03 20:14 ` vries at gcc dot gnu.org
2021-08-04 14:19 ` vries at gcc dot gnu.org
2021-08-06 14:44 ` cvs-commit at gcc dot gnu.org
2021-08-06 16:02 ` cvs-commit at gcc dot gnu.org
2021-08-06 16:05 ` [Bug symtab/28004] " 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).