<div dir="ltr">The interface files you see are for a prototype of Java Tsan that's internal to Google. It's for use by a JDK that we customized with extensive JVM patches, and enables running the Tsan engine on Java and native code simultaneously. <div><br></div><div>We presented this prototype recently at the JVM Language Summit. Here's the talk:<div><a href="https://www.youtube.com/watch?v=UykhZ36W04I" target="_blank">https://www.youtube.com/watch?<wbr>v=UykhZ36W04I</a><br></div><div><br></div><div>We are starting to explore how to upstream the JVM patches. It's going to be tricky: The patches are fairly invasive, the setup and expectations are different in terms of upstream vs. home-grown build system, and the whole thing will require healthy upstream buy-in. This will all take time, so no promises of a speedy release, unfortunately.</div><div><br></div><div>Since you seem to be ok with bytecode rewriting (we have reasons for not doing that), I would like to point you to FastTrack, a pure-Java implementation of the Happens-Before race detection algorithm.</div><div><a href="https://github.com/stephenfreund/RoadRunner" target="_blank">https://github.com/<wbr>stephenfreund/RoadRunner</a><br></div><div>(Disclosure) I worked with the tool and the authors in my grad student days. </div><div>I see it's been updated recently too, so feel free to give it a spin.</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 31, 2017 at 4:00 AM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">dvyukov@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Aug 31, 2017 at 11:31 AM, Jiri Danek <<a href="mailto:jdanek@redhat.com">jdanek@redhat.com</a>> wrote:<br>
>> On Aug 30, 2017, at 12:51 AM, Jiri Danek via llvm-dev<br>
>> <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> I found <a href="https://github.com/google/java-thread-sanitizer" rel="noreferrer" target="_blank">https://github.com/google/<wbr>java-thread-sanitizer</a>, which seems to be<br>
>> now abandoned. It used to work with ThreadSanitizer v1. Has anybody ever<br>
>> tried to make it work with the current ThreadSanitizer?<br>
> I gave it a try and bending java-thread-sanitizer to my needs seems doable<br>
> so far:<br>
><br>
> 1) making java-thread-sanitizer compile with Gradle and run its example<br>
> under Java 8, check (although I have to pass -noverify to JVM)<br>
> 2) LD_PRELOADing libtsan.so to JVM, accessing it from JNA, check<br>
> 3) reproducing one tsan test (tests/rtl/tsan_mop.cc) with Java threads and<br>
> made up pointers passed to __tsan_write*(), check<br>
> 3) disabling Garbage Collection in JVM (just to possibly simplify things)<br>
> cannot be done, but it should not matter, because System.identityHashcode<br>
> should be unchanging, so check<br>
><br>
> With that, just put that all together and I should have a sanitizer for<br>
> java.<br>
><br>
> Only problem so far is that I don't have alternative for __tsan_func_entry,<br>
> so I cannot have reasonable stacktraces in TSan error messages. I should be<br>
> able to work around it during Java code instrumentation, to save myself<br>
> enough info to be able to make sense of the impoverished TSan messages.<br>
<br>
<br>
> I've been looking at ThreadSanitizer in<br>
> <a href="https://github.com/llvm-mirror/compiler-rt" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/compiler-rt</a> and I noticed some Java-related<br>
> files. Is there a version of ThreadSanitizer build on top of that, which I<br>
> could use to sanitize my Java programs? I could not find any.<br>
<br>
<br>
+Jaeheon, Alexander, Jeremy<br>
</blockquote></div><br></div>