JDK-8240691 : ClhsdbCDSJstackPrintAll incorrectly thinks CDS is in use
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • Submitted: 2020-03-06
  • Updated: 2020-03-18
  • Resolved: 2020-03-10
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 b14Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
The test (and also ClhsdbCDSCore ) use the following to check if CDS is on:

    List<String> cmds = List.of("flags UseSharedSpaces");
    String useSharedSpacesOutput = test.run(theApp.getPid(), cmds,
                                                    null, null);
    ....
    if (!useSharedSpacesOutput.contains("true")) {
        // CDS archive is not mapped. Skip the rest of the test.

But the output looks like this:

    hsdb> hsdb> + verbose true
    hsdb> + flags UseSharedSpaces
    UseSharedSpaces = false command line
    hsdb> + quit

I think at one point the "if" worked, but the "+ verbose true" part of the log must have been added recently to cause the "if" to determine the wrong result.

Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/8c0b7b88b646 User: minqi Date: 2020-03-10 18:53:29 +0000
10-03-2020

The tests should check: 72 if (!useSharedSpacesOutput.contains("true")) { 73 // CDS archive is not mapped. Skip the rest of the test. 74 LingeredApp.stopApp(theApp); 75 throw new SkippedException("The CDS archive is not mapped"); 76 } 77 => if (useSharedSpacesOutput.contains("UseSharedSpaces = false")) { Under no shared case, skip the tests.
09-03-2020