Skip to content
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

8282828: CDS uncompressed oops archive is not deterministic #8478

Conversation

iklam
Copy link
Member

@iklam iklam commented Apr 29, 2022

During java -Xshare:dump -XX:-UseCompressedOops, the location of the Java heap is chosen by the OS. Due to Address Space Layout Randomization, the heap will always start at a different location. This causes the archive for uncompressed oops ($JAVA_HOME/lib/server/classes_nocoops.jsa) to be non-deterministic.

The fix is to patch the archived object pointers to make it look like the heap starts at a fixed address -- I chose 0x10000000, but the exact value doesn't really matter.

At runtime, the object pointers will be patched again according to the real location of the heap.

Tested with tiers 1-5. I am running builds-tier5 several times to test the xxx-cmp-baseline builds.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (3 reviews required, with at least 1 reviewer, 2 authors)

Issue

  • JDK-8282828: CDS uncompressed oops archive is not deterministic

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8478/head:pull/8478
$ git checkout pull/8478

Update a local copy of the PR:
$ git checkout pull/8478
$ git pull https://git.openjdk.java.net/jdk pull/8478/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8478

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8478.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 29, 2022

👋 Welcome back iklam! 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
Copy link

openjdk bot commented Apr 29, 2022

@iklam The following labels will be automatically applied to this pull request:

  • build
  • hotspot-runtime

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

@openjdk openjdk bot added hotspot-runtime hotspot-runtime-dev@openjdk.org build build-dev@openjdk.org labels Apr 29, 2022
@iklam iklam marked this pull request as ready for review April 29, 2022 22:54
return hash;
// Do not call p->identity_hash() as that will update the
// object header.
return primitive_hash(cast_from_oop<intptr_t>(p));
Copy link
Member Author

Choose a reason for hiding this comment

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

This fix doesn't affect the contents of the archive, but it's necessary to avoid incorrect output from -Xlog:cds+map=trace.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 29, 2022
@mlbridge
Copy link

mlbridge bot commented Apr 29, 2022

Webrevs

Copy link
Member

@erikj79 erikj79 left a comment

Choose a reason for hiding this comment

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

Change to compare.sh looks good. Thanks for fixing this!

@erikj79
Copy link
Member

erikj79 commented May 2, 2022

/reviewers 2

@openjdk
Copy link

openjdk bot commented May 2, 2022

@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:

8282828: CDS uncompressed oops archive is not deterministic

Reviewed-by: erikj, ihse, ccheung

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 no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 2, 2022
@openjdk
Copy link

openjdk bot commented May 2, 2022

@erikj79
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with 1 of role reviewers, 1 of role authors).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 2, 2022
@magicus
Copy link
Member

magicus commented May 2, 2022

Looks good to me. But you need hotspot reviewers as well.

And thanks for fixing this! I think this is the last major known non-reproducibility bug in the JDK! 🎉

/reviewers 3

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 2, 2022
@openjdk
Copy link

openjdk bot commented May 2, 2022

@magicus
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 3 (with 1 of role reviewers, 2 of role authors).

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label May 2, 2022
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.

LGTM

@openjdk openjdk bot added the ready Pull request is ready to be integrated label May 2, 2022
…uncompressed-oop-cds-archive-not-determinisic
@iklam
Copy link
Member Author

iklam commented May 3, 2022

Thanks @erikj79 @magicus @calvinccheung for the review.
/integrate

@openjdk
Copy link

openjdk bot commented May 3, 2022

Going to push as commit 64b5b2b.
Since your change was applied there has been 1 commit pushed to the master branch:

  • 45ca81f: 8285915: failure_handler: gather the contents of /etc/hosts file

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label May 3, 2022
@openjdk openjdk bot closed this May 3, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels May 3, 2022
@openjdk
Copy link

openjdk bot commented May 3, 2022

@iklam Pushed as commit 64b5b2b.

💡 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
build build-dev@openjdk.org hotspot-runtime hotspot-runtime-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

5 participants