intel / intel/ittapi

[Tsan] Data race detection in mutex_init_and_lock

Open
#94 1 comment 3 reactions 0 assignees View on GitHub
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

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.