Skip to content

Race condition in "set" can lead to a bad state #2

@DanielShaulov

Description

@DanielShaulov

There is an assumption that at any time, there is either 1 or 0 bytes in the pipe.
This assumption breaks if 2 threads call set, each checks the flags, sees that it's false, sets it to true and writes a byte to the pipe. After that - if we call clear, it will only read 1 of the bytes, so the flag will be false but the fd will still be readable, a wait will return immediately without actually waiting for a set in that case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions