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/24924] nptl/tst-rwlock9 and nptl/tst-rwlock18 fail on aarch64


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

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This seems to fix the testcase:
diff --git a/nptl/pthread_rwlock_common.c b/nptl/pthread_rwlock_common.c
index 8db861fdcb..fccaccafd0 100644
--- a/nptl/pthread_rwlock_common.c
+++ b/nptl/pthread_rwlock_common.c
@@ -686,7 +686,7 @@ __pthread_rwlock_wrlock_full (pthread_rwlock_t *rwlock,
                     are not.  */
                  if (atomic_compare_exchange_weak_acquire
                      (&rwlock->__data.__writers,
-                      &w, (w - PTHREAD_RWLOCK_WRHANDOVER - 1)))
+                      &w, ((w & ~PTHREAD_RWLOCK_WRHANDOVER) - 1)))
                    {
                      /* Reload so our view is consistent with the view of
                         the previous owner of WRLOCKED.  See above.  */

------ CUT -----
But only on accident.

The problem is shown here:
 1a8:   885ffe08        ldaxr   w8, [x16]
 1ac:   6b01011f        cmp     w8, w1
 1b0:   540000a1        b.ne    1c4 <pthread_rwlock_clockwrlock+0x1c4>  //
b.any
 1b4:   f9000bf3        str     x19, [sp, #16]
 1b8:   88137e05        stxr    w19, w5, [x16]


The store to the stack there is broken and causes the stxr to always fail on
ThunderX1 (and OcteonTX1) and OcteonTX2.
So this is a GCC bug and not a hardware bug.

-- 
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]