JDK-8235563 : [TESTBUG] appcds/CommandLineFlagComboNegative.java does not handle archive mapping failure
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11.0.7-oracle
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86_64
  • Submitted: 2019-12-09
  • Updated: 2022-02-24
  • Resolved: 2019-12-18
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 11 JDK 13 JDK 15
11.0.7-oracleFixed 13.0.4Fixed 15 b02Fixed
Related Reports
Relates :  
Description
tier2 test failure 
runtime/appcds/CommandLineFlagComboNegative.java

----------System.err:(24/1279)---------- 
 stdout: [Error occurred during initialization of VM 
Unable to use shared archive. 
]; 
 stderr: [Java HotSpot(TM) 64-Bit Server VM warning: Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled 
An error has occurred while processing the shared archive file. 
Unable to map MiscData shared space at required address. 
] 
 exitValue = 1 

Comments
Fix request (13u): on behalf of Ekaterina Vergizova (katya@azul.com) I'd like to backport it to 13u as well. The original patch was amended, see https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-June/003298.html
15-06-2020

Fix request (11u): Requesting backport of this test fix for Oracle 11.0.7 parity. Patch applies cleanly but does not work. It had to be amended. RFR mail was sent out: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2020-March/002782.html
13-03-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/6b8a675f35e1 User: ccheung Date: 2019-12-18 00:46:54 +0000
18-12-2019

The mapping failures shouldn't on 14 anymore, due to JDK-8231610 (Relocate the CDS archive if it cannot be mapped to the requested address).
14-12-2019

The test scenario using the UseAppCDS option was removed in JDK12 via the fix for JDK-8204591: Expire/remove the UseAppCDS option in JDK 12. Other test scenarios could fail in the same way. A potential patch to handle archive mapping failure is as follows: bash-4.2$ hg diff CommandLineFlagComboNegative.java diff --git a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagComboNegative.java b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagComboNegative.java --- a/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagComboNegative.java +++ b/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagComboNegative.java @@ -86,9 +86,14 @@ TestCommon.checkDump(dumpOutput, "Loading classes to share"); - OutputAnalyzer execOutput = TestCommon.exec(appJar, testEntry.testOptionForExecuteStep, "Hello"); - execOutput.shouldContain(testEntry.expectedErrorMsg); - execOutput.shouldHaveExitValue(testEntry.expectedErrorCode); + TestCommon.run( + "-cp", appJar, + testEntry.testOptionForExecuteStep, + "Hello") + .assertAbnormalExit(output -> { + output.shouldContain(testEntry.expectedErrorMsg) + .shouldHaveExitValue(testEntry.expectedErrorCode); + }); } }
14-12-2019

According to the log, below is the reason for the failure and not due to the mismatch of ObjectAlignmentInBytes as indicated in the title of this bug. ----------System.err:(24/1279)---------- stdout: [Error occurred during initialization of VM Unable to use shared archive. ]; stderr: [Java HotSpot(TM) 64-Bit Server VM warning: Ignoring obsolete option UseAppCDS; AppCDS is automatically enabled An error has occurred while processing the shared archive file. Unable to map MiscData shared space at required address. ] exitValue = 1 The test scenario was testing the following combination: CommandLineFlagComboNegative: dump = -XX:-UseAppCDS CommandLineFlagComboNegative: execute = -XX:+UseAppCDS
10-12-2019