JDK-8242789 : sun/tools/jhsdb/HeapDumpTestWithActiveProcess.java fails with 'JShellToolProvider' missing from stdout/stderr
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-04-15
  • Updated: 2020-04-27
  • Resolved: 2020-04-21
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.
JDK 15
15 b20Fixed
Related Reports
Relates :  
Relates :  
Description
After fixing JDK-8230731 and JDK-8242787, and HeapDumpTestWithActiveProcess.java is removed from the problem list, it sometimes fails with: 

java.lang.RuntimeException: Test ERROR java.lang.RuntimeException: 'JShellToolProvider' missing from stdout/stderr
	at JShellHeapDumpTest.printStackTraces(JShellHeapDumpTest.java:105)
	at JShellHeapDumpTest.testHeapDump(JShellHeapDumpTest.java:122)
	at JShellHeapDumpTest.main(JShellHeapDumpTest.java:164)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.RuntimeException: 'JShellToolProvider' missing from stdout/stderr
	at JShellHeapDumpTest.printStackTraces(JShellHeapDumpTest.java:102)
	... 8 more

The reason is because the test is not waiting for the main thread of the spawned jshell process to start up. Thus when the test requests a stack dump, it does not find the JShellToolProvider.

HeapDumpTestWithActiveProcess just uses JShellHeapDumpTest, but passes the "nosleep" argument so JShellHeapDumpTest does not sleep for two seconds upon launch to avoid a myriad of other potential test failures that result when trying to capture the stack dump of an active thread. However, by not delaying it means that sometims the test requests a thread dump before the jshell process has even started or entered them main thread, thus the expected symbol is missing.

The fix is to not require the presence of JShellHeapDumpTest when "nosleep" is specified.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/5719ce40ab0f User: cjplummer Date: 2020-04-21 23:15:28 +0000
21-04-2020