JDK-8237388 : serviceability/dcmd/framework/VMVersionTest.java fails with connection refused error.
  • Type: Bug
  • Component: core-svc
  • Sub-Component: tools
  • Affected Version: 15,16,17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2020-01-16
  • Updated: 2025-01-29
  • Resolved: 2021-06-08
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 17
17 b26Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
Running DCMD 'VM.version' through 'JMXExecutor'
---------------- stdout ----------------
Java HotSpot(TM) 64-Bit Server VM version 15-ea+6-109
JDK 15.0.0

---------------- stderr ----------------

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

test VMVersionTest.jmx(): success
debugee.stdout> Test Java process started!
debugee.stderr> Exception in thread "main" nsk.share.Failure: Unable to attach for IOPipe connection to localhost:49196 for 120000ms timeout:
debugee.stderr> 	java.net.ConnectException: Connection refused
debugee.stderr> 	at nsk.share.jpda.BasicSocketConnection.continueAttach(SocketConnection.java:281)
debugee.stderr> 	at nsk.share.jpda.SocketConnection.continueAttach(SocketConnection.java:485)
debugee.stderr> 	at nsk.share.jpda.SocketIOPipe.connect(SocketIOPipe.java:240)
debugee.stderr> 	at nsk.share.jpda.IOPipe.connect(IOPipe.java:88)
debugee.stderr> 	at nsk.share.jpda.SocketIOPipe.println(SocketIOPipe.java:181)
debugee.stderr> 	at process.TestJavaProcess.main(TestJavaProcess.java:47)
test VMVersionTest.mainClass(): failure
nsk.share.Failure: Unable to send object throw not established IOPipe connection:
	quit
	at nsk.share.jpda.SocketConnection.writeObject(SocketConnection.java:564)
	at nsk.share.jpda.SocketIOPipe.println(SocketIOPipe.java:183)
	at TestProcessLauncher.quit(TestProcessLauncher.java:80)
	at VMVersionTest.mainClass(VMVersionTest.java:68)
	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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:773)
	at org.testng.TestRunner.run(TestRunner.java:623)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
	at org.testng.SuiteRunner.run(SuiteRunner.java:259)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1110)
	at org.testng.TestNG.run(TestNG.java:1018)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94)
	at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54)
	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)
debugee.stdout> Test Java process started!
debugee.stdout> Waiting for the quit command from the test ...
Comments
Changeset: b568e879 Author: Alex Menkov <amenkov@openjdk.org> Date: 2021-06-08 17:05:22 +0000 URL: https://git.openjdk.java.net/jdk/commit/b568e87947a5d7f1d8c20e3e8a8b2b7f77265c8b
08-06-2021

Also there is an issue with TestProcessLauncher.quit() method. General schema of the testcases is TestProcessLauncher t = ...; try { t.launch(); .. perform testing ... } finally { t.quit(); } But if target VM failed to connect to IOPipe t.quit() throws new exception as it tests only that IOPipe object is not null, but does not verify it's connected
12-05-2021

The logic of the test is: - creates target VM; - creates server part of IOPipe to communicate with target VM; - target VM connects to IOPipe socket. The reason of the failure is target VM is started too fast and tries to connect to IOPipe before the test starts listening. Looks like this is common logic for many tests in nsk (which use IOPipe to communicate with debuggee), so we can get similar failures with other tests.
12-05-2021

Resetting to New to we can triage this CR again and figure out how to handle it.
10-05-2021

---------------- stderr ---------------- ---------------------------------------- test VMVersionTest.jmx(): success debugee.stdout> Test Java process started! debugee.stderr> Exception in thread "main" nsk.share.Failure: Unable to attach for IOPipe connection to localhost:49457 for 120000ms timeout: debugee.stderr> java.net.ConnectException: Connection refused debugee.stderr> at nsk.share.jpda.BasicSocketConnection.continueAttach(SocketConnection.java:281) debugee.stderr> at nsk.share.jpda.SocketConnection.continueAttach(SocketConnection.java:485) debugee.stderr> at nsk.share.jpda.SocketIOPipe.connect(SocketIOPipe.java:240) debugee.stderr> at nsk.share.jpda.IOPipe.connect(IOPipe.java:90) debugee.stderr> at nsk.share.jpda.SocketIOPipe.println(SocketIOPipe.java:181) debugee.stderr> at process.TestJavaProcess.main(TestJavaProcess.java:47) test VMVersionTest.mainClass(): failure nsk.share.Failure: Unable to send object throw not established IOPipe connection: quit at nsk.share.jpda.SocketConnection.writeObject(SocketConnection.java:564) at nsk.share.jpda.SocketIOPipe.println(SocketIOPipe.java:183) at TestProcessLauncher.quit(TestProcessLauncher.java:80) at VMVersionTest.mainClass(VMVersionTest.java:68) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85) at org.testng.internal.Invoker.invokeMethod(Invoker.java:639) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108) at org.testng.TestRunner.privateRun(TestRunner.java:773) at org.testng.TestRunner.run(TestRunner.java:623) at org.testng.SuiteRunner.runTest(SuiteRunner.java:357) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310) at org.testng.SuiteRunner.run(SuiteRunner.java:259) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1185) at org.testng.TestNG.runSuitesLocally(TestNG.java:1110) at org.testng.TestNG.run(TestNG.java:1018) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:94) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127) at java.base/java.lang.Thread.run(Thread.java:831) debugee.stdout> Test Java process started! debugee.stdout> Waiting for the quit command from the test ... Running DCMD 'VM.version' through 'MainClassJcmdExecutor' Executing command '[/System/Volumes/Data/mesos/work_dir/jib-master/install/jdk-17+10-700/macosx-x64-debug.jdk/jdk-17/fastdebug/bin/jcmd, testprocess.jar, VM.version]' [2021-02-14T08:58:57.677025Z] Gathering output for process 28434 [2021-02-14T08:59:08.870973Z] Waiting for completion for process 28434 [2021-02-14T08:59:08.871048Z] Waiting for completion finished for process 28434 Output and diagnostic info for process 28434 was saved into 'pid-28434-output.log' [2021-02-14T08:59:08.871700Z] Waiting for completion for process 28434 [2021-02-14T08:59:08.871725Z] Waiting for completion finished for process 28434 Command returned with exit code 0 ---------------- stdout ---------------- 28431: Java HotSpot(TM) 64-Bit Server VM version 17-ea+10-LTS-700 JDK 17.0.0 ---------------- stderr ---------------- <snip> =============================================== serviceability/dcmd/framework/VMVersionTest.java Total tests run: 6, Failures: 1, Skips: 0 =============================================== ----------System.err:(14/858)---------- java.lang.Exception: failures: 1 at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:96) at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:54) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127) at java.base/java.lang.Thread.run(Thread.java:831) JavaTest Message: Test threw exception: java.lang.Exception: failures: 1 JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.lang.Exception: failures: 1 ----------rerun:(50/9740)*----------
14-02-2021