JDK-8278174 : runtime/cds/appcds/LambdaWithJavaAgent.java fails with release VMs
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-12-02
  • Updated: 2021-12-04
  • Resolved: 2021-12-03
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 18
18 masterFixed
Related Reports
Relates :  
Description
[STDERR]
Error: VM option 'AllowArchivingWithJavaAgent' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.
Error: The unlock option must precede 'AllowArchivingWithJavaAgent'.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

[2021-12-02T21:48:45.275016688Z] Waiting for completion for process 308209
[2021-12-02T21:48:45.275393307Z] Waiting for completion finished for process 308209
STDERR:
 stdout: [];
 stderr: [Error: VM option 'AllowArchivingWithJavaAgent' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.
Error: The unlock option must precede 'AllowArchivingWithJavaAgent'.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
]
 exitValue = 1

java.lang.RuntimeException: 'Loading classes to share' missing from stdout/stderr

    at jdk.test.lib.process.OutputAnalyzer.shouldContain(OutputAnalyzer.java:221)
    at jdk.test.lib.cds.CDSTestUtils.checkDump(CDSTestUtils.java:273)
    at jdk.test.lib.cds.CDSTestUtils.createArchiveAndCheck(CDSTestUtils.java:297)
    at LambdaWithJavaAgent.main(LambdaWithJavaAgent.java:76)
    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:833)

Comments
The fix for this bug is in jdk-18+27-1834.
03-12-2021

Changeset: 473ececa Author: Jie Fu <jiefu@openjdk.org> Date: 2021-12-03 06:00:14 +0000 URL: https://git.openjdk.java.net/jdk/commit/473ececaf5df8392e76d022d7126770526be31f7
03-12-2021