I'm seeing intermittent failures in nptl/ tst-join5 Consider two threads, A and B: Thread A calls pthread_cancel(B); pthread_join(B). Some time later thread B calls pthread_join(A). pthread_join is a cancellation point, so I would expect thread B to be cancelled at that point. However what thread B sees thread A waiting and mistakenly returns EDEADLK. The attached testcase is based on tst-join5, with an extra busy look added to make the failure reproducible. The patch fixes this by checking if the current thread has been cancelled before returning EDEADLK.
Created attachment 1122 [details] Testcase Based on nptl/tst-join5.c
Created attachment 1123 [details] Patch
There is a problem but the patch is wrong. I checked in a correct patch.