This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/20973] robust mutexes: Lost wake-ups


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

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  353683a22ed8a493a6bd1d78d63e144bc3e85d2f (commit)
      from  da16c9b524908fe0353efc4af8eab6a5ad5ea50b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=353683a22ed8a493a6bd1d78d63e144bc3e85d2f

commit 353683a22ed8a493a6bd1d78d63e144bc3e85d2f
Author: Torvald Riegel <triegel@redhat.com>
Date:   Thu Dec 15 16:06:28 2016 +0100

    Robust mutexes: Fix lost wake-up.

    Assume that Thread 1 waits to acquire a robust mutex using futexes to
    block (and thus sets the FUTEX_WAITERS flag), and is unblocked when this
    mutex is released.  If Thread 2 concurrently acquires the lock and is
    killed, Thread 1 can recover from the died owner but fail to restore the
    FUTEX_WAITERS flag.  This can lead to a Thread 3 that also blocked using
    futexes at the same time as Thread 1 to not get woken up because
    FUTEX_WAITERS is not set anymore.

    The fix for this is to ensure that we continue to preserve the
    FUTEX_WAITERS flag whenever we may have set it or shared it with another
    thread.  This is the same requirement as in the algorithm for normal
    mutexes, only that the robust mutexes need additional handling for died
    owners and thus preserving the FUTEX_WAITERS flag cannot be done just in
    the futex slowpath code.

        [BZ #20973]
        * nptl/pthread_mutex_lock.c (__pthread_mutex_lock_full): Fix lost
        wake-up in robust mutexes.
        * nptl/pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                      |    7 +++++++
 nptl/pthread_mutex_lock.c      |   15 +++++++++++++--
 nptl/pthread_mutex_timedlock.c |   14 ++++++++++++--
 3 files changed, 32 insertions(+), 4 deletions(-)

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]