[PATCH] Fix race in pthread_mutex_lock while promoting to PTHREAD_MUTEX_ELISION_NP [BZ #23275]

Stefan Liebler stli@linux.ibm.com
Thu Jun 14 08:04:00 GMT 2018


> I've also retested tst-mutex10 without the remaining patch on multiple 
> s390x machines. I've found out, that it depends on the used gcc (at 
> least on s390x). On one machine, gcc 6 was used. With gcc 7 / 8, the 
> type of the mutex was loaded from memory multiple times.
> With gcc 6, it is loaded only one time and thus all threads are 
> promoting the mutex to PTHREAD_MUTEX_ELISION_NP. Then you don't see a fail.
> 
> On x86_64, I've used gcc 8. Perhaps I can try other gcc versions.
I've tried gcc 6, 7, 8 on x86_64:
-gcc 6: the mutex-type is only loaded one time from memory => no fails
-gcc 7/8: the mutex-type is loaded two times from memory => fails



More information about the Libc-alpha mailing list