Should We Move To Thread Sanitizer?

181 views
Skip to first unread message

Joe Best-Rotheray

unread,
Apr 7, 2016, 7:07:43 PM4/7/16
to Relacy Race Detector
As the title suggests, I recently learned that thread sanitizer is also a data race detector, by the same author as Relacy! Should we all switch to using thread sanitizer instead of Relacy?

Cheers
Joe

Ronald Landheer-Cieslak

unread,
Apr 7, 2016, 8:26:18 PM4/7/16
to rel...@googlegroups.com
Thread sanitizer is part of clang (and more or less works in gcc), doesn't "promise anything" for C++ and has a different model than relacy. I see them as complimentary approaches.
Should you use thread sanitizer? Sure!
Should you stop using relacy? I wouldn't. (Not yet)

rlc

-- 
I am Ronald's iPhone and I approve this message (now that I've edited it extensively using autocorrect)
--
You received this message because you are subscribed to the Google Groups "Relacy Race Detector" group.
To unsubscribe from this group and stop receiving emails from it, send an email to relacy+un...@googlegroups.com.
To post to this group, send email to rel...@googlegroups.com.
Visit this group at https://groups.google.com/group/relacy.
For more options, visit https://groups.google.com/d/optout.

Dmitry Vyukov

unread,
Apr 10, 2016, 4:23:32 AM4/10/16
to rel...@googlegroups.com, thread-s...@googlegroups.com
What Ronald said.
Relacy is intended for rigorous verification of synchronization
algorithms. It checks lots of different thread interleavings,
precisely models and relaxes memory model. But it can't handle any
real application.
ThreadSanitizer does not check multiple executions, does not relax
memory model and does somewhat coarser modelling. But on the other
hand it can handle applications of almost arbitrary size (e.g. we are
testing Chromium with ThreadSanitizer).

Joe Best-Rotheray

unread,
Apr 11, 2016, 8:21:09 AM4/11/16
to Relacy Race Detector, thread-s...@googlegroups.com
Cool, so am I right in thinking that Relacy is able to kind of "emulate" non-x86 processors? Some of the bugs that Relacy has found seem to be problems that I wouldn't expect to have seen on x86. If so, that's insanely useful, as I'm never going to bother testing my code on Arm or PPC!

Dmitry Vyukov

unread,
Apr 11, 2016, 8:30:49 AM4/11/16
to thread-s...@googlegroups.com, Relacy Race Detector
Right.
But note that if you program in C/C++ (rather than in x86
assembly/machine codes), the fact that the underlying hardware is x86
is irrelevant. C/C++ have own memory model and you need to program
against it. The problem is that _compiler_ can do all kinds of memory
reorderings, can split word stores, etc. See (especially the second
example with double):
https://github.com/google/sanitizers/wiki/ThreadSanitizerAboutRaces#volatile
> --
> You received this message because you are subscribed to the Google Groups
> "thread-sanitizer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to thread-sanitiz...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages