hg: tsan/dev: Create interface to call TSAN runtime

aeubanks at google.com aeubanks at google.com
Tue Mar 26 17:49:38 UTC 2019


Changeset: b9a33a2a9d3f
Author:    aeubanks
Date:      2019-03-26 10:09 -0700
URL:       http://hg.openjdk.java.net/tsan/dev/rev/b9a33a2a9d3f

Create interface to call TSAN runtime

$ LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/8/libtsan.so ./images/jdk/bin/java -XX:+ThreadSanitizer
works, reports some internal JVM races, and exits with 66, the default exit code when TSAN finds any races.

$ LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/8/libtsan.so TSAN_OPTIONS="exitcode=123" ./images/jdk/bin/java -XX:+ThreadSanitizer ; echo $?
Overriding the default TSAN error exit code works.

With this, the way to provide the TSAN runtime is with LD_PRELOAD. In the future we will have a better way, but this is the current short-term solution so we can iterate faster.

! src/hotspot/share/runtime/globals.hpp
! src/hotspot/share/runtime/init.cpp
+ src/hotspot/share/runtime/tsan.cpp
+ src/hotspot/share/runtime/tsanExternalDecls.hpp



More information about the tsan-dev mailing list