Skip to content

Data race in std::unique_lock #49709

Open
@TmLev

Description

@TmLev
Bugzilla Link 50365
Version unspecified
OS All
CC @dwblaikie,@mclow

Extended Description

There are two lines in unique_lock::unlock that should appear in reverse order:


__owns_ = false;

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.threadingissues related to threading

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions