This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/10418] New: pthread_mutex_unlock may use acquire rather than release barriers
- From: "cfriesen at nortel dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 20 Jul 2009 16:43:00 -0000
- Subject: [Bug nptl/10418] New: pthread_mutex_unlock may use acquire rather than release barriers
- Reply-to: sourceware-bugzilla at sourceware dot org
When priority inheritance or priority protection is enabled,
pthread_mutex_unlock() calls atomic_compare_and_exchange_bool_acq() rather than
atomic_compare_and_exchange_bool_rel().
On mips (and possibly other architectures), this results in a memory barrier
after the atomic operation instead of before it. This means that there is a
window where another core can do pthread_mutex_lock() and read stale information.
We have a testcase that reproduces the problem. Changing to
atomic_compare_and_exchange_bool_rel() makes the problem go away.
--
Summary: pthread_mutex_unlock may use acquire rather than release
barriers
Product: glibc
Version: 2.10
Status: NEW
Severity: critical
Priority: P1
Component: nptl
AssignedTo: drepper at redhat dot com
ReportedBy: cfriesen at nortel dot com
CC: cfriesen at nortel dot com,glibc-bugs at sources dot
redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=10418
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.