public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simark at simark dot ca" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/26828] SIGSEGV in follow_die_offset dwarf2/read.c:22950
Date: Tue, 03 Nov 2020 17:05:40 +0000	[thread overview]
Message-ID: <bug-26828-4717-grlj56Gm7g@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26828-4717@http.sourceware.org/bugzilla/>

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

--- Comment #9 from Simon Marchi <simark at simark dot ca> ---
Nils, could you try the following patch?

The issue lies with the fact that we have a DIE in a CU A referring to a DIE in
a CU B (using DW_AT_abstract_origin).  The DIEs for CU B are not loaded yet (or
rather, have been unloaded due to DWARF CU aging stuff), and we try to load
them using:

      /* If necessary, add it to the queue and load its DIEs.  */
      if (maybe_queue_comp_unit (cu, per_cu, per_objfile, cu->language))
        load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu (per_cu),
                             false, cu->language);

Since the CU is already queued for expansion, maybe_queue_comp_unit returns
false and we don't call load_full_comp_unit.  I think maybe_queue_comp_unit is
the wrong thing to call here, because "queuing for symtab expansion" is
unrelated to "loading the DIEs in memory".  We should rather check: "are the
DIEs for per_cu loaded into memory yet?  if not do it now", which is what the
patch below implements.


@@ -22937,12 +22939,15 @@ follow_die_offset (sect_offset sect_off, int
offset_in_dwz,
       per_cu = dwarf2_find_containing_comp_unit (sect_off, offset_in_dwz,
                                                 per_objfile);

-      /* If necessary, add it to the queue and load its DIEs.  */
-      if (maybe_queue_comp_unit (cu, per_cu, per_objfile, cu->language))
-       load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu (per_cu),
-                            false, cu->language);
-
       target_cu = per_objfile->get_cu (per_cu);
+      if (target_cu == nullptr)
+       {
+         load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu
(per_cu),
+                              false, cu->language);
+         target_cu = per_objfile->get_cu (per_cu);
+       }
+
+      gdb_assert (target_cu != nullptr);
     }
   else if (cu->dies == NULL)
     {

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

  parent reply	other threads:[~2020-11-03 17:05 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 10:42 [Bug gdb/26828] New: " nilsgladitz at gmail dot com
2020-11-02 13:25 ` [Bug gdb/26828] " simark at simark dot ca
2020-11-02 15:21 ` nilsgladitz at gmail dot com
2020-11-02 15:36 ` simark at simark dot ca
2020-11-03 11:36 ` nilsgladitz at gmail dot com
2020-11-03 13:37 ` simark at simark dot ca
2020-11-03 14:03 ` simark at simark dot ca
2020-11-03 14:32 ` simark at simark dot ca
2020-11-03 15:02 ` nilsgladitz at gmail dot com
2020-11-03 17:05 ` simark at simark dot ca [this message]
2020-11-03 19:45 ` nilsgladitz at gmail dot com
2020-11-03 19:52 ` simark at simark dot ca
2020-11-03 20:14 ` nilsgladitz at gmail dot com
2020-11-03 20:52 ` simark at simark dot ca
2020-11-04  7:43 ` nilsgladitz at gmail dot com
2020-11-04 16:53 ` simark at simark dot ca
2020-11-08 16:16 ` nilsgladitz at gmail dot com
2020-11-08 16:17 ` nilsgladitz at gmail dot com
2020-11-08 16:45 ` simark at simark dot ca
2020-11-10 14:15 ` simark at simark dot ca
2020-11-13 17:03 ` cvs-commit at gcc dot gnu.org
2020-11-13 17:22 ` simark at simark dot ca
2020-11-13 18:13 ` nilsgladitz at gmail dot com
2020-11-16 18:21 ` simark at simark dot ca
2020-11-17 19:13 ` simark at simark dot ca
2021-01-21  2:05 ` cvs-commit at gcc dot gnu.org
2021-02-20 19:35 ` ReD at idp dot it
2021-02-20 20:40 ` simark at simark dot ca
2021-02-23 18:39 ` cvs-commit at gcc dot gnu.org
2021-02-23 18:39 ` cvs-commit at gcc dot gnu.org
2021-02-23 23:32 ` cvs-commit at gcc dot gnu.org
2021-02-23 23:32 ` cvs-commit at gcc dot gnu.org
2021-02-23 23:32 ` simark at simark dot ca
2021-06-27 17:58 ` ahmedsayeed1982 at yahoo dot com
2021-08-10 12:45 ` ucelsanicin at yahoo dot com
2021-09-02 11:06 ` donipah907 at mtlcz dot com
2021-09-02 11:17 ` mark at klomp dot org
2021-09-06  9:08 ` focixujo at livinginsurance dot co.uk
2021-09-10 19:39 ` mehmetgelisin at aol dot com
2021-09-22 10:19 ` diheto5497 at secbuf dot com
2021-09-22 13:58 ` ReD at idp dot it
2021-09-28  1:20 ` crownfamilydentistry at hotmail dot com
2021-10-09 11:00 ` gulsenenginar at aol dot com
2021-10-17 19:48 ` vmireskazki at gmail dot com
2021-10-19  7:15 ` progonsaytu at gmail dot com
2021-10-24 10:03 ` glassmtech at ukr dot net
2021-11-24 13:44 ` allen at rockvalleymarketing dot com

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=bug-26828-4717-grlj56Gm7g@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).