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 gdb/29286] SUMMARY: ThreadSanitizer: data race gdb/dwarf2/read.c:4100 in dw_expand_symtabs_matching_file_matcher
Date: Sat, 25 Jun 2022 12:14:02 +0000	[thread overview]
Message-ID: <bug-29286-4717-ZavJtGqAQq@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29286-4717@http.sourceware.org/bugzilla/>

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

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #3)
> Hmm, AFAIU, building with 0 worker threads would guarantee this order, so
> the entry->per_cu->lang will then always be unknown when tested in
> cooked-index?

Not quite.  When building with 0 worker threads, I observed the following
order:
- prepare_one_comp_unit is called for the first time, and
  cu->per_cu->language is set
- in cooked_index::do_finalize, the cu->per_cu->language field is read
- then prepare_one_comp_unit is called once more, overwriting the
  cu->per_cu->language field with the same value

AFAICT, the race condition that thread sanitizer complains about is that the
second write happens after the read, but could happen before it.

I've tried only setting the the cu->per_cu->lang field if it's unknown, and
that seems to fix this particular problem.

But when re-introducing the bitfields, the original problem reappears.

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

  parent reply	other threads:[~2022-06-25 12:14 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-25  9:19 [Bug gdb/29286] New: " vries at gcc dot gnu.org
2022-06-25  9:19 ` [Bug gdb/29286] " vries at gcc dot gnu.org
2022-06-25  9:20 ` vries at gcc dot gnu.org
2022-06-25  9:57 ` vries at gcc dot gnu.org
2022-06-25 11:10 ` vries at gcc dot gnu.org
2022-06-25 11:29 ` vries at gcc dot gnu.org
2022-06-25 12:14 ` vries at gcc dot gnu.org [this message]
2022-06-25 12:26 ` tromey at sourceware dot org
2022-06-25 14:17 ` vries at gcc dot gnu.org
2022-06-25 16:03 ` vries at gcc dot gnu.org
2022-06-25 16:17 ` tromey at sourceware dot org
2022-06-25 16:19 ` tromey at sourceware dot org
2022-06-25 20:33 ` vries at gcc dot gnu.org
2022-06-25 21:26 ` vries at gcc dot gnu.org
2022-06-25 22:38 ` vries at gcc dot gnu.org
2022-06-26 13:16 ` vries at gcc dot gnu.org
2022-06-26 13:36 ` vries at gcc dot gnu.org
2022-06-28  5:47 ` vries at gcc dot gnu.org
2022-06-28  5:48 ` vries at gcc dot gnu.org
2022-06-28 12:38 ` vries at gcc dot gnu.org
2022-06-29 13:12 ` vries at gcc dot gnu.org
2022-06-29 15:34 ` vries at gcc dot gnu.org
2022-07-12 14:59 ` vries at gcc dot gnu.org
2022-07-13 17:01 ` tromey at sourceware dot org
2022-07-14  7:10 ` vries at gcc dot gnu.org
2022-07-14  7:13 ` vries at gcc dot gnu.org
2022-07-14 18:50 ` vries at gcc dot gnu.org
2022-07-14 18:53 ` vries at gcc dot gnu.org
2022-09-23 20:44 ` tromey at sourceware dot org
2022-09-24  5:39 ` 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-29286-4717-ZavJtGqAQq@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).