RFR: 8289612: Change hotspot/jtreg tests to not use Thread.stop

David Holmes dholmes at openjdk.org
Fri Jul 15 01:46:08 UTC 2022


On Fri, 15 Jul 2022 00:11:16 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:

> The tests are updated to don't use Thread.stop(). Tests whose intention is to verify async exception updated to use jvmti StopThread.

Hi Leonid,

Can we avoid all the agent stuff by defining a JVMTI helper class in the test library:


public class JVMTI {
  private native void stopThread(Thread t, Throwable ex);
  public void stopThread(Thread t) {
    stopThread(t, new ThreadDeath());
  }
}


And in cpp file just use GetEnv to get JVMTIEnv and call stopThread?

Otherwise the conversions seem quite reasonable.

Thanks.

test/hotspot/jtreg/vmTestbase/gc/gctests/mallocWithGC2/mallocWithGC2.java line 116:

> 114: 
> 115:                         tArray[0].join(); // wait for the javaHeapEater Thread to finish
> 116:                         tArray[1].stop(); // Once javaHeapEater is finished, stop the

So without this the other thread will run for a full 3 minutes - is that a concern?

-------------

PR: https://git.openjdk.org/jdk/pull/9505


More information about the hotspot-dev mailing list