Hey everyone,

Per our discussion at VLDD, here's some basic info on tsan and getting
it running with libav. From discussions with Luca and Martin it seems
they were already familiar with it to some extent, so perhaps they can
chime in with any particulars in regard to libav.

Wiki Link: http://code.google.com/p/data-race-test/wiki/ThreadSanitizer
Binaries: http://build.chromium.org/p/client.tsan/binaries/ (scroll to
the end or search for "tsan_")

ThreadSanitizer essentially does memory access race detection; e.g.,
it would detect one thread attempting to read from an address while
another writes to it. It's used extensively by the Chrome project:
http://build.chromium.org/p/chromium.memory.fyi/console

Unfortunately, the threading model in libav results in a lot of false
positives since there are multiple instances where benign races are
used to avoid locking performance penalties (per thread progress,
etc). This is where DynamicAnnotation come in:
http://code.google.com/p/data-race-test/wiki/DynamicAnnotations which
allow the code to indicate races which are benign.

There are non-benign races lurking beneath these false positives too.
To give a specific case where libav is failing under tsan: I
previously wrote on the list about the failures we're seeing on
Windows under tsan here:

http://lists.libav.org/pipermail/libav-devel/2012-April/026484.html

To run tsan with libav simply run configure with "--valgrind=<tsan sfx
shell script path>" or alternatively you can follow the directions
from my previous email and use the hash-test sample program.

Any help the community could provide in the following would be greatly
appreciated:
- Identifying and fixing the races on Windows.
- Annotating the benign races so that tsan can be run on libav error free.

In the coming weeks I'll work with Diego B to get a tsan based FATE
instance running so these issues can at least be monitored for the
time being.

Thanks for listening! I'm happy to answer any questions.

- dale

[ P.S. If you're feeling really adventurous you can try the V2 version
which is a clang plugin (-ftsan) similar to AddressSanitizer:
http://code.google.com/p/thread-sanitizer/wiki/ThreadSanitizerDevelopment
]

[ P.P.S It was great to meet everyone at the VLDD conference, thanks
for taking the time to talk with us Chrome folk. If you're ever in
Seattle, feel free to stop by! ]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to