Hi Martin, Martin Willi wrote,
Hi,
I'm hitting an issue with the assembler implementation of pthread_cond_wait() that is used on x86_64 with nptl.
If a thread is canceled while waiting in pthread_cond_wait(), the condvar seems be left in an inconsistent state. A different thread first calling pthread_cond_signal()t then gets blocked in pthread_cond_destroy(). It seems that the function falsely assumes that there are other waiters in the condvar.
The test program below reproduces the issue, blocking in pthread_cond_destroy(). Switching to the C implementation on x86_64 fixes the problem here.
A trivial fix would just switch back to the C implementation, basically revertĀ e928e223fd. That commit, however, states that the generic implementations are broken on x86_64. I couldn't reproduce that, though.
Has anybody else seen pthread_cond_wait() issues on x86_64?
Your testcase works with GNU libc. Do you like do find out what is wrong in the assembly in our files? A diff shows some differences...
I would rather like to sync with GNU libc, as the whole NPTL/TLS stuff is mostly from there.
best regards Waldemar