public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Subject: Re: [PATCH] nptl: Add one more barrier to nptl/tst-create1
Date: Fri, 10 Dec 2021 10:46:27 +0000	[thread overview]
Message-ID: <20211210104627.GR3294453@arm.com> (raw)
In-Reply-To: <87tufhcccz.fsf@oldenburg.str.redhat.com>

The 12/10/2021 05:28, Florian Weimer wrote:
> Without the bar_ctor_finish barrier, it was possible that thread2
> re-locked user_lock before ctor had a chance to lock it.  ctor then
> blocked in its locking operation, xdlopen from the main thread
> did not return, and thread2 was stuck waiting in bar_dtor:
> 
> thread 1: started.
> thread 2: started.
> thread 2: locked user_lock.
> constructor started: 0.
> thread 1: in ctor: started.
> thread 3: started.
> thread 3: done.
> thread 2: unlocked user_lock.
> thread 2: locked user_lock.
> 
> Fixes test in commit 83b5323261bb72313bffcf37476c1b8f0847c736
> ("elf: Avoid deadlock between pthread_create and ctors [BZ #28357]").
> 
> Tested on x86_64-gnu-linux with lots and lots of iterations in a loop.

yes this looks right, thanks

Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>

      reply	other threads:[~2021-12-10 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10  4:28 Florian Weimer
2021-12-10 10:46 ` Szabolcs Nagy [this message]

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=20211210104627.GR3294453@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@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).