Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hans <sungdgdhtryrt@gmail.com>
To: gdb-patches@sourceware.org
Cc: Hans <sungdgdhtryrt@gmail.com>, Tom Tromey <tom@tromey.com>
Subject: [PATCH] gdb internal fatal error while opening a binary built with gsplit-dwarf
Date: Fri, 22 Mar 2024 18:01:22 +0100	[thread overview]
Message-ID: <20240322170122.20010-1-sungdgdhtryrt@gmail.com> (raw)

Binaries built with '-gsplit-dwarf' and clang-16 using dwp with
dwarf version 5 will crash with a segmentation fault as a result
of a missing section read call in read_dwo_str_index(). Without
the split dwarf option everything works fine. The error occurs
from commit 65067f1c2c842f001017638c4fe53613d6656263 until latest,
previous commits work without problems. Steps to reproduce are in
the bug description.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31497
Reviewed-by: Tom Tromey <tom@tromey.com>
---
 gdb/dwarf2/read.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 7442094874c..a45bc512724 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -17501,6 +17501,9 @@ read_dwo_str_index (const struct die_reader_specs *reader, ULONGEST str_index)
   ULONGEST str_offsets_base;
   if (reader->cu->header.version >= 5)
     {
+      struct objfile *objfile = reader->cu->per_objfile->objfile;
+      reader->dwo_file->sections.str_offsets.read (objfile);
+
       /* We have a DWARF5 CU with a reference to a .debug_str_offsets section,
 	 so assume the .debug_str_offsets section is DWARF5 as well, and
 	 parse the header.  FIXME: Parse the header only once.  */
-- 
2.34.1


                 reply	other threads:[~2024-03-22 17:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240322170122.20010-1-sungdgdhtryrt@gmail.com \
    --to=sungdgdhtryrt@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox