[patch, libfortran] Fix thead sanitizer issue with libgfortran
Thomas Koenig
tkoenig@netcologne.de
Sun Oct 1 16:54:00 GMT 2017
Hi Bernd,
> I believe that all omp threads are created in detached state,
> so pthread_join should be undefined on them, just tsan*thinks*
> otherwise?
>
> When I look further on the libgomp sources, I see there
> are two completely different implementations of the
> mutexes, barriers, etc.
>
> One using posix functions which should be visible to tsan
> and another one using raw linux futex calls which should be
> invisible to tsan, by default the linux system calls are
> used, which explains why tsan seems to be unaware of the
> actual synchronization in this example.
>
> Have you tried to build with --enable-linux-futex=no ?
I just did that, and it appears that the thread sanitizer
no longer detects any issues even without my patch
(at least on powerpc64-unknown-linux-gnu, gcc110),
which showed the behavior before.
So, what is the correct way forward?
Modifying apparently correct code in libgfortran isn't the
answer, I think.
Having false positives when users specify -fopenmp -fsanitize=thread
is also not nice - this makes debugging multithreaded applications
hard.
Would it be possible to build a posix-thread-only version
of libgomp to be linked in when -fsanitize=thread is
supplied? Jakub, any suggestions?
Regards
Thomas
More information about the Fortran
mailing list