We are using GCC and Intel OpenMP.
I know that the combination of GCC and GCC OpenMP needs a special build of OpenMP (to use pthread interfaces rather than directly use the futex system call).
Is it possible to use Thread Sanitizer and GCC + Intel OpenMP? Obviously I can't just simply recompile the Intel OpenMP library.
I've started a test and I'm getting errors like
WARNING: ThreadSanitizer: data race (pid=15551)
Atomic read of size 1 at 0x7fffec302980 by thread T4:
#0 pthread_mutex_lock ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:4250 (libtsan.so.0+0x52d1a)
#1 __kmp_resume_64 <null> (libiomp5.so+0xb7ae3)
Previous write of size 1 at 0x7fffec302980 by thread T7:
#0 pthread_mutex_init ../../../../libsanitizer/tsan/tsan_interceptors_posix.cpp:1227 (libtsan.so.0+0x4c343)
#1 __kmp_suspend_64 <null> (libiomp5.so+0xb587b)
Thread T4 (tid=15590, running) created by main thread at:
#0 pthread_create ../../../../libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x5ec85)
#1 __kmp_create_worker <null> (libiomp5.so+0xb1a34)
I kind of assume that anything with the __kmp
prefix should be safe, and this error is because Thread Sanitizer does not encapsulate any __kmp
functions.