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

8293864: Kitchensink24HStress.java fails with SIGSEGV in JfrCheckpointManager::lease #10467

Closed
wants to merge 2 commits into from

Conversation

mgronlun
Copy link

@mgronlun mgronlun commented Sep 28, 2022

Greetings,

With JDK-8289692, a need arose to introduce a mutex mechanism for the buffers on the global list to prevent the JFR Recorder Thread from resetting buffers currently in use.

The introduced mutex mechanism was adequate as far as preventing the race condition. However, its protective characteristic was overemphasized, leading to the mistake of introducing a release, or removal, operation onto a current epoch list, as part of periodic flushing. The problem is that although the callback operations are safe, the underlying list type used with the global mspace does not allow for concurrent excision of nodes. The crash occurs because a thread attempts to dereference the next pointer to traverse a node that is excised and deleted after the thread loaded it.

I have reviewed how to handle better the introduction of virtual threads and their checkpoint data. I have concluded that the best way is to preserve the old system (pre-Loom) as much as possible, keeping the global and thread-local mspaces as before. Instead, an additional mspace dedicated solely to virtual threads is introduced. This categorization preserves the matching of operations against the underlying list infrastructure. It also provides flexibility in handling virtual threads distinct from regular, or "carrier", threads. The separate mspace of virtual threads is more dynamic as it does not need to preallocate buffers, a memory win for systems not using virtual threads. Also, the sizes of the different buffer types can be better controlled. With this restructuring, there are no longer any list concurrency issues; hence the mutex mechanism introduced with JDK-8289692 becomes obsolete. Applying a release operation for the current epoch list, of the global mspace, as part of flushing is a broken invariant and is therefore removed.

Testing: jdk_jfr, stress testing

Thanks
Markus


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-8293864: Kitchensink24HStress.java fails with SIGSEGV in JfrCheckpointManager::lease

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10467

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 28, 2022

👋 Welcome back mgronlun! 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 Sep 28, 2022
@openjdk
Copy link

openjdk bot commented Sep 28, 2022

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

  • hotspot-jfr

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-jfr hotspot-jfr-dev@openjdk.org label Sep 28, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 28, 2022

Webrevs

@openjdk
Copy link

openjdk bot commented Oct 6, 2022

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

8293864: Kitchensink24HStress.java fails with SIGSEGV in JfrCheckpointManager::lease

Reviewed-by: egahlin

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

  • 85569e9: 8286037: Bump minimum boot jdk to JDK 19
  • fef345b: 8293672: Update freetype md file
  • 5c030cc: 8290973: In AffineTransform, equals(Object) is inconsistent with hashCode()
  • f888aa9: 8293061: Combine CDSOptions and AppCDSOptions test utility classes
  • 73f0646: 8294839: Disable StressLongCountedLoop in compiler/loopopts/TestRemoveEmptyLoop.java
  • 2ceebf6: 8294456: Fix misleading-indentation warnings in core JDK libraries
  • ad7b7d4: 8294697: java/lang/Thread/virtual/ThreadAPI.testGetStackTrace2 failed with non-empty stack trace
  • e38ae8a: 8294759: Print actual lock/monitor ranking
  • 7012d4b: 8294837: unify Windows 2019 version check in os_windows and java_props_md
  • 8c15f77: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion
  • ... and 208 more: https://git.openjdk.org/jdk/compare/bb422f5c14745bf29bc2cb741f819a17c8400543...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 Oct 6, 2022
@mgronlun
Copy link
Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 10, 2022

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

  • c5f462e: 8294956: GHA: qemu-debootstrap is deprecated, use the regular one
  • 269252a: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel
  • 6ed74ef: 8295005: compiler/loopopts/TestRemoveEmptyLoop.java fails with release VMs after JDK-8294839
  • 8a148bc: 8294848: Unnecessary SSLCipher dispose implementations
  • 8713dfa: 8294541: java/io/BufferedInputStream/TransferTo.java fails with OOME
  • 542cc60: 8294366: RISC-V: Partially mark out incompressible regions
  • 495c043: 7124710: interleaved RedefineClasses() and RetransformClasses() calls may have a problem
  • d39d8c8: 8170389: java.text.DigitList.getDouble() : Controversy between javadoc and code
  • 3466e99: 8294691: dynamicArchive/RelativePath.java is running other test case
  • 823b53d: 8294987: Streamline DerOutputStream write
  • ... and 235 more: https://git.openjdk.org/jdk/compare/bb422f5c14745bf29bc2cb741f819a17c8400543...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Oct 10, 2022

@mgronlun Pushed as commit 35d17a0.

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