intel / ittapi

Intel® Instrumentation and Tracing Technology (ITT) and Just-In-Time (JIT) API
84 stars 43 forks source link

[Tsan] Data race detection in mutex_init_and_lock #94

Open mgouicem opened 1 year ago

mgouicem commented 1 year ago

Because the global ittglobal is initialized in a critical section (here), 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.

abrown commented 1 year ago

cc: @ekovanova