https://bugs.llvm.org/show_bug.cgi?id=50365

            Bug ID: 50365
           Summary: Data race in std::unique_lock
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

There are two lines in ```unique_lock::unlock``` that should appear in reverse
order:
https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/libcxx/include/__mutex_base#L255
https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/libcxx/include/__mutex_base#L256

MRE would require a thread pool with fibers running over it (that's how TSan
detected the race condition in the first place) so that one thread has unlocked
```__m_``` but not written false yet, and another thread is destroying the lock
already.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to