public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Vitaly Buka <vitalybuka@google.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: GLIBC Devel <libc-alpha@sourceware.org>
Subject: Re: [PATCH] stdlib: Fix data race in __run_exit_handlers
Date: Tue, 20 Apr 2021 15:51:15 -0700	[thread overview]
Message-ID: <CAPjTjwvXtGUBQri2rtz3xfB5C0FOhhUUMDU=sQYaikwxeZZCyQ@mail.gmail.com> (raw)
In-Reply-To: <CALoOobMLtNVu=9tpRNddhMq922VKnNrAd0FUM5o2rTbnn7uXpA@mail.gmail.com>

I guess I forgot to reply to these comments.

On Sat, 17 Apr 2021 at 11:02, Paul Pluzhnikov <ppluzhnikov@google.com>
wrote:

> On Sat, Apr 17, 2021 at 10:23 AM Vitaly Buka via Libc-alpha
> <libc-alpha@sourceware.org> wrote:
>
> > diff --git a/stdlib/test-cxa_atexit-race2.c
> b/stdlib/test-cxa_atexit-race2.c
>
> > +   This test spawns multiple threads, and check the same desctructor is
>
> Typo. Suggest:
>
> This test spawns multiple threads, and checks that the same destructor is
>

Done in the last patch.


>
> > +   not called more then once.  */
>
> s/then/than/
>

Done in the last patch.


>
> > +static void *cb_arg = NULL;
> > +static void
> > +add_handlers (void)
> > +{
> > +  int n = 10;
> > +  for (int i = 0; i < n; ++i)
> > +    __cxa_atexit (&atexit_cb, ++cb_arg, 0);
>
> add_handlers() is called from many threads. This code appears to race on
> cb_arg.
>

We don't have a data race as add_handlers is called from a single
background thread.
Previous patches had more threads but they didn't help to reproduce the
issues.


>
>
> --
> Paul Pluzhnikov
>

  reply	other threads:[~2021-04-20 22:51 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-20  9:57 Vitaly Buka
2020-09-20 12:09 ` Vitaly Buka
2020-09-20 20:41   ` Paul Pluzhnikov
2020-09-20 21:26     ` Vitaly Buka
2020-09-20 23:36       ` Vitaly Buka
2020-09-20 23:37         ` Vitaly Buka
2020-09-21  8:31           ` Vitaly Buka
2020-09-30 16:01             ` Joseph Myers
2021-04-17 16:16               ` Vitaly Buka
2021-04-17 17:11                 ` Vitaly Buka
2021-04-17 17:13                   ` Vitaly Buka
2021-04-17 17:22                     ` Vitaly Buka
2021-04-17 18:01                       ` Paul Pluzhnikov
2021-04-20 22:51                         ` Vitaly Buka [this message]
2021-04-20 23:40                           ` Paul Pluzhnikov
2021-04-26 19:20                             ` Vitaly Buka
2021-04-26 19:23                               ` Vitaly Buka
2021-04-26 19:27                                 ` Vitaly Buka
2021-05-13 13:15                                   ` Adhemerval Zanella
2021-05-14  6:50                                     ` Vitaly Buka
2021-04-17 17:36               ` Paul Pluzhnikov
2021-04-17 20:19                 ` Florian Weimer
2021-04-19  2:48                   ` Vitaly Buka
2021-04-19  2:57                     ` Vitaly Buka

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='CAPjTjwvXtGUBQri2rtz3xfB5C0FOhhUUMDU=sQYaikwxeZZCyQ@mail.gmail.com' \
    --to=vitalybuka@google.com \
    --cc=libc-alpha@sourceware.org \
    --cc=ppluzhnikov@google.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).