[Tsan] Data race detection in mutex_init_and_lock
Open
- Dominant language
- Rust
- Stars
- 142
- Forks
- 52
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 3
Description
Because the global __itt__global is initialized in a critical section ([here](https://github.com/intel/ittapi/blob/69dd04030d3a2cf4c32e649ac1f2a628d5af6b46/src/ittnotify/ittnotify_static.c#L128)), Clang Thread Sanitizer flags it as a race condition.
We stumbled upon it by calling itt_string_create in a parallel section.
It is not critical, but it forces users to suppress those warnings. Maybe separating the initialization from the lock, and statically initializing the mutex would avoid this issue.
Contributor guide
Assessment
This issue has not been assessed yet.