qthreads icon indicating copy to clipboard operation
qthreads copied to clipboard

Race Conditions in Sherwood Threadqueue

Open insertinterestingnamehere opened this issue 1 year ago • 0 comments

The thread sanitizer is flagging several issues with the Sherwood threadqueue too. Here are a few of them:

Non-atomic write: https://github.com/sandialabs/qthreads/blob/a2d1dbadb80a161a4a287c1056348808b022ba04/src/threadqueues/sherwood_threadqueues.c#L322 Non-atomic read: https://github.com/sandialabs/qthreads/blob/a2d1dbadb80a161a4a287c1056348808b022ba04/src/threadqueues/sherwood_threadqueues.c#L845

Something non-atomic is still happening in the TRYLOCK macros/functions. Non-atomic read at: https://github.com/sandialabs/qthreads/blob/a2d1dbadb80a161a4a287c1056348808b022ba04/src/threadqueues/sherwood_threadqueues.c#L846 Atomic write at: https://github.com/sandialabs/qthreads/blob/a2d1dbadb80a161a4a287c1056348808b022ba04/src/threadqueues/sherwood_threadqueues.c#L328

There are several more errors.