Tsan simply output the data race:
Clang shows the column, really convenient to clearly identify where the problem is:
note: with gcc we can add -gcolumn-info
but that doesn't seems to be working here
Tsan detect the error but with libstdc++ it doesn't shows us the problem in our code:
While with libc++:
Tsan detect the data race on done
and payload
:
again, we have the column with clang and with libc++ the data race on the string shows correctly where it is in our code.
With 3 errors, Tsan correctly points out the errors:
Tsan with gcc shows the data races:
Interestingly with clang, it shows only the first one.
Tsan does not detect this error, but this is not its job, asan or msan should fit better here.
Same as above.
This time gcc and clang with libc++ detect the use after free problem. not clang with libstdc++ though:
Tsan does not detect the ABA problem exposed in this code.
Even after looping 1000 times multiple times.
Tsan detect a problem when looping 10 times except with libc++ we had to loop 1000 times
The output with clang is really convenient here with column information:
Tsan detect the data race on payload
:
Tsan detect the data race on payload
:
Tsan detect the data race on payload
:
Tsan reports no errors, good.
Tsan reports no errors, good.
Tsan reports no errors, good.
Tsan reports no errors, good.