JDK-8283610 : runtime/Thread/StopAtExit.java failing in loom repo
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-loom
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-03-24
  • Updated: 2022-05-24
  • Resolved: 2022-05-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-loomFixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
This test depends on a private method in ThreadGroup and book keeping that does not exist in the loom repo. In addition the async exception leads to exceptions in class loading when the victim thread exits - this surfaces in the main thread when it attempts to invoke a method in that class.

Exception: java.lang.ThreadDeath thrown from the UncaughtExceptionHandler in thread "Thread-1"
java.lang.NoClassDefFoundError: Could not initialize class java.lang.Thread$State
	at java.base/jdk.internal.misc.VM.toThreadState(VM.java:348)
	at java.base/java.lang.Thread.threadState(Thread.java:2777)
	at java.base/java.lang.Thread.getThreadGroup(Thread.java:1963)
	at java.base/java.lang.ThreadGroup.activeCount(ThreadGroup.java:364)
	at StopAtExit.main(StopAtExit.java:127)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:1532)

Excluding the test for now, need to decide if this test should be deleted in the loom repo.
Comments
Here's the context diff for the ProblemList removal: $ git diff diff --git a/test/hotspot/jtreg/ProblemList.txt b/test/hotspot/jtreg/ProblemList.txt index 4c6c147b8cf..a4d25af639c 100644 --- a/test/hotspot/jtreg/ProblemList.txt +++ b/test/hotspot/jtreg/ProblemList.txt @@ -176,9 +176,6 @@ vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn001/forceEa # Loom -# obsolete test using Thread.stop -runtime/Thread/StopAtExit.java 8283610 generic-all - runtime/Thread/TooSmallStackSize.java 8285832 windows-x64 #### fibers branch only failures And here's the test results: $ do_java_test runtime/Thread/StopAtExit.java INFO: GNUMAKE=make INFO: GNUMAKE version is: GNU Make 3.81 INFO: JTREG options: INFO: JOBS=4 INFO: TEST_MODE=agentvm INFO: EXTRA_PROBLEM_LISTS=ProblemList-extra.txt INFO: VM_OPTIONS= INFO: test_val=runtime/Thread/StopAtExit.java Test Config: macosx-x86_64-normal-server-release INFO: TIMEOUT_FACTOR=4 Done testing Test Run macosx-x86_64-normal-server-release time: 0.76 minutes. TEST TOTAL PASS FAIL ERROR jtreg:open/test/hotspot/jtreg/runtime/Thread/StopAtExit.java 1 1 0 0 Test Config: macosx-x86_64-normal-server-fastdebug INFO: TIMEOUT_FACTOR=6 Done testing Test Run macosx-x86_64-normal-server-fastdebug time: 0.90 minutes. TEST TOTAL PASS FAIL ERROR jtreg:open/test/hotspot/jtreg/runtime/Thread/StopAtExit.java 1 1 0 0 Test Config: macosx-x86_64-normal-server-slowdebug INFO: TIMEOUT_FACTOR=12 Done testing Test Run macosx-x86_64-normal-server-slowdebug time: 1.39 minutes. TEST TOTAL PASS FAIL ERROR jtreg:open/test/hotspot/jtreg/runtime/Thread/StopAtExit.java 1 1 0 0 Total test time: 3.05 minutes.
03-05-2022

I integrated the following two fixes into jdk/jdk today: JDK-8284632 runtime/Thread/StopAtExit.java possibly leaking memory again JDK-8285507 revert fix for JDK-8282704 now that JDK-8282952 is fixed When the above two fixes land in the Loom repos, I'll be able to check the status of runtime/Thread/StopAtExit.java in that repo.
02-05-2022

With [~dholmes] change here: JDK-8282952 Thread::exit should be immune to Thread.stop the memory leak recovery logic should no longer be necessary. I just haven't had a chance to prove that and remove the code (yet).
18-04-2022

We will need to decide whether to delete or change this test. The updated test (to use JVMTI StopThread) is still tied to TG bookkeeping that does not exist in the loom repo. Furthermore, the terminally degraded destroy/isDestroyed methods have been degraded in the loom repo to do nothing.
18-04-2022

I already updated the test to use JVM/TI StopThread(). See: JDK-8283467 runtime/Thread/StopAtExit.java needs updating
14-04-2022

The test should be updated after stop() deprecation.
14-04-2022