Skip to content

8321183: Incorrect warning from cds about the modules file #16926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

mkartashev
Copy link
Member

@mkartashev mkartashev commented Dec 1, 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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8321183: Incorrect warning from cds about the modules file (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/16926/head:pull/16926
$ git checkout pull/16926

Update a local copy of the PR:
$ git checkout pull/16926
$ git pull https://git.openjdk.org/jdk.git pull/16926/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16926

View PR using the GUI difftool:
$ git pr show -t 16926

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/16926.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 1, 2023

👋 Welcome back mkartashev! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 1, 2023
@openjdk
Copy link

openjdk bot commented Dec 1, 2023

@mkartashev The following label will be automatically applied to this pull request:

  • hotspot-runtime

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-runtime hotspot-runtime-dev@openjdk.org label Dec 1, 2023
@mlbridge
Copy link

mlbridge bot commented Dec 1, 2023

Webrevs

Copy link
Member

@calvinccheung calvinccheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the bug correct, is the original code at line 413 missing a condition?
if (_timestamp != st.st_mtime) {
should be
if (has_timestamp() && (_timestamp != st.st_mtime)) {

From your reproducing steps in the bug report:
"3. replace the .../lib/modules file in the first with the corresponding file from the second, making sure they differ in size"
After replacing the file, would the new file have a different timestamp?

Since you've changed the log statement from "A jar file..." to "This file...", the following tests under the appcds directory need to be adjusted:
WrongClasspath.java
dynamicArchive/MainModuleOnly.java
dynamicArchive/WrongTopClasspath.java
jigsaw/modulepath/MainModuleOnly.java

One suggestion below.

Comment on lines 413 to 416
if (time_differs) {
log_warning(cds)("%s timestamp has changed.", name);
} else {
log_warning(cds)("%s size has changed.", name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of else, maybe you can do the following because a file could differ both in timestamp and size.
if (time_differs) {
log_warning(cds)("%s timestamp has changed.", name);
}
if (size_differs) {
log_warning(cds)("%s size has changed.", name);
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very true, thanks!

@mkartashev
Copy link
Member Author

@calvinccheung

I made the changes you suggested and ran test/hotspot/jtreg/runtime/cds. Please, have a look at the updated fix.

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/hotspot/jtreg/runtime/cds                292   292     0     0   
==============================
TEST SUCCESS

Finished building target 'run-test-only' in configuration 'linux-x86_64-server-release'

Copy link
Member

@calvinccheung calvinccheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates look good. Thanks.

@openjdk
Copy link

openjdk bot commented Dec 4, 2023

@mkartashev This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8321183: Incorrect warning from cds about the modules file

Reviewed-by: ccheung, iklam

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 35 new commits pushed to the master branch:

  • aec3865: 8320697: RISC-V: Small refactoring for runtime calls
  • 50d1839: 8318809: java/util/concurrent/ConcurrentLinkedQueue/WhiteBox.java shows intermittent failures on linux ppc64le and aarch64
  • 81484d8: 8320687: sun.jvmstat.monitor.MonitoredHost.getMonitoredHost() throws unexpected exceptions when invoked concurrently
  • 30b5d42: 8321069: JvmtiThreadState::state_for_while_locked() returns nullptr for an attached JNI thread with a java.lang.Thread object after JDK-8319935
  • bd04f91: 8321131: Console read line with zero out should zero out underlying buffer in JLine
  • 155abc5: 8311906: Improve robustness of String constructors with mutable array inputs
  • 316b783: 8321276: runtime/cds/appcds/dynamicArchive/DynamicSharedSymbols.java failed with "'17 2: jdk/test/lib/apps ' missing from stdout/stderr"
  • 65be5e0: 8305931: jdk/jfr/jcmd/TestJcmdDumpPathToGCRoots.java failed with "Expected chains but found none"
  • f6be922: 8316193: jdk/jfr/event/oldobject/TestListenerLeak.java java.lang.Exception: Could not find leak
  • a9de5c7: 8315128: jdk/jfr/event/runtime/TestResidentSetSizeEvent.java fails with "The size should be less than or equal to peak"
  • ... and 25 more: https://git.openjdk.org/jdk/compare/3087e14cde9257680f0406b11942f9cb7739cb7b...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@calvinccheung, @iklam) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 4, 2023
Copy link
Member

@iklam iklam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for fixing this.

@mkartashev
Copy link
Member Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Dec 5, 2023
@openjdk
Copy link

openjdk bot commented Dec 5, 2023

@mkartashev
Your change (at version 135f12f) is now ready to be sponsored by a Committer.

@calvinccheung
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Dec 5, 2023

Going to push as commit fd31f6a.
Since your change was applied there have been 47 commits pushed to the master branch:

  • 027b5db: 8321215: Incorrect x86 instruction encoding for VSIB addressing mode
  • 61d0db3: 8318468: compiler/tiered/LevelTransitionTest.java fails with -XX:CompileThreshold=100 -XX:TieredStopAtLevel=1
  • 87516e2: 8320943: Files/probeContentType/Basic.java fails on latest Windows 11 - content type mismatch
  • 800f347: 8321216: SerialGC attempts to access the card table beyond the end of the heap during card table scan
  • a1fe16b: 8321300: Cleanup TestHFA
  • 5b02188: 8321105: Enable UseCryptoPmullForCRC32 for Neoverse V2
  • 4fbf22b: 8320652: ThreadInfo.isInNative needs to be updated to say what executing native code means
  • 672f373: 8321163: [test] OutputAnalyzer.getExitValue() unnecessarily logs even when process has already completed
  • 30817b7: 8317809: Insertion of free code blobs into code cache can be very slow during class unloading
  • a56286f: 8321269: Require platforms to define DEFAULT_CACHE_LINE_SIZE
  • ... and 37 more: https://git.openjdk.org/jdk/compare/3087e14cde9257680f0406b11942f9cb7739cb7b...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 5, 2023
@openjdk openjdk bot closed this Dec 5, 2023
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Dec 5, 2023
@openjdk
Copy link

openjdk bot commented Dec 5, 2023

@calvinccheung @mkartashev Pushed as commit fd31f6a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants