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/24774] New: pthread_rwlock_timedwrlock stalls on ARM


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

            Bug ID: 24774
           Summary: pthread_rwlock_timedwrlock stalls on ARM
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: mike.dyer at youview dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 11887
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11887&action=edit
test exhibiting stall in pthread_rwlock_timedwrlock()

We recently discovered a stall in pthread_rwlock_timedwrlock() while debugging
some third party code.

It was triggered by incorrectly using a relative timeout value and continually
spinning trying to obtain the write lock.  The call to
pthread_rwlock_timedwrlock() would time out immediately when another thread
held a read lock (see timedwrlock_stall_test.c).

Eventually, calls to pthread_rwlock_timedwrlock() would fail to return.

Debugging shows the call stalled:

(gdb) bt
#0  0x000149a4 in __pthread_rwlock_wrlock_full (abstime=<optimized out>,
rwlock=0x92ec8 <rwl>) at pthread_rwlock_common.c:909
#1  pthread_rwlock_timedwrlock (rwlock=0x92ec8 <rwl>, abstime=<optimized out>)
at pthread_rwlock_timedwrlock.c:36
#2  0x00010594 in wrlocker ()
#3  0x000119c4 in start_thread (arg=0xfefed300) at pthread_create.c:479
#4  0x0002f868 in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73

Disassembly shows that it is stuck in an infinite loop:

   0x00014994 <+548>:   dmb     ish
   0x00014998 <+552>:   ldr     r3, [r12, #8]
   0x0001499c <+556>:   bics    r3, r3, #2
   0x000149a0 <+560>:   bne     0x14908 <pthread_rwlock_timedwrlock+408>
=> 0x000149a4 <+564>:   b       0x149a4 <pthread_rwlock_timedwrlock+564>

This was tested using glibc from git, sha 484b7af3, built using crosstool-ng. 
Gcc version was 8.3.0

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