RFR (S): Make uncaught exception in child threads trigger test failure
Man Cao
manc at google.com
Thu Jul 25 21:34:52 UTC 2019
Hi all,
Can I have reviews for this:
https://cr.openjdk.java.net/~manc/tsan20190725/webrev.00/
Currently, if a child thread terminates due to an uncaught exception, such
as NullPointerException due to memory corruption, the TSAN test would still
pass. This change makes sure the test fail in such cases.
Tested with the following local modification:
--- a/test/hotspot/jtreg/tsan/NonRacyIntMemberLoopTest.java
+++ b/test/hotspot/jtreg/tsan/NonRacyIntMemberLoopTest.java
@@ -45,6 +45,9 @@ class NonRacyIntMemberLoopRunner extends
@Override
protected synchronized void run(int i) {
x = x + 1;
+ if (i % 100 == 0) {
+ throw new NullPointerException();
+ }
}
public static void main(String[] args) throws InterruptedException
The test would pass without this change, and properly fails with this
change.
-Man
More information about the tsan-dev
mailing list