public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
@ 2022-05-16  8:10 jeanmichael.celerier at gmail dot com
  2022-05-16 12:43 ` [Bug c++/29153] " simark at simark dot ca
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jeanmichael.celerier at gmail dot com @ 2022-05-16  8:10 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 29153
           Summary: DW_FORM_rnglistx index pointing outside of
                    .debug_rnglists offset array
           Product: gdb
           Version: 12.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: jeanmichael.celerier at gmail dot com
  Target Milestone: ---

Opening a new issue following the discussion at the end of
https://sourceware.org/bugzilla/show_bug.cgi?id=26813

I am building with clang-14, against libstdc++-12 on Arch Linux.

There is likely something deeply wrong, because lldb sometimes works, but also
sometimes crashes on that code.

The only information I have currently is 

DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array [in
module
/tmp/build-developer-llvm14-mold-qt5-rhi/3rdparty/libossia/src/libossia.so]

and that .so is a hundred megabytes or so, I'm trying to get a better repro...

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
@ 2022-05-16 12:43 ` simark at simark dot ca
  2022-05-16 13:28 ` jeanmichael.celerier at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: simark at simark dot ca @ 2022-05-16 12:43 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simark at simark dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simark at simark dot ca

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
Hi Jean-Michaël,

If you're willing to make a local build of GDB, here is what I would do, as a
GDB developer:

 - Break in GDB when it prints that message
 - Go up the stack a bit to see which DIE in which CU we are processing, see
what the value of the DW_FORM_rnglistx attribute is
 - Look at the output of readelf/llvm-dwarfdump to see if that value makes
sense for the rnglist of that CU (if it's really out of bounds or not)

>From there, it would be clearer if it's a GDB bug or a debug info bug.

Alternatively, if you manage to make a small enough reproducer, I can take a
look.

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
  2022-05-16 12:43 ` [Bug c++/29153] " simark at simark dot ca
@ 2022-05-16 13:28 ` jeanmichael.celerier at gmail dot com
  2022-05-16 13:30 ` jeanmichael.celerier at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jeanmichael.celerier at gmail dot com @ 2022-05-16 13:28 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Jean-Michaël Celerier <jeanmichael.celerier at gmail dot com> ---
Hm, I just tried building gdb locally, but when I gdb gdb I get a segfault of
the inner gdb haha.

https://paste.ofcode.org/rDbFN5AeBLpu5rJ52ZjqvV

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
  2022-05-16 12:43 ` [Bug c++/29153] " simark at simark dot ca
  2022-05-16 13:28 ` jeanmichael.celerier at gmail dot com
@ 2022-05-16 13:30 ` jeanmichael.celerier at gmail dot com
  2022-05-16 13:36 ` tromey at sourceware dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jeanmichael.celerier at gmail dot com @ 2022-05-16 13:30 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Jean-Michaël Celerier <jeanmichael.celerier at gmail dot com> ---
I get the same when trying with lldb as "parent" debugger. But running the
built gdb on my program itself works (well, I hit the original bug but at least
gdb itself does not segfault). So maybe this is just some security that I have
to disable somewhere to enable gdb itself to be debugged ?

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
                   ` (2 preceding siblings ...)
  2022-05-16 13:30 ` jeanmichael.celerier at gmail dot com
@ 2022-05-16 13:36 ` tromey at sourceware dot org
  2022-05-16 13:44 ` jeanmichael.celerier at gmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at sourceware dot org @ 2022-05-16 13:36 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
> #1  0x00007ffff7cf8641 in GC_init () from /usr/lib/libgc.so.1

The garbage collector used by Guile causes a SEGV during startup.
This is intentional and is caught and ignored.  So, when you
see this in the stack trace you should just "continue".

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
                   ` (3 preceding siblings ...)
  2022-05-16 13:36 ` tromey at sourceware dot org
@ 2022-05-16 13:44 ` jeanmichael.celerier at gmail dot com
  2022-05-16 13:51 ` jeanmichael.celerier at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jeanmichael.celerier at gmail dot com @ 2022-05-16 13:44 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Jean-Michaël Celerier <jeanmichael.celerier at gmail dot com> ---
Okay, I have the following stack trace: what can I print / at which stack frame
should I go to see useful information ?

Thread 1 "gdb" hit Breakpoint 1, error (fmt=0x555555f1b048 "DW_FORM_rnglistx
index pointing outside of .debug_rnglists offset array [in module %s]") at
../../gdbsupport/errors.cc:39
39      ../../gdbsupport/errors.cc: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  error (fmt=0x555555f1b048 "DW_FORM_rnglistx index pointing outside of
.debug_rnglists offset array [in module %s]") at ../../gdbsupport/errors.cc:39
#1  0x00005555558b1837 in read_rnglist_index (cu=0x5555565e9990,
rnglist_index=0, tag=DW_TAG_skeleton_unit) at ../../gdb/dwarf2/read.c:19920
#2  0x00005555558b1a03 in read_attribute_reprocess (reader=0x7fffffffcc90,
attr=0x5555568d3858, tag=DW_TAG_skeleton_unit) at ../../gdb/dwarf2/read.c:19965
#3  0x00005555558af463 in read_full_die_1 (reader=0x7fffffffcc90,
diep=0x7fffffffccd0, info_ptr=0x5555566fd215 ",", num_extra_attrs=0) at
../../gdb/dwarf2/read.c:18913
#4  0x00005555558af500 in read_full_die (reader=0x7fffffffcc90,
diep=0x7fffffffccd0, info_ptr=0x5555566fd1f9 "\001\355\001") at
../../gdb/dwarf2/read.c:18930
#5  0x000055555588cfee in cutu_reader::cutu_reader (this=0x7fffffffcc90,
this_cu=0x5555566fd4d0, per_objfile=0x555556454460,
abbrev_table=0x5555566f54a0, existing_cu=0x5555565e9990, skip_partial=false) at
../../gdb/dwarf2/read.c:6656
#6  0x000055555588f92a in load_partial_comp_unit (this_cu=0x5555566fd4d0,
per_objfile=0x555556454460, existing_cu=0x5555565e9990) at
../../gdb/dwarf2/read.c:7523
#7  0x00005555558b0c98 in find_partial_die (sect_off=(unknown: 0xa87bd),
offset_in_dwz=0, cu=0x5555565e9990) at ../../gdb/dwarf2/read.c:19578
#8  0x00005555558b0f95 in partial_die_info::fixup (this=0x555556820bc0,
cu=0x5555565e9990) at ../../gdb/dwarf2/read.c:19678
#9  0x000055555588fff8 in scan_partial_symbols (first_die=0x555556756b50,
lowpc=0x7fffffffceb8, highpc=0x7fffffffcec0, set_addrmap=0, cu=0x5555565e9990)
at ../../gdb/dwarf2/read.c:7649
#10 0x000055555588e0f6 in process_psymtab_comp_unit_reader
(reader=0x7fffffffcf80, info_ptr=0x7fffa35bcb69 "\002",
comp_unit_die=0x5555566f3d50, pretend_language=language_minimal) at
../../gdb/dwarf2/read.c:7040
#11 0x000055555588e5a8 in process_psymtab_comp_unit (this_cu=0x5555566fd4d0,
per_objfile=0x555556454460, want_partial_unit=false,
pretend_language=language_minimal) at ../../gdb/dwarf2/read.c:7146
#12 0x000055555588f6b4 in dwarf2_build_psymtabs_hard
(per_objfile=0x555556454460) at ../../gdb/dwarf2/read.c:7486
#13 0x000055555588a374 in dwarf2_build_psymtabs (objfile=0x555556431770,
psf=0x555556606ad0) at ../../gdb/dwarf2/read.c:5651
#14 0x00005555558c5fee in lazy_dwarf_reader::read_partial_symbols
(this=0x555556606ad0, objfile=0x555556431770) at ../../gdb/dwarf2/read.c:2089
#15 0x0000555555bfc816 in objfile::require_partial_symbols
(this=0x555556431770, verbose=false) at ../../gdb/symfile-debug.c:541
#16 0x0000555555c001db in read_symbols (objfile=0x555556431770, add_flags=...)
at ../../gdb/symfile.c:795
#17 0x0000555555c00705 in syms_from_objfile_1 (objfile=0x555556431770,
addrs=0x7fffffffd290, add_flags=...) at ../../gdb/symfile.c:968
#18 0x0000555555c007dd in syms_from_objfile (objfile=0x555556431770, addrs=0x0,
add_flags=...) at ../../gdb/symfile.c:985
#19 0x0000555555c00c51 in symbol_file_add_with_addrs (abfd=0x5555565dd260,
name=0x5555565cebc0 "./ossia-score", add_flags=..., addrs=0x0, flags=...,
parent=0x0) at ../../gdb/symfile.c:1088
#20 0x0000555555c00f8e in symbol_file_add_from_bfd (abfd=0x5555565dd260,
name=0x5555565cebc0 "./ossia-score", add_flags=..., addrs=0x0, flags=...,
parent=0x0) at ../../gdb/symfile.c:1168
#21 0x0000555555c00ff7 in symbol_file_add (name=0x5555565cebc0 "./ossia-score",
add_flags=..., addrs=0x0, flags=...) at ../../gdb/symfile.c:1181
#22 0x0000555555c010f3 in symbol_file_add_main_1 (args=0x5555565cebc0
"./ossia-score", add_flags=..., flags=..., reloff=0) at
../../gdb/symfile.c:1205
#23 0x0000555555c02523 in symbol_file_command (args=0x5555563aff35
"./ossia-score", from_tty=1) at ../../gdb/symfile.c:1653
#24 0x0000555555903d3d in file_command (arg=0x5555563aff35 "./ossia-score",
from_tty=1) at ../../gdb/exec.c:554
#25 0x0000555555791ee6 in do_simple_func (args=0x5555563aff35 "./ossia-score",
from_tty=1, c=0x5555564095e0) at ../../gdb/cli/cli-decode.c:95
#26 0x000055555579736f in cmd_func (cmd=0x5555564095e0, args=0x5555563aff35
"./ossia-score", from_tty=1) at ../../gdb/cli/cli-decode.c:2514
#27 0x0000555555c78240 in execute_command (p=0x5555563aff41 "e", from_tty=1) at
../../gdb/top.c:702
#28 0x0000555555900ba3 in command_handler (command=0x5555563aff30 "") at
../../gdb/event-top.c:597
#29 0x000055555590108d in command_line_handler (rl=...) at
../../gdb/event-top.c:800
#30 0x0000555555ca3c96 in tui_command_line_handler (rl=...) at
../../gdb/tui/tui-interp.c:278
#31 0x0000555555900275 in gdb_rl_callback_handler (rl=0x5555565e7160 "file
./ossia-score") at ../../gdb/event-top.c:229
#32 0x00007ffff7f55e18 in rl_callback_read_char () from
/usr/lib/libreadline.so.8
#33 0x0000555555900067 in gdb_rl_callback_read_char_wrapper_noexcept () at
../../gdb/event-top.c:187
#34 0x0000555555900131 in gdb_rl_callback_read_char_wrapper
(client_data=0x5555563afb40) at ../../gdb/event-top.c:204
#35 0x00005555559009b0 in stdin_event_handler (error=0,
client_data=0x5555563afb40) at ../../gdb/event-top.c:524
#36 0x0000555555e4d7cf in handle_file_event (file_ptr=0x5555565c7800,
ready_mask=1) at ../../gdbsupport/event-loop.cc:574
#37 0x0000555555e4ddaa in gdb_wait_for_event (block=1) at
../../gdbsupport/event-loop.cc:700
#38 0x0000555555e4cbe8 in gdb_do_one_event () at
../../gdbsupport/event-loop.cc:237
#39 0x0000555555a3cbde in start_event_loop () at ../../gdb/main.c:421
#40 0x0000555555a3cd2a in captured_command_loop () at ../../gdb/main.c:481
#41 0x0000555555a3e8df in captured_main (data=0x7fffffffdb60) at
../../gdb/main.c:1351
#42 0x0000555555a3e945 in gdb_main (args=0x7fffffffdb60) at
../../gdb/main.c:1366
#43 0x0000555555631742 in main (argc=1, argv=0x7fffffffdc98) at
../../gdb/gdb.c:32
(gdb)

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
                   ` (4 preceding siblings ...)
  2022-05-16 13:44 ` jeanmichael.celerier at gmail dot com
@ 2022-05-16 13:51 ` jeanmichael.celerier at gmail dot com
  2022-05-16 16:12 ` simark at simark dot ca
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jeanmichael.celerier at gmail dot com @ 2022-05-16 13:51 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #6 from Jean-Michaël Celerier <jeanmichael.celerier at gmail dot com> ---
I tried to print the values of this_cu, per_objfile and diep (I assume "die
pointer") but I can't seem to see any object file name in there...

here is what I tried:

(gdb) p cu
$1 = (dwarf2_cu *) 0x5555565e9990
(gdb) p *cu
$2 = {header = {length = 44, version = 5 '\005', addr_size = 8 '\b',
signed_addr_p = 0 '\000', abbrev_sect_off = (unknown: 0x270), offset_size = 4,
initial_length_size = 4, unit_type = DW_UT_skeleton, first_die_cu_offset =
(unknown: 0x14), 
    sect_off = (unknown: 0x965), type_cu_offset_in_tu = 0, signature =
13299366176265434227}, base_address = {{m_dummy = {<No data fields>}, m_item =
0, dont_use = 0 '\000'}, m_instantiated = true}, language_defn = 0x55555636af50
<cplus_language_defn>, 
  producer = 0x7fffa35355e9 "clang version 14.0.0", m_builder =
std::unique_ptr<buildsym_compunit> = {get() = 0x0}, m_dependencies = 0x0,
list_in_scope = 0x0, partial_dies = 0x5555566f3e00, comp_unit_obstack =
{<obstack> = {chunk_size = 4064, 
      chunk = 0x5555568d3360, object_base = 0x5555568d3890 "", next_free =
0x5555568d3890 "", chunk_limit = 0x5555568d4340 "", temp = {i =
7809933825093420288, p = 0x6c62756f64004500}, alignment_mask = 15, chunkfun = {
    plain = 0x5555556a014d <xmalloc(size_t)>, extra = 0x5555556a014d
<xmalloc(size_t)>}, freefun = {plain = 0x55555567570e <xfree<void>(void*)>,
extra = 0x55555567570e <xfree<void>(void*)>}, extra_arg = 0x5555565e9a60,
use_extra_arg = 0, maybe_empty_object = 0, 
      alloc_failed = 0}, <No data fields>}, per_cu = 0x5555566fd4d0,
per_objfile = 0x555556454460, last_used = 0, die_hash = 0x0, dies = 0x0,
line_header = 0x0, line_header_die_owner = 0x0, method_list = std::vector of
length 0, capacity 0, 
  call_site_htab = 0x0, dwo_unit = 0x555556717610, addr_base = {{m_dummy = {<No
data fields>}, m_item = 8, dont_use = 8 '\b'}, m_instantiated = true},
gnu_ranges_base = 0, rnglists_base = 45, loclist_base = 0, 
  rust_unions = std::vector of length 0, capacity 0, str_offsets_base =
{{m_dummy = {<No data fields>}, m_item = 8, dont_use = 8 '\b'}, m_instantiated
= true}, m_mark = false, has_loclist = false, checked_producer = false, 
  producer_is_gxx_lt_4_6 = false, producer_is_gcc_lt_4_3 = false,
producer_is_gcc_11 = false, producer_is_icc = false, producer_is_icc_lt_14 =
false, producer_is_codewarrior = false, processing_has_namespace_info = false,
load_all_dies = true}
(gdb) f 5
#5  0x000055555588cfee in cutu_reader::cutu_reader (this=0x7fffffffcc90,
this_cu=0x5555566fd4d0, per_objfile=0x555556454460,
abbrev_table=0x5555566f54a0, existing_cu=0x5555565e9990, skip_partial=false) at
../../gdb/dwarf2/read.c:6656
6656    in ../../gdb/dwarf2/read.c
(gdb) p this_cu
$3 = (dwarf2_per_cu_data *) 0x5555566fd4d0
(gdb) p *this_cu
$4 = {sect_off = (unknown: 0x965), length = 48, dwarf_version = 5 '\005',
queued = 0, is_debug_types = 0, is_dwz = 0, reading_dwo_directly = 0, tu_read =
0, m_header_read_in = false, unit_type = DW_UT_compile, lang = language_cplus,
index = 5, 
  section = 0x5555566fb450, per_bfd = 0x5555566fb3f0, m_header = {length = 0,
version = 0 '\000', addr_size = 0 '\000', signed_addr_p = 0 '\000',
abbrev_sect_off = 0, offset_size = 0, initial_length_size = 0, unit_type = 0,
first_die_cu_offset = 0, 
    sect_off = 0, type_cu_offset_in_tu = 0, signature = 0}, fnd =
std::unique_ptr<file_and_directory> = {get() = 0x55555657db20}, v = {psymtab =
0x555556732950, quick = 0x555556732950}, imported_symtabs = 0x0}
(gdb) p *this
$5 = {<die_reader_specs> = {abfd = 0x5555565dd260, cu = 0x5555565e9990,
dwo_file = 0x0, die_section = 0x5555566fb450, buffer = 0x5555566fc880 "$",
buffer_end = 0x5555566fd2c8 "\201", abbrev_table = 0x5555566f54a0}, 
  info_ptr = 0x5555566fd1f9 "\001\355\001", comp_unit_die = 0x0, dummy_p =
false, m_this_cu = 0x5555566fd4d0, m_new_cu = std::unique_ptr<dwarf2_cu> =
{get() = 0x0}, m_abbrev_table_holder = std::unique_ptr<abbrev_table> = {get() =
0x5555566f54a0}, 
  m_dwo_abbrev_table = std::unique_ptr<abbrev_table> = {get() = 0x0}}
(gdb) f 18
#18 0x0000555555c007dd in syms_from_objfile (objfile=0x555556431770, addrs=0x0,
add_flags=...) at ../../gdb/symfile.c:985
985     ../../gdb/symfile.c: Le dossier n'est pas vide.
(gdb) p *objfile
$6 = {original_name = 0x555556630bc0
"/tmp/build-developer-llvm14-mold-qt5-rhi/./ossia-score", addr_low = 0, flags =
{m_enum_value = (OBJF_REORDERED | OBJF_USERLOADED | OBJF_PSYMTABS_READ |
OBJF_MAINLINE)}, pspace = 0x5555563b73b0, 
  compunit_symtabs = 0x0, obfd = 0x5555565dd260, per_bfd = 0x5555565f6020,
mtime = 1652630869, objfile_obstack = {chunk_size = 4064, chunk =
0x555556630bb0, object_base = 0x555556631050 "", next_free = 0x555556631050 "",
chunk_limit = 0x555556631b90 "", 
    temp = {i = 0, p = 0x0}, alignment_mask = 15, chunkfun = {plain =
0x5555556a014d <xmalloc(size_t)>, extra = 0x5555556a014d <xmalloc(size_t)>},
freefun = {plain = 0x555555ab21bd <xfree<void>(void*)>, extra = 0x555555ab21bd
<xfree<void>(void*)>}, 
    extra_arg = 0x0, use_extra_arg = 0, maybe_empty_object = 0, alloc_failed =
0}, sf = 0x55555633a040 <elf_sym_fns>, qf = std::forward_list = {[0] =
std::unique_ptr<quick_symbol_functions> = {get() = 0x555556606ad0}},
registry_data = {
    data = 0x5555565f3e60, num_data = 26}, section_offsets = std::vector of
length 46, capacity 46 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0}, 
  sect_index_text = 12, sect_index_data = 26, sect_index_bss = 29,
sect_index_rodata = 17, sections = 0x555556630c00, sections_end =
0x555556631050, separate_debug_objfile = 0x0, separate_debug_objfile_backlink =
0x0, separate_debug_objfile_link = 0x0, 
  stats = {n_syms = 0, n_stabs = 0, n_types = 0, sz_strtab = 0},
template_symbols = 0x0, static_links = std::unique_ptr<htab> = {get() = 0x0},
jiter_data = std::unique_ptr<jiter_objfile_data> = {get() = 0x0}, 
  jited_data = std::unique_ptr<jited_objfile_data> = {get() = 0x0},
skip_jit_symbol_lookup = false}
(gdb) f 5
#5  0x000055555588cfee in cutu_reader::cutu_reader (this=0x7fffffffcc90,
this_cu=0x5555566fd4d0, per_objfile=0x555556454460,
abbrev_table=0x5555566f54a0, existing_cu=0x5555565e9990, skip_partial=false) at
../../gdb/dwarf2/read.c:6656
6656    ../../gdb/dwarf2/read.c: Aucun fichier ou dossier de ce type.
(gdb) p *per_objfile 
$7 = {objfile = 0x555556431770, per_bfd = 0x5555566fb3f0, die_type_hash =
std::unique_ptr<htab> = {get() = 0x0}, line_header_hash = std::unique_ptr<htab>
= {get() = 0x0}, sym_cu = 0x0, m_symtabs = std::vector of length 0, capacity 0, 
  m_type_units = std::unordered_map with 0 elements, m_type_map =
std::unordered_map with 0 elements, m_dwarf2_cus = std::unordered_map with 0
elements}
(gdb) f 3
#3  0x00005555558af463 in read_full_die_1 (reader=0x7fffffffcc90,
diep=0x7fffffffccd0, info_ptr=0x5555566fd215 ",", num_extra_attrs=0) at
../../gdb/dwarf2/read.c:18913
18913   in ../../gdb/dwarf2/read.c
(gdb) p *this
No symbol "this" in current context.
(gdb) p *diep
$8 = (die_info *) 0x0
(gdb) f 4
#4  0x00005555558af500 in read_full_die (reader=0x7fffffffcc90,
diep=0x7fffffffccd0, info_ptr=0x5555566fd1f9 "\001\355\001") at
../../gdb/dwarf2/read.c:18930
18930   in ../../gdb/dwarf2/read.c
(gdb) p *diep
$9 = (die_info *) 0x0
(gdb) p *info_ptr
$10 = 1 '\001'

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
                   ` (5 preceding siblings ...)
  2022-05-16 13:51 ` jeanmichael.celerier at gmail dot com
@ 2022-05-16 16:12 ` simark at simark dot ca
  2022-05-16 16:31 ` jeanmichael.celerier at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: simark at simark dot ca @ 2022-05-16 16:12 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Simon Marchi <simark at simark dot ca> ---
>From your previous comment, the objfile is
/tmp/build-developer-llvm14-mold-qt5-rhi/3rdparty/libossia/src/libossia.so,
it's that file that you should inspect with readelf/llvm-dwarfdump.

Print the "die->sect_off" in the read_full_die_1 frame. "diep" is an output
parameter, only set on exit, that's why it shows 0.  Using the "die->sect_off"
value, you can find the current DIE in the readelf/llvm-dwarfdump output.

>From your backtrace, I see you are dealing with split DWARF (I see
DW_TAG_skeleton_unit).  It is possible that this plays a role in the problem. 
It looks like GDB is reading an attribute in the "main" file, the one that
references externals DWOs.  Attributes in both the skeleton unit DIE and the
split unit can contain references to rnglists.  Different toolchains have
historically done different things here.

The consensus is that rnglists referenced in the skeleton unit DIE should be
placed in the "main" file, and the rnglists referenced in the split unit (in
the DWO file) should be placed in the DWO file.  In other words, there's no
rnglist reference going from the main file to the DWO or vice versa.  This has
been clarified here:

https://dwarfstd.org/ShowIssue.php?issue=210310.1

So, an hypothesis, maybe your toolchain places the rnglist referenced by the
skeleton unit DIE (which is in the main file) in the DWO file, and that's why
GDB doesn't find it.

I think that GCC used to (maybe it still does it) place all rnglists in the
main file.  So I think we do support DW_FORM_rnglistx attributes in the DWO
file referencing rnglists in the main file.  But we don't support the other way
around.

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
                   ` (6 preceding siblings ...)
  2022-05-16 16:12 ` simark at simark dot ca
@ 2022-05-16 16:31 ` jeanmichael.celerier at gmail dot com
  2022-05-16 16:47 ` simark at simark dot ca
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jeanmichael.celerier at gmail dot com @ 2022-05-16 16:31 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #8 from Jean-Michaël Celerier <jeanmichael.celerier at gmail dot com> ---
Ah okay, I thought that objfile refered to "object file" in the usual .o sense
and not shared object ; libossia.so is 170 megabytes so I was hoping that there
would be a way to narrow things a bit more. I'll try without -gsplit-dwarf and
report.

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
                   ` (7 preceding siblings ...)
  2022-05-16 16:31 ` jeanmichael.celerier at gmail dot com
@ 2022-05-16 16:47 ` simark at simark dot ca
  2022-06-15 13:42 ` jeanmichael.celerier at gmail dot com
  2022-11-18 12:22 ` jordan at jwillikers dot com
  10 siblings, 0 replies; 12+ messages in thread
From: simark at simark dot ca @ 2022-05-16 16:47 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from Simon Marchi <simark at simark dot ca> ---
(In reply to Jean-Michaël Celerier from comment #8)
> Ah okay, I thought that objfile refered to "object file" in the usual .o
> sense and not shared object

I understand the confusion.  A .o file would be a "compilation unit" (or CU) in
this context.

> ; libossia.so is 170 megabytes so I was hoping
> that there would be a way to narrow things a bit more.

Well, by getting the DIE offset, that brings you to a specific CU.  You can see
the offset of the beginning of the CU by printing "cu->per_cu->sect_off" in the
read_attribute_reprocess frame.

With an objfile this large, it can take quite some time for readelf or
llvm-dwarfdump to dump it all.  So I usually dump it to a file:

  readelf --debug-dump obj > file
  llvm-dwarfdump obj > file

and then search for offsets in that file using my text editor or less, which
are pretty good for searching in very large files.

> I'll try without
> -gsplit-dwarf and report.

Ok, that would be good to try.  Although if the issue is really with
-gsplit-dwarf, we'll want to find the root case, not just ignore it ;).

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
                   ` (8 preceding siblings ...)
  2022-05-16 16:47 ` simark at simark dot ca
@ 2022-06-15 13:42 ` jeanmichael.celerier at gmail dot com
  2022-11-18 12:22 ` jordan at jwillikers dot com
  10 siblings, 0 replies; 12+ messages in thread
From: jeanmichael.celerier at gmail dot com @ 2022-06-15 13:42 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #10 from Jean-Michaël Celerier <jeanmichael.celerier at gmail dot com> ---
I can confirm that it works correctly without -gsplit-dwarf

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

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

* [Bug c++/29153] DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array
  2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
                   ` (9 preceding siblings ...)
  2022-06-15 13:42 ` jeanmichael.celerier at gmail dot com
@ 2022-11-18 12:22 ` jordan at jwillikers dot com
  10 siblings, 0 replies; 12+ messages in thread
From: jordan at jwillikers dot com @ 2022-11-18 12:22 UTC (permalink / raw)
  To: gdb-prs

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

Jordan Williams <jordan at jwillikers dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jordan at jwillikers dot com

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

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

end of thread, other threads:[~2022-11-18 12:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-16  8:10 [Bug c++/29153] New: DW_FORM_rnglistx index pointing outside of .debug_rnglists offset array jeanmichael.celerier at gmail dot com
2022-05-16 12:43 ` [Bug c++/29153] " simark at simark dot ca
2022-05-16 13:28 ` jeanmichael.celerier at gmail dot com
2022-05-16 13:30 ` jeanmichael.celerier at gmail dot com
2022-05-16 13:36 ` tromey at sourceware dot org
2022-05-16 13:44 ` jeanmichael.celerier at gmail dot com
2022-05-16 13:51 ` jeanmichael.celerier at gmail dot com
2022-05-16 16:12 ` simark at simark dot ca
2022-05-16 16:31 ` jeanmichael.celerier at gmail dot com
2022-05-16 16:47 ` simark at simark dot ca
2022-06-15 13:42 ` jeanmichael.celerier at gmail dot com
2022-11-18 12:22 ` jordan at jwillikers dot com

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