JDK-8303921 : serviceability/sa/UniqueVtableTest.java timed out
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 21
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2023-03-09
  • Updated: 2024-09-20
  • Resolved: 2023-03-17
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 21
21 b15Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8303924 :  
JDK-8304172 :  
Description
The following test failed in the JDK21 CI:

serviceability/sa/UniqueVtableTest.java

Here's a snippet from the log file:

#section:main
----------messages:(9/624)----------
command: main UniqueVtableTest
reason: User specified action: run main/othervm UniqueVtableTest 
started: Thu Mar 09 19:36:22 UTC 2023
Mode: othervm [/othervm specified]
Additional options from @modules: --add-modules jdk.hotspot.agent --add-exports jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.debugger=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.types=ALL-UNNAMED --add-exports jdk.hotspot.agent/sun.jvm.hotspot.types.basic=ALL-UNNAMED
Timeout information:
--- Timeout information end.
finished: Thu Mar 09 19:44:57 UTC 2023
elapsed time (seconds): 515.263
----------configuration:(7/366)----------
Boot Layer
  add modules: jdk.hotspot.agent                             
  add exports: jdk.hotspot.agent/sun.jvm.hotspot             ALL-UNNAMED
               jdk.hotspot.agent/sun.jvm.hotspot.debugger    ALL-UNNAMED
               jdk.hotspot.agent/sun.jvm.hotspot.types       ALL-UNNAMED
               jdk.hotspot.agent/sun.jvm.hotspot.types.basic ALL-UNNAMED

----------System.out:(19/2187)----------
Command line: ['/opt/mach5/mesos/work_dir/jib-master/install/jdk-21+14-1075/linux-x64-debug.jdk/jdk-21/fastdebug/bin/java' '-XX:MaxRAMPercentage=4.16667' '-Dtest.boot.jdk=/opt/mach5/mesos/work_dir/jib-master/install/jdk/19/36/bundles/linux-x64/jdk-19_linux-x64_bin.tar.gz/jdk-19' '-Djava.io.tmpdir=/opt/mach5/mesos/work_dir/slaves/782b3f2b-1fe4-42ad-a0aa-b7bf2f5b3ebf-S9633/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ca653cf0-a006-4488-b8be-75fcba263926/runs/9e175864-d06c-4096-893b-eb3945a8f3cb/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_serviceability/tmp' '-cp' '/opt/mach5/mesos/work_dir/slaves/782b3f2b-1fe4-42ad-a0aa-b7bf2f5b3ebf-S9633/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ca653cf0-a006-4488-b8be-75fcba263926/runs/9e175864-d06c-4096-893b-eb3945a8f3cb/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_serviceability/classes/5/serviceability/sa/UniqueVtableTest.d:/opt/mach5/mesos/work_dir/slaves/782b3f2b-1fe4-42ad-a0aa-b7bf2f5b3ebf-S9633/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/ca653cf0-a006-4488-b8be-75fcba263926/runs/9e175864-d06c-4096-893b-eb3945a8f3cb/testoutput/test-support/jtreg_open_test_hotspot_jtreg_tier1_serviceability/classes/5/test/lib' 'jdk.test.lib.apps.LingeredApp' 'db363039-a9c8-4d5e-b3c8-7aa3f79e3af4.lck']
LingeredApp startup took 1120ms
Check for hs_err_pid/core/mdmp files:
None.
Attaching to process ID 1642995...
Timeout refired 480 times
 LingeredApp stdout: [];
 LingeredApp stderr: []
 LingeredApp exitValue = 4991
LingeredApp.stopApp error:
java.io.IOException: LingeredApp terminated with non-zero exit code 4991
	at jdk.test.lib.apps.LingeredApp.stopApp(LingeredApp.java:427)
	at jdk.test.lib.apps.LingeredApp.stopApp(LingeredApp.java:515)
	at UniqueVtableTest.run(UniqueVtableTest.java:155)
	at UniqueVtableTest.main(UniqueVtableTest.java:175)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1623)
----------System.err:(15/927)----------
ERROR: The process with pid 1642995 does not exist.
java.io.IOException: LingeredApp terminated with non-zero exit code 4991
	at jdk.test.lib.apps.LingeredApp.stopApp(LingeredApp.java:427)
	at jdk.test.lib.apps.LingeredApp.stopApp(LingeredApp.java:515)
	at UniqueVtableTest.run(UniqueVtableTest.java:155)
	at UniqueVtableTest.main(UniqueVtableTest.java:175)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:578)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
	at java.base/java.lang.Thread.run(Thread.java:1623)

JavaTest Message: Test threw exception: java.io.IOException: LingeredApp terminated with non-zero exit code 4991
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.io.IOException: LingeredApp terminated with non-zero exit code 4991
----------rerun:(39/7576)*----------
Comments
Changeset: 02a4ee20 Author: Alex Menkov <amenkov@openjdk.org> Date: 2023-03-17 18:23:03 +0000 URL: https://git.openjdk.org/jdk/commit/02a4ee206a979858c23c22da35e70560e0f27efd
17-03-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/13030 Date: 2023-03-14 22:05:44 +0000
14-03-2023

One of the NoClassDefFoundError failure was caused by conflict with serviceability/sa/TestType.java TestType.java contains "@build jdk.test.lib.apps.*" action This causes jdk.test.lib.apps.LingeredApp is compiled and LingeredApp.class is put to test/lib/jdk/test/lib But jdk.test.lib.Utils is put to the test class dir So the next test which uses LingeredApp and don't have explicit "@build" action uses LingeredApp.class from test/lib directory, but cannot find jdk.test.lib.Utils class There are some other tests in the serviceability/sa with the same issue: ./TestIntConstant.java:38: * @build jdk.test.lib.apps.* ./TestPrintMdo.java:37: * @build jdk.test.lib.apps.* ./TestType.java:38: * @build jdk.test.lib.apps.* ./TestUniverse.java:40: * @build jdk.test.lib.apps.* So we just were lucky to not have NoClassDefFoundError errors before (there are a lot of tests which use LinderedApp and don't have explicit "@build" actions)
13-03-2023

As far as I understand NoClassDefFoundError failures are caused by CODETOOLS-7902847
13-03-2023

All other tests which uses HotSpotAgent to test SA don't use main process for testing. They run target sub-process and then run test sub-process which attaches to the target and perform the testing. They call SATestUtils.addPrivilegesIfNeeded() for the test sub-process. addPrivilegesIfNeeded does nothing on linux, so this is not the problem in the case. I updated UniqueVtableTest to follow the same scheme - attach from sub-process and the issue went away.
13-03-2023

Here's a log file snippet for the jdk-21+14-1107-tier4 sighting: serviceability/sa/UniqueVtableTest.java ----------System.err:(19/1142)---------- java.lang.NoClassDefFoundError: jdk/test/lib/Utils at jdk.test.lib.apps.LingeredApp.startApp(LingeredApp.java:495) at jdk.test.lib.apps.LingeredApp.startApp(LingeredApp.java:507) at UniqueVtableTest.run(UniqueVtableTest.java:138) at UniqueVtableTest.main(UniqueVtableTest.java:175) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:578) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125) at java.base/java.lang.Thread.run(Thread.java:1623) Caused by: java.lang.ClassNotFoundException: jdk.test.lib.Utils at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ... 8 more JavaTest Message: Test threw exception: java.lang.NoClassDefFoundError: jdk/test/lib/Utils JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.lang.NoClassDefFoundError: jdk/test/lib/Utils ----------rerun:(42/8160)*---------- So it does look like this test has more than one problem... sigh...
12-03-2023

Failure on Windows is completely different: java.lang.NoClassDefFoundError: jdk/test/lib/Utils at jdk.test.lib.apps.LingeredApp.startApp(LingeredApp.java:495) at jdk.test.lib.apps.LingeredApp.startApp(LingeredApp.java:507) at UniqueVtableTest.run(UniqueVtableTest.java:138) at UniqueVtableTest.main(UniqueVtableTest.java:175) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:578) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125) at java.base/java.lang.Thread.run(Thread.java:1623) Caused by: java.lang.ClassNotFoundException: jdk.test.lib.Utils at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ... 8 more
11-03-2023

The same failure on linux-aarch64-debug
09-03-2023

For some reason test cannot attach to target app on linux-x64-debug Going to problem list the test on the platform until the reason if found and fixed
09-03-2023

The new test has timed out in two Tier1 job sets in a row so I've bumped the priority from P3 -> P2.
09-03-2023