This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/10418] New: pthread_mutex_unlock may use acquire rather than release barriers


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]