google / google/sanitizers

tsan: false positives due to pthread_setcancelstate

Open
#646 2 comments 0 reactions 1 assignee Claimed by @dvyukov View on GitHub
Dominant language
C
Stars
12.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Describing it here so it is searchable.

If a thread is cancelled in the sleep below:

```
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE);
sleep(1);
```

then pthread will call pthread_cleanup_push cleanup functions from within the sleep. But sleep interceptor disables nested interceptors for obscure reasons. As the result tsan won't see any synchronization events from the cleanup functions. This can lead to false positives.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.