RFR (S): Supports statically linking TSAN runtime into the launcher with Clang
Man Cao
manc at google.com
Tue May 14 05:08:29 UTC 2019
Hi all,
Can I have reviews for this patch that hopefully will unblock us from the
libtsan.so's version issue?
https://cr.openjdk.java.net/~manc/tsan20190513/webrev.00/
This is a workaround for the version issue with libtsan.so in GCC. If we
build the JDK with Clang, we will have a newer version of the TSAN runtime
statically linked into the launcher:
$ nm images/jdk/bin/java | grep tsan_symbolize
000000000048e640 W __tsan_symbolize_external
000000000048e650 W __tsan_symbolize_external_ex
In the long term, Java TSAN will still work with GCC, but stack trace
symbolization will be broken until OpenJDK can be built with GCC9, which
contains the new version of libtsan.so that we need.
Also need to write distinct values to the global variable in
libAbstractNativeLoop.cpp, otherwise some optimization in Clang could treat
the variable as constant, and TSAN reports "Write of size 1" instead of
"size 4".
I have tested this with both LLVM 8.0.0 and GCC.
-Man
More information about the tsan-dev
mailing list