Welcome to the
TsanTSAN Project!
The goal of this Project is to explore and incubate a Thread SANitizing (TSAN) feature that could be integrated into the HotSpot JVM and the JVM Tool Interface (JVM TI). This includes working, evaluating, and incubating a Thread Sanitizer implementation for Java.
The rest of this page will provide basic information for downloading, building, and testing Java TSAN.
Note: Java TSAN is not working yet and will not be able to provide any data race information yet. The information below is really how to clonebuild/test for developers and testers:
Prerequistes
Java TSAN is dependent on the C/C++ ThreadSanitizer implementation for GCC. Developers and users need to ensure that libtsan.so is available. e.g.:
sudo apt install libgcc-8-dev
ldconfig -p | grep libtsan
It should print the path to libtsan.so.
Building
Java TSAN implementation is in the "tsan" branch in the Mercurial repository. Developers need to clone this branchCloning:
hg clone --branch tsan http://hg.openjdk.java.net/tsan/dev jdk-tsan
TODO: since TSAN is not even integrated yet, the JDK you just branched is the mainline.Running:
Java TSAN exists as a JVM feature "tsan", which is enabled by default on the "tsan" branch in the repository. It can be disabled with the configure flag "--with-jvm-features=-tsan
".
Running
Note: the method of including the TSAN runtime in the JVM is not finalized and will definitely could change in the future.
First ensure you have libtsan.so available. e.g.:
sudo apt install libgcc-8-dev
.
soRun Java with TSAN enabled:
LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/8/libtsan.so ./images/jdk/bin/java -XX:+ThreadSanitizer
Testing
:The tests for TSAN are at test/hotspot/jtreg/tsan/
make
LD_PRELOAD
. Instead, run:make jdk-image test-image
JTREG=path/to/jtreg
JDK_ROOT=path/to/tsan_jdk
$JTREG -e:LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/8/libtsan.so -jdk:$JDK_ROOT/build/images/jdk/ -nativepath:$JDK_ROOT/build/images/test/hotspot/jtreg/native/ -e:TSAN_OPTIONS=suppressions=$JDK_ROOT/bin/tsan.supp $JDK_ROOT/test/make test TEST="hotspot/jtreg/tsan/
$JDK_ROOT
must be an absolute path because -nativepath
only works with an absolute path."
Resources
- Tsan TSAN Project
- TSAN JEP proposal
- Repositories
- Mailing list: tsan-dev
Recent space activity
Recently Updated | ||||||||
---|---|---|---|---|---|---|---|---|
|
Space contributors
Contributors | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|