public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/30718] [gdb/symtab] More index-cache data races
Date: Fri, 04 Aug 2023 00:26:23 +0000	[thread overview]
Message-ID: <bug-30718-4717-whrSDeDI67@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30718-4717@http.sourceware.org/bugzilla/>

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Fixed by the usual:
...
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 5f7d2dcd895..9dfc435e861 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -104,10 +104,10 @@ struct dwarf2_per_cu_data
       is_dwz (false),
       reading_dwo_directly (false),
       tu_read (false),
-      mark (false),
-      files_read (false),
       queued (false),
       m_header_read_in (false),
+      mark (false),
+      files_read (false),
       scanned (false)
   {
   }
@@ -150,14 +150,6 @@ struct dwarf2_per_cu_data
      This flag is only valid if is_debug_types is true.  */
   unsigned int tu_read : 1;

-  /* A temporary mark bit used when iterating over all CUs in
-     expand_symtabs_matching.  */
-  unsigned int mark : 1;
-
-  /* True if we've tried to read the file table.  There will be no
-     point in trying to read it again next time.  */
-  bool files_read : 1;
-
   /* Wrap the following in struct packed instead of bitfields to avoid
      data races when the bitfields end up on the same memory location
      (per C++ memory model).  */
@@ -176,6 +168,14 @@ struct dwarf2_per_cu_data
      it private at the moment.  */
   mutable packed<bool, 1> m_header_read_in;

+  /* A temporary mark bit used when iterating over all CUs in
+     expand_symtabs_matching.  */
+  packed<unsigned int, 1> mark;
+
+  /* True if we've tried to read the file table.  There will be no
+     point in trying to read it again next time.  */
+  packed<bool, 1> files_read;
+
 private:
   /* The unit type of this CU.  */
   std::atomic<packed<dwarf_unit_type, 1>> m_unit_type {(dwarf_unit_type)0};
...

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

  reply	other threads:[~2023-08-04  0:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04  0:21 [Bug symtab/30718] New: " vries at gcc dot gnu.org
2023-08-04  0:26 ` vries at gcc dot gnu.org [this message]
2023-08-04  0:27 ` [Bug symtab/30718] " vries at gcc dot gnu.org
2023-08-04 13:06 ` cvs-commit at gcc dot gnu.org
2023-08-04 13:06 ` cvs-commit at gcc dot gnu.org
2023-08-04 13:06 ` cvs-commit at gcc dot gnu.org
2023-08-04 13:08 ` vries at gcc dot gnu.org

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-30718-4717-whrSDeDI67@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).