From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tromey@adacore.com>,
Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2 1/6] [gdb/symtab] Fix data race on index_cache::m_enabled
Date: Fri, 4 Aug 2023 02:08:04 +0200 [thread overview]
Message-ID: <079ff325-8cec-7df7-0efc-e458aacda534@suse.de> (raw)
In-Reply-To: <87v8dxdyzm.fsf@tromey.com>
On 8/2/23 21:29, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> writes:
>
> Tom> With gdb build with -fsanitize=thread and test-case gdb.base/index-cache.exp I
> Tom> run into:
> [race]
>
> Tom> Fix this by capturing the value of index_cache::m_enabled in the main thread,
> Tom> and using the captured value in the worker thread.
>
> Thanks for the patch. I have some stylistic nits but otherwise it seems
> fine to me.
>
> Tom> + struct index_cache_store_context ctx (global_index_cache);
>
> I think we tend to avoid the struct/class keyword in cases like this now.
>
> Tom> + const struct index_cache_store_context &ctx)
>
> ... basically everywhere.
>
> Tom> +index_cache_store_context::index_cache_store_context (const index_cache &ic)
> Tom> +{
> Tom> + m_enabled = ic.enabled ();
>
> It's better to use the initializer syntax like
>
> : m_enabled (ic.enabled ())
>
> This can be in the header if possible (I didn't try).
>
> Tom> +struct index_cache_store_context
> Tom> +{
> Tom> + friend class index_cache;
> Tom> +
> Tom> + index_cache_store_context(const index_cache &ic);
>
> Single-argument constructors should be 'explicit' as a rule.
Ack, fixed in a v3 version (
https://sourceware.org/pipermail/gdb-patches/2023-August/201339.html ).
Thanks,
- Tom
next prev parent reply other threads:[~2023-08-04 0:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 9:52 [PATCH v2 0/6] [gdb/symtab] Fix data-races in gdb.base/index-cache.exp Tom de Vries
2023-08-02 9:53 ` [PATCH v2 1/6] [gdb/symtab] Fix data race on index_cache::m_enabled Tom de Vries
2023-08-02 19:29 ` Tom Tromey
2023-08-04 0:08 ` Tom de Vries [this message]
2023-08-02 9:53 ` [PATCH v2 2/6] [gdb/symtab] Fix data race on bfd::{cacheable,format} Tom de Vries
2023-08-02 19:32 ` Tom Tromey
2023-08-04 0:09 ` Tom de Vries
2023-08-04 15:57 ` Tom Tromey
2023-08-02 9:53 ` [PATCH v2 3/6] [gdb/symtab] Fix race on dwarf2_per_cu_data::{queued,is_debug_type} Tom de Vries
2023-08-02 19:34 ` [PATCH v2 3/6] [gdb/symtab] Fix race on dwarf2_per_cu_data::{queued, is_debug_type} Tom Tromey
2023-08-02 9:53 ` [PATCH v2 4/6] [gdb/symtab] Fix data race on bfd_last_cache Tom de Vries
2023-08-02 19:37 ` Tom Tromey
2023-08-03 14:04 ` Tom de Vries
2023-08-02 9:53 ` [PATCH v2 5/6] [gdb/symtab] Fix data race on dwarf2_per_cu_data::{m_header_read_in,is_debug_type} Tom de Vries
2023-08-02 19:39 ` [PATCH v2 5/6] [gdb/symtab] Fix data race on dwarf2_per_cu_data::{m_header_read_in, is_debug_type} Tom Tromey
2023-08-02 9:53 ` [PATCH v2 6/6] [gdb/testsuite] Extend gdb.base/index-cache.exp Tom de Vries
2023-08-02 19:41 ` Tom Tromey
2023-08-02 19:44 ` [PATCH v2 0/6] [gdb/symtab] Fix data-races in gdb.base/index-cache.exp Tom Tromey
2023-08-04 0:14 ` Tom de Vries
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=079ff325-8cec-7df7-0efc-e458aacda534@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).