|
ThreadSanitizerOffline
Experimental offline race detector
ThreadSanitizer offlineWe have an experimental offline race detector. It does not depend on any binary instrumentation framework. Instead, it simply reads events from a text file. Currently, the only supported event syntax mimics the events generated by Valgrind-based ThreadSanitizer (see simple_race_1.tst), but we can support any syntax we need. How to tryGet, build and run ThreadSanitizerOffline: svn checkout http://data-race-test.googlecode.com/svn/trunk/ data-race-test-read-only cd data-race-test-read-only/tsan # assuming you are on 64-bit Linux: make VALGRIND_ROOT= GTEST_ROOT= PIN_ROOT= OFFLINE=1 l64d -j ./bin/amd64-linux-debug-ts_offline --show-pc < offline_tests/simple_race_1.tst If you are lucky, you may get the following output: INFO: ThreadSanitizerOffline r2290
==8150== INFO: Allocating 256Mb (32 * 8M) for Segments.
==8150== INFO: Will allocate up to 640Mb for 'previous' stack traces.
sizeof(CacheLine) = 568
==8150== INFO: T1 has been created by T0. Use --announce-threads to see the creation stack.
==8150== INFO: T0 is program's main thread
==8150== WARNING: Possible data race during read of size 1 at 0xabcde: {{{
==8150== T1 (writer locks held: {}; reader locks held: {L2}):
==8150== #0 0xaa108001:
==8150== #1 0xca100002:
==8150== #2 0xca100001:
==8150== Concurrent write(s) happened at (OR AFTER) these points:
==8150== T0 (locks held: {L1}):
==8150== #0 0xca000003:
==8150== #1 0xca000002:
==8150== #2 0xca000001:
==8150== Location 0xabcde is 14 bytes inside a block starting at 0xabcd0 of size 255 allocated by T0 from heap:
==8150== #0 0xcdeffedc:
==8150== #1 0xca000002:
==8150== #2 0xca000001:
==8150== Locks involved in this report (reporting last lock sites): {L1, L2}
==8150== L1 (0x7777)
==8150== #0 0xaa:
==8150== #1 0xca000002:
==8150== #2 0xca000001:
==8150== L2 (0x7778)
==8150== #0 0xbb:
==8150== #1 0xca100002:
==8150== #2 0xca100001:
==8150== Race verifier data: 0xaa108001,0xca000003
==8150== }}}
INFO: ThreadSanitizerOffline: 18 events read
==8150== ThreadSanitizer summary: reported 1 warning(s) (1 race(s))
|
► Sign in to add a comment
Do you have any description of the log format generated with tsan?
Not really, sorry. The only documentation we have is the function PrintRaceReport? in tsan/thread_sanitizer.cc
Well, I needed something different. Something, I could feed ThreadSanitizerOffline with. And I figured out that this is what is produced with DumpEventPlainText?() function.
Thank you anyway, though
Ah, sorry, I misunderstood your question. Yes, you need to check DumpEventPlainText?. If you have more questions, data-race-test@googlegroups.com might be more convenient.