JDK-8280767 : -XX:ArchiveClassesAtExit does not archive BoundMethodHandle$Species classes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-01-27
  • Updated: 2022-02-04
  • Resolved: 2022-02-04
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 masterFixed
Related Reports
Relates :  
Description
Please download the attached CDSLambdaInvokerTestDyn.sh and CDSLambdaInvokerTest.java, and run:

$ bash CDSLambdaInvokerTestDyn.sh $TESTBED
+ mybuild/images/jdk/bin/javac CDSLambdaInvokerTest.java
+ mybuild/images/jdk/bin/jar cf CDSLambdaInvokerTest.jar CDSLambdaInvokerTest.class
+ mybuild/images/jdk/bin/java -cp CDSLambdaInvokerTest.jar -XX:ArchiveClassesAtExit=CDSLambdaInvokerTestDyn.jsa -Xlog:cds+class=debug CDSLambdaInvokerTest
+ cat
+ mybuild/images/jdk/bin/java -XX:SharedArchiveFile=CDSLambdaInvokerTestDyn.jsa -cp CDSLambdaInvokerTest.jar -Xlog:class+load CDSLambdaInvokerTest
+ cat
============ checking dumping status ==================================================
***** FAILED: BoundMethodHandle$Species_FL should be archived
============ checking if lambda form classes/methods are loaded from CDS ==============
***** FAILED: BoundMethodHandle$Species_FL should be loaded from top archive



Comments
Changeset: 8e4ef818 Author: Yumin Qi <minqi@openjdk.org> Date: 2022-02-04 19:20:22 +0000 URL: https://git.openjdk.java.net/jdk/commit/8e4ef818a90de35ae75e7f82a780653d623bb29c
04-02-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk/pull/7329 Date: 2022-02-02 23:26:32 +0000
03-02-2022

ILW = MLM = P4
01-02-2022

The dynamic dump does not archive the speices lambda classes due to following code: JVM_LogLambdaFormInvoker: if (DynamicDumpSharedSpaces) { // Note: LambdaFormInvokers::append_filtered and LambdaFormInvokers::append take same format which is not // same as below the print format. The line does not include LAMBDA_FORM_TAG. LambdaFormInvokers::append_filtered(os::strdup((const char*)c_line, mtInternal)); } Here, we only append the ones in filtering list. It should not do this here. The filtering only for storing the LF(SPECIES)_RESOLVE lines in static dump.
28-01-2022