-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
8315127: CDSMapTest fails with incorrect number of oop references #15527
8315127: CDSMapTest fails with incorrect number of oop references #15527
Conversation
👋 Welcome back iklam! A progress list of the required criteria for merging this PR into |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have one question and spotted two minor issues.
@@ -282,16 +309,29 @@ public static int validate(MapFile mapFile) { | |||
// To see how an invalidate pointer may be found, change oop in the | |||
// following line to oop+1 | |||
mustContain(mapFile.oopToObject, field, oop, false); | |||
count ++; | |||
count1 ++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could oop
be 0? If so, oop
could be overcounted.
Pre-existing: extra import at line 27
import java.io.RandomAccessFile;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added checks for oop != 0
, so now the test is counting only the non-null references.
throw new RuntimeException("CDS map file seems incorrect: " + mapFile.heapObjectCount() + | ||
" objects but only " + oopFieldCount + " oop field references"); | ||
} | ||
CDSMapReader.validate(mapFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-existing: extra import at lines 36 and 37
import java.io.FileInputStream;
import java.io.IOException;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -254,7 +279,8 @@ public static MapFile read(String fileName) { | |||
throw new RuntimeException(t); | |||
} finally { | |||
System.out.println("Parsed " + lineCount + " lines in " + fileName); | |||
System.out.println("Found " + mapFile.heapObjectCount() + " heap objects"); | |||
System.out.println("Found " + mapFile.heapObjectCount() + " heap objects (" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.out.println("Found " + mapFile.heapObjectCount() + " heap objects (" | |
System.out.println("Found " + mapFile.heapObjectCount() + " heap objects (" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. It looks good.
@iklam 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:
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 22 new commits pushed to the
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. ➡️ To integrate this PR with the above commit message to the |
Thanks @calvinccheung and @turbanoff for the review and comments. |
Going to push as commit 1f4cdb3.
Your commit was automatically rebased without conflicts. |
This is a bug in the test case. The test parses patterns like this in the map file
Before this fix, the test assets that there are at least 10000 oop references (such as the
value
field in the above String). However, some JDK builds may have fewer archived heap objects, resulting in less than 10000 references (the graal build in the bug report has only 8286 references).After this fix, we check that the number of oop references is not fewer than the number of strings, as we know each string contains one oop field. This is sufficient to check that the map file contains expected output, without using a hard-coded number.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15527/head:pull/15527
$ git checkout pull/15527
Update a local copy of the PR:
$ git checkout pull/15527
$ git pull https://git.openjdk.org/jdk.git pull/15527/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15527
View PR using the GUI difftool:
$ git pr show -t 15527
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15527.diff
Webrev
Link to Webrev Comment