JDK-8265393 : VM crashes if both -XX:+RecordDynamicDumpInfo and -XX:SharedArchiveFile options are specified
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-04-17
  • Updated: 2023-12-25
  • Resolved: 2021-04-24
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 17
17 b20Fixed
Related Reports
Duplicate :  
Relates :  
Description
JDK-8259070 adds a functionality to jcmd for dumping CDS archive on a running java process.

To reproduce the issue:
1. Start a java app.
2. While the app is still running, use jcmd to create a dynamic CDS archive:
    e.g. jcmd <pid> VM.cmd dynamic_dump
3. Run the app again with the dynamic CDS archive and the -XX:+RecordDynamicDumpInfo option:
    e.g. java  -XX:+RecordDynamicDumpInfo -XX:SharedArchiveFile=java_pid<pid>_dynamic.jsa -cp myApp.jar myApp
Comments
URL: https://github.com/openjdk/jdk/commit/20a373a0d00b72f0c6dceb19efca3b7cc34335e5 Author: Yumin Qi <minqi@openjdk.org> Date: Fri Apr 23 21:51:11 2021 +0000
25-12-2023

Changeset: 20a373a0 Author: Yumin Qi <minqi@openjdk.org> Date: 2021-04-23 21:51:11 +0000 URL: https://git.openjdk.java.net/jdk/commit/20a373a0
24-04-2021

ILW = HLM = P3
20-04-2021

C++ standard does not have a define for comparing with NULL, that depends on the language implementor. We should add check before call strcmp just like Windows version.
19-04-2021

No hs err log was created for the crash. After debugging the core file, the crash is in: bool os::same_files(const char* file1, const char* file2) { if (strcmp(file1, file2) == 0) { return true; } The file2 being NULL. It was called from Arguments::init_shared_archive_paths() in the following block: if (DynamicDumpSharedSpaces) { if (os::same_files(SharedArchiveFile, ArchiveClassesAtExit)) { vm_exit_during_initialization( "Cannot have the same archive file specified for -XX:SharedArchiveFile and -XX:ArchiveClassesAtExit", SharedArchiveFile); } } Perhaps VM should issue an error and exit if both -XX:+RecordDynamicDumpInfo and -XX:SharedArchiveFile options are specified?
17-04-2021