<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/100960>100960</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libc][aarch64] rwlock sometime stuck in waiting for a timedout timestamp in clockwrlock API
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            libc
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            SchrodingerZhu
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          SchrodingerZhu
      </td>
    </tr>
</table>

<pre>
    ```
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 432859
Reading symbols from /home/schrodinger/development/llvm-project/build/libc/test/integration/src/pthread/libc.test.integration.src.pthread.pthread_rwlock_test.__build__...
DW_FORM_loclistx used without .debug_loclists section [in module /home/schrodinger/development/llvm-project/build/libc/test/integration/src/pthread/libc.test.integration.src.pthread.pthread_rwlock_test.__build__]
__llvm_libc_20_0_0_git::syscall_impl (number=98, arg2=137, arg3=0, arg4=281474883024144, arg5=0, arg6=4294967295, 
    arg1=<optimized out>) at /home/schrodinger/development/llvm-project/libc/src/__support/OSUtil/linux/aarch64/syscall.h:89
89 SYSCALL_INSTR(REGISTER_CONSTRAINT_6);
(gdb) bt
#0 __llvm_libc_20_0_0_git::syscall_impl (number=98, arg2=137, arg3=0, arg4=281474883024144, arg5=0, arg6=4294967295, 
    arg1=<optimized out>) at /home/schrodinger/development/llvm-project/libc/src/__support/OSUtil/linux/aarch64/syscall.h:89
#1 __llvm_libc_20_0_0_git::syscall_impl<long, __llvm_libc_20_0_0_git::Futex*, unsigned int, unsigned int, timespec const*, decltype(nullptr), unsigned int>(long, __llvm_libc_20_0_0_git::Futex*, unsigned int, unsigned int, timespec const*, decltype(nullptr), unsigned int) (__number=98, ts=<optimized out>, ts=<optimized out>, ts=<optimized out>, ts=<optimized out>, ts=<optimized out>, 
    ts=<optimized out>) at /home/schrodinger/development/llvm-project/libc/src/__support/OSUtil/linux/syscall.h:32
#2 __llvm_libc_20_0_0_git::Futex::wait (timeout=..., this=<optimized out>, expected=<optimized out>, is_shared=<optimized out>)
    at /home/schrodinger/development/llvm-project/libc/src/__support/threads/linux/futex_utils.h:45
#3 __llvm_libc_20_0_0_git::rwlock::WaitingQueue::wait<(__llvm_libc_20_0_0_git::rwlock::Role)1> (this=<optimized out>, 
    expected=<optimized out>, timeout=..., is_pshared=<optimized out>)
    at /home/schrodinger/development/llvm-project/libc/src/__support/threads/linux/rwlock.h:105
#4 __llvm_libc_20_0_0_git::RwLock::lock_slow<(__llvm_libc_20_0_0_git::rwlock::Role)1> (this=0xfffffa6a75f0, timeout=..., 
    spin_count=100) at /home/schrodinger/development/llvm-project/libc/src/__support/threads/linux/rwlock.h:443
#5 0x00000000002348b4 in __llvm_libc_20_0_0_git::RwLock::write_lock (this=0xfffffa6a75f0, spin_count=100, timeout=...)
    at /home/schrodinger/development/llvm-project/libc/src/__support/threads/linux/rwlock.h:486
#6 __llvm_libc_20_0_0_git::pthread_rwlock_clockwrlock (rwlock=rwlock@entry=0xfffffa6a75f0, clockid=<optimized out>, 
 clockid@entry=1, abstime=<optimized out>, abstime@entry=0xfffffa6a7690)
 at /home/schrodinger/development/llvm-project/libc/src/pthread/pthread_rwlock_clockwrlock.cpp:40
#7 0x00000000002310d8 in timedlock_with_deadlock_test ()
    at /home/schrodinger/development/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:219
#8 main () at /home/schrodinger/development/llvm-project/libc/test/integration/src/pthread/pthread_rwlock_test.cpp:530
(gdb) 
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsmN9v2zYQx_8a-oWYQB0lW3rwgxPFQ4Cu3ZwMxfYiUBJtcaVEgaTqZH_9cJJsZ_nhBUXWdsCcIBHJI333uS-lo4RzatdKuSTxBQG4KWtrKtXupP297gkAibOZ6H1t7PLvY7PCVPdLMmfTL8sIW62NpbXUHYFL6u87SQnA2IZg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