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

8322957: Generational ZGC: Relocation selection must join the STS #17368

Closed

Conversation

stefank
Copy link
Member

@stefank stefank commented Jan 11, 2024

The concurrent ZGC threads don't automatically participate in the safepoint protocol, which means that they can run concurrently with safepoint VM Operations. Instead they use other means to hook into the safepoint protocol whenever they need to make changes that could be racing with the various VM Operations. The most common way is to join the "suspendible thread set". For details around this see SafepointSynchronize::begin and the call to Universe::heap()->safepoint_synchronize_begin().

It turns out that the relocation selection phase was updated to use a call oop_iterate, to modify oops of some of the objects. This was done without having the GC threads join the suspendible thread set. This means that various VM Operations could run concurrently with the oop_iterate. This caused the failure described in JDK-8322957: The JFR Leak Profiler modified the object header bits, while the GC's oop_iterate function used the same bits to determine if the oop iteration over an object should be skipped. This lead to objects not being modified as they were supposed to, which lead to broken oops and asserts.

The fix is quite small and could be limited to the lines added to src/hotspot/share/gc/z/zRelocationSet.cpp. However, to lower the risk of reintroducing a bug like this again, we've added extra verification code. Some of the infrastructure to get the correct verification is placed outside of the GC code, and that's why this PR is sent to the hotspot-dev list.

This has been tested with the reproducer of the original bug + tier1-7 on linux-x64-debug.


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-8322957: Generational ZGC: Relocation selection must join the STS (Bug - P2)

Reviewers

Contributors

  • Axel Boldt-Christmas <aboldtch@openjdk.org>

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 17368

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

Using diff file

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

Webrev

Link to Webrev Comment

@stefank
Copy link
Member Author

stefank commented Jan 11, 2024

/label add hotspot

@stefank
Copy link
Member Author

stefank commented Jan 11, 2024

/contributor add @xmas92

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 11, 2024

👋 Welcome back stefank! 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 rfr Pull request is ready for review hotspot hotspot-dev@openjdk.org labels Jan 11, 2024
@openjdk
Copy link

openjdk bot commented Jan 11, 2024

@stefank
The hotspot label was successfully added.

@openjdk
Copy link

openjdk bot commented Jan 11, 2024

@stefank
Contributor Axel Boldt-Christmas <aboldtch@openjdk.org> successfully added.

@mlbridge
Copy link

mlbridge bot commented Jan 11, 2024

Webrevs

Copy link
Contributor

@fisk fisk 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.

@openjdk
Copy link

openjdk bot commented Jan 11, 2024

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

8322957: Generational ZGC: Relocation selection must join the STS

Co-authored-by: Axel Boldt-Christmas <aboldtch@openjdk.org>
Reviewed-by: eosterlund, aboldtch

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

  • 9fd855e: 8322971: KEM.getInstance() should check if a 3rd-party security provider is signed
  • b8ae4a8: 8320890: [AIX] Find a better way to mimic dl handle equality
  • e5aed6b: 8323276: StressDirListings.java fails on AIX
  • b922f8d: 8319793: C2 compilation fails with "Bad graph detected in build_loop_late" after JDK-8279888
  • 35e9662: 8314515: java/util/concurrent/SynchronousQueue/Fairness.java failed with "Error: fair=false i=8 j=0"
  • cb1d25f: 8323330: [BACKOUT] JDK-8276809: java/awt/font/JNICheck/FreeTypeScalerJNICheck.java shows JNI warning on Windows
  • 2b7fc05: 8264102: JTable Keyboards Navigation differs with Test Instructions.
  • af942a6: 8323188: JFR: Needless RESOURCE_ARRAY when sending EventOSInformation
  • 26de9e2: 8321616: Retire binary test vectors in test/jdk/java/util/zip/ZipFile
  • b530c02: 8317804: com/sun/jdi/JdwpAllowTest.java fails on Alpine 3.17 / 3.18
  • ... and 67 more: https://git.openjdk.org/jdk/compare/71aac7a5fbb9a32181ada1a04b6a9622fe939c59...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 added the ready Pull request is ready to be integrated label Jan 11, 2024
Copy link
Member

@xmas92 xmas92 left a comment

Choose a reason for hiding this comment

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

lgtm.

@stefank
Copy link
Member Author

stefank commented Jan 12, 2024

Tier1-7 passes.

@stefank
Copy link
Member Author

stefank commented Jan 12, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Jan 12, 2024

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

  • 7c3a39f: 8323297: Fix incorrect placement of precompiled.hpp include lines
  • e72723d: 8323296: java/lang/Thread/virtual/stress/GetStackTraceALotWhenPinned.java#id1 timed out
  • 66520be: 8280056: gtest/LargePageGtests.java#use-large-pages failed "os.release_one_mapping_multi_commits_vm"
  • 82a63a0: 8258979: The image didn't show correctly with GTK LAF
  • 8d9814a: 8322757: Enable -Wparentheses warnings
  • 0ff2dea: 8320673: PageFormat/CustomPaper.java has no Pass/Fail buttons; multiple instructions
  • 8e12053: 8322799: Test JPKG003-013: ServiceTest fails because the user cannot uninstall the "servicetest" package on OEL 9.2 x64 and OEL 9.2 64-bit Arm (aarch64)
  • e4389d8: 8323571: Regression in source resolution process
  • 49e6121: 8310813: Simplify and modernize equals, hashCode, and compareTo for BigInteger
  • 4ea7b36: 8322235: Split up and improve LocaleProvidersRun
  • ... and 81 more: https://git.openjdk.org/jdk/compare/71aac7a5fbb9a32181ada1a04b6a9622fe939c59...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 12, 2024

@stefank Pushed as commit ba23025.

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