RFR: 8321183: Incorrect warning from cds about the modules file

Maxim Kartashev mkartashev at openjdk.org
Fri Dec 1 15:57:22 UTC 2023


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. 

Notice that it is referred to as `jar file` and that `timestamp has changed` rather than size.

The suggested patch is pretty self-explanatory. With this patch, the warnings look like this:

./build/linux-x86_64-server-release/images/jdk/bin/java -jar ./build/linux-x86_64-server-release/images/jdk/demo/jfc/Notepad/Notepad.jar
[0.014s][warning][cds] This file is not the one used while building the shared archive file: /home/maxim/openjdk/jdk/build/linux-x86_64-server-release/images/jdk/lib/modules
[0.014s][warning][cds] This file is not the one used while building the shared archive file: /home/maxim/openjdk/jdk/build/linux-x86_64-server-release/images/jdk/lib/modules
[0.014s][warning][cds] /home/maxim/openjdk/jdk/build/linux-x86_64-server-release/images/jdk/lib/modules size has changed.

-------------

Commit messages:
 - 8321183: Incorrect warning from cds about the modules file

Changes: https://git.openjdk.org/jdk/pull/16926/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16926&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8321183
  Stats: 25 lines in 1 file changed: 9 ins; 8 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/16926.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16926/head:pull/16926

PR: https://git.openjdk.org/jdk/pull/16926


More information about the hotspot-runtime-dev mailing list