JDK-8204110 : serviceability/sa/ClhsdbSymbol.java and ClhsdbInspect.java failed when running in CDS mode
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-05-30
  • Updated: 2018-06-19
  • Resolved: 2018-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 11
11 b18Fixed
Related Reports
Relates :  
Description
Steps to reproduce:
1. Create CDS archive (java -Xshare:dump)
2. Run the test using jtreg

serviceability/sa/ClhsdbSymbol.java
    Test ERROR java.lang.RuntimeException: 'java/util/HashMap' missing from stdout/stderr

serviceability/sa/ClhsdbInspect.java
    Test ERROR java.lang.RuntimeException: 'Type is Method' missing from stdout/stderr
Comments
For the ClhsdbInspect.java test with CDS enabled, it failed when hsdb tried to "inspect" a method. There was no output from hsdb: inspect 0x000000080012fde8 Starting clhsdb against 47188 Warning! JS Engine can't start, some commands will not be available. hsdb> hsdb> The above address corresponds to: - java.lang.Thread.sleep(long) @bci=0, pc=0x00007f7754c9a68b, Method*=0x000000080012fde8 (Interpreted frame) Without using CDS, the same method has the following address: - java.lang.Thread.sleep(long) @bci=0, pc=0x00007f60b4c9a64b, Method*=0x00007f608d459ab0 (Interpreted frame) So it seems hsdb couldn't find the method if it's in the CDS archive.
01-06-2018

Looks like the SymbolTable::dump should be modified to also dump from SymbolTable::_shared_table.
01-06-2018

For the ClhsdbSymbol.java test, the following strings expected by the test are missing when running in CDS mode: java/util/HashMap LambdaMetafactory PerfCounter isAnonymousClass JVMTI_THREAD_STATE_TERMINATED jdi checkGetClassLoaderPermission The problem could be reproduced by simply running a java program which sleeps for a long time, while the java program is sleeping use jhsdb to attach to the running program and then do a "symboldump" within the jhsdb. public class MySleep { public static void main(String[] args) throws InterruptedException { long start = System.currentTimeMillis(); Thread.sleep(60000); System.out.println("Sleep time in ms = " + (System.currentTimeMillis() - start)); } } While the above program is sleep, find its pid and start jhsdb as follows: jhsdb clhsdb --pid <pid> at the hsdb> prompt, enter the "symboldump" command: hsdb> symboldump (note: one can redirect symboldump output to a file such as "symboldump > sym.txt") Attached symboldump output: sym_cds.txt - using CDS sym_no_cds.txt - not using CDS
01-06-2018