<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><blockquote type="cite"><div><div class="gmail-h5"><div>On Aug 30, 2017, at 12:51 AM, Jiri Danek via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div></div></div><div><div><div class="gmail-h5"><div dir="ltr"><div>I found <a href="https://github.com/google/java-thread-sanitizer" target="_blank">https://github.com/<wbr>google/java-thread-sanitizer</a>, which seems to be now abandoned. It used to work with ThreadSanitizer v1. Has anybody ever tried to make it work with the current ThreadSanitizer?</div></div></div></div></div></blockquote></div></div></blockquote><div>I gave it a try and bending java-thread-sanitizer to my needs seems doable so far:</div><div><br></div><div>1) making java-thread-sanitizer compile with Gradle and run its example under Java 8, check (although I have to pass -noverify to JVM)<br></div><div>2) LD_PRELOADing libtsan.so to JVM, accessing it from JNA, check</div><div>3) reproducing one tsan test (tests/rtl/tsan_mop.cc) with Java threads and made up pointers passed to __tsan_write*(), check</div><div>3) disabling Garbage Collection in JVM (just to possibly simplify things) cannot be done, but it should not matter, because System.identityHashcode should be unchanging, so check</div><div><br></div><div>With that, just put that all together and I should have a sanitizer for java.</div><div><br></div><div>Only problem so far is that I don't have alternative for __tsan_func_entry, so I cannot have reasonable stacktraces in TSan error messages. I should be able to work around it during Java code instrumentation, to save myself enough info to be able to make sense of the impoverished TSan messages.</div><div><br></div><div>Cheers,</div></div><div>-- <br></div><div class="gmail_signature"><div dir="ltr"><div>Jiří Daněk</div></div></div>
</div></div>