JDK-8282690 : runtime/CommandLine/VMDeprecatedOptions.java fails after JDK-8281181
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 19
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2022-03-04
  • Updated: 2022-03-14
  • Resolved: 2022-03-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 19
19 b13Fixed
Related Reports
Relates :  
Sub Tasks
JDK-8282694 :  
Description
The following test failed in the JDK19 CI:

runtime/CommandLine/VMDeprecatedOptions.java

Here's a snippet from the log file:

----------System.err:(27/1938)----------
 stdout: [];
 stderr: [Java HotSpot(TM) 64-Bit Server VM warning: Option MaxGCMinorPauseMillis was deprecated in version 8.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Option MaxRAMFraction was deprecated in version 10.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Option MinRAMFraction was deprecated in version 10.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Option InitialRAMFraction was deprecated in version 10.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Option TLABStats was deprecated in version 12.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Option AllowRedefinitionToAddDeleteMethods was deprecated in version 13.0 and will likely be removed in a future release.
Java HotSpot(TM) 64-Bit Server VM warning: Option UseContainerCpuShares was deprecated in version 19.0 and will likely be removed in a future release.
Unrecognized VM option 'UseContainerCpuShares'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
]
 exitValue = 1

java.lang.RuntimeException: Expected to get exit value of [0]

	at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:489)
	at VMDeprecatedOptions.testDeprecated(VMDeprecatedOptions.java:84)
	at VMDeprecatedOptions.main(VMDeprecatedOptions.java:118)
	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.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:312)
	at java.base/java.lang.Thread.run(Thread.java:828)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expected to get exit value of [0]
Comments
Changeset: cde923dd Author: Ioi Lam <iklam@openjdk.org> Date: 2022-03-08 00:19:07 +0000 URL: https://git.openjdk.java.net/jdk/commit/cde923dd471a22cd69ea2cd4994bb16eba780804
08-03-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7712 Date: 2022-03-05 08:07:47 +0000
05-03-2022

<sigh> Not often we have platform specific flags like this. The test will need to use Platform.isLinux() to guard the addition of these flags to the list.
05-03-2022

$ git diff -r 8acfbc2e21063c3dc088c25c1574bcefa94e5a24 test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java diff --git a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java index a8b5bb31194..164aaa4d9a0 100644 --- a/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java +++ b/test/hotspot/jtreg/runtime/CommandLine/VMDeprecatedOptions.java @@ -54,6 +54,8 @@ public class VMDeprecatedOptions { {"InitialRAMFraction", "64"}, {"TLABStats", "false"}, {"AllowRedefinitionToAddDeleteMethods", "true"}, + {"UseContainerCpuShares", "false"}, + {"PreferContainerQuotaForCPUCount", "true"}, // deprecated alias flags (see also aliased_jvm_flags): {"DefaultMaxRAMFraction", "4"}, Both UseContainerCpuShares and PreferContainerQuotaForCPUCount were added to this test by JDK-8281181 and both are linux-only flags. I'm going to guess that we only see UseContainerCpuShares fail because it is tested before PreferContainerQuotaForCPUCount, but I suspect that both are a problem. [~dholmes] - Can you chime in on this bug when you the get the chance?
04-03-2022

src/hotspot/os/linux/globals_linux.hpp: product(bool, UseContainerCpuShares, false, \ "(Deprecated) Include CPU shares in the CPU availability" \ " calculation.") \ So the flag is only defined on Linux. That explains the platforms.
04-03-2022

The test failed on macosx-aarch64, macosx-x64, and windows-x64. The test passed on linux-aarch64 and linux-x64. I can't explain that mix of platforms yet.
04-03-2022

[~iklam]. - Can you take a look?
04-03-2022

The jdk-19+13-762-tier1 build-ID only contains the fix for: JDK-8281181 Do not use CPU Shares to compute active processor count
04-03-2022