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

8330027: Identity hashes of archived objects must be based on a reproducible random seed #562

Closed
wants to merge 3 commits into from

Conversation

tstuefe
Copy link
Member

@tstuefe tstuefe commented May 10, 2024

This fixes an issue with CDS archive reproducibility that can happen under rare circumstances. See original JBS issue for details.

I had to manually resolve the hunk in src/hotspot/share/cds/heapShared.cpp because both

8251330: Reorder CDS archived heap to speed up relocation
8329431: Improve speed of writing CDS heap objects
were missing.

I also had to change CDSConfig::is_dumping_static_archive() - which only exists in JDK 22 and later - to the technically equal DumpSharedSpaces.


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
  • JDK-8330027 needs maintainer approval

Issue

  • JDK-8330027: Identity hashes of archived objects must be based on a reproducible random seed (Bug - P4 - Approved)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/562/head:pull/562
$ git checkout pull/562

Update a local copy of the PR:
$ git checkout pull/562
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/562/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 562

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/562.diff

Webrev

Link to Webrev Comment

…ducible random seed

Reviewed-by: ccheung, iklam
@bridgekeeper
Copy link

bridgekeeper bot commented May 10, 2024

👋 Welcome back stuefe! 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 May 10, 2024

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

8330027: Identity hashes of archived objects must be based on a reproducible random seed

Reviewed-by: mdoerr

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 113 new commits pushed to the master branch:

  • 8c00900: 8315969: compiler/rangechecks/TestRangeCheckHoistingScaledIV.java: make flagless
  • d7db5c5: 8320608: Many jtreg printing tests are missing the @printer keyword
  • 9a4da24: 8329103: assert(!thread->in_asgct()) failed during multi-mode profiling
  • 153accc: 8330849: Add test to verify memory usage with recursive locking
  • 99b50b3: 8332248: (fc) java/nio/channels/FileChannel/BlockDeviceSize.java failed with RuntimeException
  • 8c6ad58: 8317372: Refactor some NumberFormat tests to use JUnit
  • 98cfde4: 8222884: ConcurrentClassDescLookup.java times out intermittently
  • 2c3a40b: 8328647: TestGarbageCollectorMXBean.java fails with C1-only and -Xcomp
  • c0050ca: 8322062: com/sun/jdi/JdwpAllowTest.java does not performs negative testing with prefix length
  • 4be1a02: 8328697: SubMenuShowTest and SwallowKeyEvents tests stabilization
  • ... and 103 more: https://git.openjdk.org/jdk21u-dev/compare/8204bd74df7b215c88ffdc309d59f68112c7ff42...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.

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

@openjdk openjdk bot changed the title Backport 9f43ce5a725b212cec0f3cd17491c4bada953676 8330027: Identity hashes of archived objects must be based on a reproducible random seed May 10, 2024
@openjdk
Copy link

openjdk bot commented May 10, 2024

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added the backport label May 10, 2024
@tstuefe tstuefe marked this pull request as ready for review May 11, 2024 05:24
@openjdk openjdk bot added the rfr Pull request is ready for review label May 11, 2024
@mlbridge
Copy link

mlbridge bot commented May 11, 2024

Webrevs

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

LGTM. I suggest removing the empty line, too.

src/hotspot/share/cds/heapShared.cpp Outdated Show resolved Hide resolved
@openjdk
Copy link

openjdk bot commented May 13, 2024

⚠️ @tstuefe This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@tstuefe
Copy link
Member Author

tstuefe commented May 14, 2024

Thanks @TheRealMDoerr !

@tstuefe
Copy link
Member Author

tstuefe commented Jun 9, 2024

/approval I would like to fix this in JDK 21, since it is important for our reproducible-build effort.

Risk: A part of this patch is that we don't pro-actively create ihashes anymore during archival dump. I don't think that can cause any problem, nor does Ioi Lam who proposed that, but just to be aware - it may cause subtle changes in CDS dumps. The upstream patch has been in 23 for several weeks now, without any problems floating up.

@openjdk
Copy link

openjdk bot commented Jun 9, 2024

@tstuefe usage: /approval [<id>] (request|cancel) [<text>]

@TheRealMDoerr
Copy link
Contributor

@tstuefe: The approval command was wrong. Please take a look.

@tstuefe
Copy link
Member Author

tstuefe commented Jun 26, 2024

/approval request I would like to fix this in JDK 21, since it is important for our reproducible-build effort.

@openjdk
Copy link

openjdk bot commented Jun 26, 2024

@tstuefe
8330027: The approval request has been created successfully.

@openjdk openjdk bot added approval ready Pull request is ready to be integrated and removed approval labels Jun 26, 2024
@tstuefe
Copy link
Member Author

tstuefe commented Jun 27, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Jun 27, 2024

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 27, 2024

@tstuefe Pushed as commit 75287b5.

💡 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
backport integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

2 participants