public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/18743] PowerPC: findutils testcase fails with --enable-lock-elision
  2015-07-30 16:24 [Bug nptl/18743] New: PowerPC: findutils testcase fails with --enable-lock-elision tuliom at linux dot vnet.ibm.com
@ 2015-07-30 16:24 ` tuliom at linux dot vnet.ibm.com
  2015-10-01  9:40 ` normand at linux dot vnet.ibm.com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tuliom at linux dot vnet.ibm.com @ 2015-07-30 16:24 UTC (permalink / raw)
  To: glibc-bugs

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

Tulio Magno Quites Machado Filho <tuliom at linux dot vnet.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at sourceware dot org   |tuliom at linux dot vnet.ibm.com

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug nptl/18743] New: PowerPC: findutils testcase fails with --enable-lock-elision
@ 2015-07-30 16:24 tuliom at linux dot vnet.ibm.com
  2015-07-30 16:24 ` [Bug nptl/18743] " tuliom at linux dot vnet.ibm.com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tuliom at linux dot vnet.ibm.com @ 2015-07-30 16:24 UTC (permalink / raw)
  To: glibc-bugs

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

            Bug ID: 18743
           Summary: PowerPC: findutils testcase fails with
                    --enable-lock-elision
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: tuliom at linux dot vnet.ibm.com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

This has been initially reported at:
https://bugzilla.suse.com/show_bug.cgi?id=923486

OpenSUSE team found an intermittent issue with pthread's rwlock functions while
running the tests from findutils.
test_twlock was reporting different values for check_accounts:

=== trial: 24: failure: 0
Starting test_lock ... OK
Starting test_rwlock ...check_accounts: sum=4006, expected 4000
check_accounts: sum=4006, expected 4000 
check_accounts: sum=4006, expected 4000
check_accounts: sum=4006, expected 4000
Aborted (core dumped)
=== trial: 25: failure: 1
=== trial: 616: failure: 29
Starting test_lock ... OK
Starting test_rwlock ...check_accounts: sum=3994, expected 4000
check_accounts: sum=3994, expected 4000 
check_accounts: sum=3994, expected 4000
check_accounts: sum=3994, expected 4000
Aborted (core dumped)
=== trial: 617: failure: 30
=== trial: 866: failure: 39

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug nptl/18743] PowerPC: findutils testcase fails with --enable-lock-elision
  2015-07-30 16:24 [Bug nptl/18743] New: PowerPC: findutils testcase fails with --enable-lock-elision tuliom at linux dot vnet.ibm.com
  2015-07-30 16:24 ` [Bug nptl/18743] " tuliom at linux dot vnet.ibm.com
@ 2015-10-01  9:40 ` normand at linux dot vnet.ibm.com
  2015-10-19 19:01 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: normand at linux dot vnet.ibm.com @ 2015-10-01  9:40 UTC (permalink / raw)
  To: glibc-bugs

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

Michel Normand <normand at linux dot vnet.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |normand at linux dot vnet.ibm.com

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug nptl/18743] PowerPC: findutils testcase fails with --enable-lock-elision
  2015-07-30 16:24 [Bug nptl/18743] New: PowerPC: findutils testcase fails with --enable-lock-elision tuliom at linux dot vnet.ibm.com
  2015-07-30 16:24 ` [Bug nptl/18743] " tuliom at linux dot vnet.ibm.com
  2015-10-01  9:40 ` normand at linux dot vnet.ibm.com
@ 2015-10-19 19:01 ` cvs-commit at gcc dot gnu.org
  2015-10-19 19:07 ` tuliom at linux dot vnet.ibm.com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-10-19 19:01 UTC (permalink / raw)
  To: glibc-bugs

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

--- 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  6ec52bf634b7650b57ff67b5f5053bce8992d549 (commit)
      from  44f826e317f28969ea6ca0e87aa4c6b69c819245 (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=6ec52bf634b7650b57ff67b5f5053bce8992d549

commit 6ec52bf634b7650b57ff67b5f5053bce8992d549
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Date:   Wed Jul 22 09:26:02 2015 -0300

    PowerPC: Fix a race condition when eliding a lock

    The previous code used to evaluate the preprocessor token is_lock_free to
    a variable before starting a transaction.  This behavior can cause an
    error if another thread got the lock (without using a transaction)
    between the evaluation of the token and the beginning of the transaction.

    This bug can be triggered with the following order of events:
    1. The lock accessed by is_lock_free is free.
    2. Thread T1 evaluates is_lock_free and stores into register R1 that the
       lock is free.
    3. Thread T2 acquires the same lock used in is_lock_free.
    4. T1 begins the transaction, creating a memory barrier where is_lock_free
       is false, but R1 is true.
    5. T1 reads R1 and doesn't abort the transaction.
    6. T1 calls ELIDE_UNLOCK, which reads false from is_lock_free and decides
       to unlock a lock acquired by T2, leading to undefined behavior.

    This patch delays the evaluation of is_lock_free to inside a transaction
    by moving this part of the code to the macro ELIDE_LOCK.

        [BZ #18743]
        * sysdeps/powerpc/nptl/elide.h (__elide_lock): Move most of this
        code to...
        (ELIDE_LOCK): ...here.
        (__get_new_count): New function with part of the code from
        __elide_lock that updates the value of adapt_count after a
        transaction abort.
        (__elided_trylock): Moved this code to...
        (ELIDE_TRYLOCK): ...here.

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

Summary of changes:
 ChangeLog                    |   12 ++++
 NEWS                         |   14 +++---
 sysdeps/powerpc/nptl/elide.h |  115 +++++++++++++++++++++++-------------------
 3 files changed, 82 insertions(+), 59 deletions(-)

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug nptl/18743] PowerPC: findutils testcase fails with --enable-lock-elision
  2015-07-30 16:24 [Bug nptl/18743] New: PowerPC: findutils testcase fails with --enable-lock-elision tuliom at linux dot vnet.ibm.com
                   ` (2 preceding siblings ...)
  2015-10-19 19:01 ` cvs-commit at gcc dot gnu.org
@ 2015-10-19 19:07 ` tuliom at linux dot vnet.ibm.com
  2015-10-20 15:47 ` cvs-commit at gcc dot gnu.org
  2015-10-29 16:39 ` jsm28 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: tuliom at linux dot vnet.ibm.com @ 2015-10-19 19:07 UTC (permalink / raw)
  To: glibc-bugs

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

Tulio Magno Quites Machado Filho <tuliom at linux dot vnet.ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Tulio Magno Quites Machado Filho <tuliom at linux dot vnet.ibm.com> ---
The patch has just been pushed to master.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug nptl/18743] PowerPC: findutils testcase fails with --enable-lock-elision
  2015-07-30 16:24 [Bug nptl/18743] New: PowerPC: findutils testcase fails with --enable-lock-elision tuliom at linux dot vnet.ibm.com
                   ` (3 preceding siblings ...)
  2015-10-19 19:07 ` tuliom at linux dot vnet.ibm.com
@ 2015-10-20 15:47 ` cvs-commit at gcc dot gnu.org
  2015-10-29 16:39 ` jsm28 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-10-20 15:47 UTC (permalink / raw)
  To: glibc-bugs

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

--- Comment #3 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, release/2.22/master has been updated
       via  5b319ce2949cf6fb97862ff81558944f76c704f1 (commit)
      from  5fb7924cb6cf606ce865122e5bbac9df934db14e (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=5b319ce2949cf6fb97862ff81558944f76c704f1

commit 5b319ce2949cf6fb97862ff81558944f76c704f1
Author: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Date:   Wed Jul 22 09:26:02 2015 -0300

    PowerPC: Fix a race condition when eliding a lock

    The previous code used to evaluate the preprocessor token is_lock_free to
    a variable before starting a transaction.  This behavior can cause an
    error if another thread got the lock (without using a transaction)
    between the evaluation of the token and the beginning of the transaction.

    This bug can be triggered with the following order of events:
    1. The lock accessed by is_lock_free is free.
    2. Thread T1 evaluates is_lock_free and stores into register R1 that the
       lock is free.
    3. Thread T2 acquires the same lock used in is_lock_free.
    4. T1 begins the transaction, creating a memory barrier where is_lock_free
       is false, but R1 is true.
    5. T1 reads R1 and doesn't abort the transaction.
    6. T1 calls ELIDE_UNLOCK, which reads false from is_lock_free and decides
       to unlock a lock acquired by T2, leading to undefined behavior.

    This patch delays the evaluation of is_lock_free to inside a transaction
    by moving this part of the code to the macro ELIDE_LOCK.

        [BZ #18743]
        * sysdeps/powerpc/nptl/elide.h (__elide_lock): Move most of this
        code to...
        (ELIDE_LOCK): ...here.
        (__get_new_count): New function with part of the code from
        __elide_lock that updates the value of adapt_count after a
        transaction abort.
        (__elided_trylock): Moved this code to...
        (ELIDE_TRYLOCK): ...here.

    (cherry picked from commit 6ec52bf634b7650b57ff67b5f5053bce8992d549)

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

Summary of changes:
 ChangeLog                    |   12 ++++
 NEWS                         |    4 +-
 sysdeps/powerpc/nptl/elide.h |  115 +++++++++++++++++++++++-------------------
 3 files changed, 77 insertions(+), 54 deletions(-)

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug nptl/18743] PowerPC: findutils testcase fails with --enable-lock-elision
  2015-07-30 16:24 [Bug nptl/18743] New: PowerPC: findutils testcase fails with --enable-lock-elision tuliom at linux dot vnet.ibm.com
                   ` (4 preceding siblings ...)
  2015-10-20 15:47 ` cvs-commit at gcc dot gnu.org
@ 2015-10-29 16:39 ` jsm28 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-10-29 16:39 UTC (permalink / raw)
  To: glibc-bugs

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

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.23

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-29 16:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-30 16:24 [Bug nptl/18743] New: PowerPC: findutils testcase fails with --enable-lock-elision tuliom at linux dot vnet.ibm.com
2015-07-30 16:24 ` [Bug nptl/18743] " tuliom at linux dot vnet.ibm.com
2015-10-01  9:40 ` normand at linux dot vnet.ibm.com
2015-10-19 19:01 ` cvs-commit at gcc dot gnu.org
2015-10-19 19:07 ` tuliom at linux dot vnet.ibm.com
2015-10-20 15:47 ` cvs-commit at gcc dot gnu.org
2015-10-29 16:39 ` jsm28 at gcc dot gnu.org

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).