8203431: TestFloatsOnStackDeopt.java throws java.lang.LinkageError: loader <bootstrap> attempted duplicate class definition for java.lang.invoke.BoundMethodHandle$Species_LLL
authorbulasevich
Tue, 22 May 2018 14:54:55 +0200
changeset 50212 c4800cdd45c7
parent 50211 5afedc9e4662
child 50213 3085969bdf91
8203431: TestFloatsOnStackDeopt.java throws java.lang.LinkageError: loader <bootstrap> attempted duplicate class definition for java.lang.invoke.BoundMethodHandle$Species_LLL Reviewed-by: redestad
test/hotspot/jtreg/ProblemList.txt
test/hotspot/jtreg/compiler/runtime/TestFloatsOnStackDeopt.java
--- a/test/hotspot/jtreg/ProblemList.txt	Tue May 22 14:44:18 2018 +0200
+++ b/test/hotspot/jtreg/ProblemList.txt	Tue May 22 14:54:55 2018 +0200
@@ -46,7 +46,6 @@
 compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8140405 generic-all
 compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all
 compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java 8163894 generic-all
-compiler/runtime/TestFloatsOnStackDeopt.java 8203431 generic-all
 compiler/tiered/LevelTransitionTest.java 8067651 generic-all
 compiler/types/correctness/CorrectnessTest.java 8066173 generic-all
 compiler/types/correctness/OffTest.java 8066173 generic-all
--- a/test/hotspot/jtreg/compiler/runtime/TestFloatsOnStackDeopt.java	Tue May 22 14:44:18 2018 +0200
+++ b/test/hotspot/jtreg/compiler/runtime/TestFloatsOnStackDeopt.java	Tue May 22 14:54:55 2018 +0200
@@ -39,6 +39,7 @@
     private static final int ITERS2 = 40000;
     private static final float VALUE = 15.f;
     public static String dummyString = "long long string";
+    static volatile boolean pleaseStop = false;
 
     static void run_loop_with_safepoint(float[] a0, float b) {
         // Non-counted loop with safepoint.
@@ -54,9 +55,9 @@
         // thread provokes frequent GC - together with +DeoptimizeALot and safepoint it forces executed function deoptimization
         Thread th = new Thread() {
             public void run() {
-                while(true) {
+                while (!pleaseStop) {
                     synchronized(this) { try { wait(1); } catch (Exception ex) {} }
-                    dummyString += dummyString;
+                    dummyString = new StringBuilder(dummyString).append(dummyString).toString();
                     if (dummyString.length() > 1024*1024) { dummyString = "long long string"; }
                 }
             }
@@ -77,7 +78,12 @@
             if (errn > 0) break;
         }
 
-        th.stop();
+        pleaseStop = true;
+        try {
+            th.join();
+        } catch (InterruptedException e) {
+            throw new Error("InterruptedException in main thread ", e);
+        }
         return errn;
     }