JDK-8321183 : Incorrect warning from cds about the modules file
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-12-01
  • Updated: 2023-12-11
  • Resolved: 2023-12-05
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 22
22 b27Fixed
Related Reports
Relates :  
Description
When the modules file used at run time differs in size from the one used at build time, the warning is confusing:

$ .../bin/java -jar .../demo/jfc/Notepad/Notepad.jar
[0.033s][warning][cds] A jar file is not the one used while building the shared archive file: /.../lib/modules
[0.033s][warning][cds] A jar file is not the one used while building the shared archive file: /.../lib/modules
[0.033s][warning][cds] /.../lib/modules timestamp has changed.

First, it refers to the file as a "jar file", which it is not. Also, it complaints about the timestamp, while actually the reason for the warning is the difference in size.

To reproduce:
1. build a JDK image with --enable-cds
2. build or download a different version of a JDK image
3. replace the .../lib/modules file in the first with the corresponding file from the second, making sure they differ in size
4. run any Java app using java from the first image
5. observe the warning

Comments
Changeset: fd31f6a1 Author: Maxim Kartashev <mkartashev@openjdk.org> Committer: Calvin Cheung <ccheung@openjdk.org> Date: 2023-12-05 17:17:14 +0000 URL: https://git.openjdk.org/jdk/commit/fd31f6a1663de0e06accdf015a71086346aa0d98
05-12-2023

> What does "dev" mean? I took it for the state of the master branch of github.com/openjdk > Can we remove it? Sure!
05-12-2023

[~mkartashev] You added "dev" in the "Affects Version/s" field. What does "dev" mean? Can we remove it?
04-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16926 Date: 2023-12-01 15:52:11 +0000
01-12-2023