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

8308609: java/lang/ScopedValue/StressStackOverflow.java fails with "-XX:-VMContinuations" #14399

Closed
wants to merge 10 commits into from

Conversation

theRealAph
Copy link
Contributor

@theRealAph theRealAph commented Jun 9, 2023

Move runWith() from VirtualThread to BaseVirtualThread.

BoundVirtualThread does not use runWith() to run its task, so when a VM error occurs it can not recover scoped values.

Moving runWith() into the common subclass of both VirtualThread and BoundVirtualThread fixes the problem.


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-8308609: java/lang/ScopedValue/StressStackOverflow.java fails with "-XX:-VMContinuations" (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14399

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 9, 2023

👋 Welcome back aph! 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 Jun 9, 2023
@openjdk
Copy link

openjdk bot commented Jun 9, 2023

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

  • core-libs
  • hotspot

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 hotspot-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Jun 9, 2023
@mlbridge
Copy link

mlbridge bot commented Jun 9, 2023

@offamitkumar
Copy link
Member

Hi Andrew,

This test failure is no more reproducible on s390x now, would you consider undo-ing problemlisting done by JDK-8303499, I'll close the parent task JDK-8303498

@AlanBateman
Copy link
Contributor

One suggestion for the test is to have it re-run with -XX:-VMContinuations on platforms/ports that do do have VM continuations support. Some of the tests for virtual threads do the same thing to ensure this operating mode is tested. This should do it:

--- a/test/jdk/java/lang/ScopedValue/StressStackOverflow.java
+++ b/test/jdk/java/lang/ScopedValue/StressStackOverflow.java
@@ -21,8 +21,8 @@
  * questions.
  */
 
-/**
- * @test
+/*
+ * @test id=default
  * @summary StressStackOverflow the recovery path for ScopedValue
  * @enablePreview
  * @run main/othervm/timeout=300 -XX:-TieredCompilation StressStackOverflow
@@ -30,6 +30,13 @@
  * @run main/othervm/timeout=300 StressStackOverflow
  */
 
+/*
+ * @test id=no-vmcontinuations
+ * @requires vm.continuations
+ * @enablePreview
+ * @run main/othervm/timeout=300 -XX:+UnlockExperimentalVMOptions -XX:-VMContinuations StressStackOverflow
+ */
+

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

The implementation changes look good.

The update to test looks okay too although I would like to see if we can do better in SVC and STS when there is a SO. In passing, I think all usages of tlr should be replaced with ThreadLocalRandom.current().

@openjdk
Copy link

openjdk bot commented Jun 13, 2023

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

8308609: java/lang/ScopedValue/StressStackOverflow.java fails with "-XX:-VMContinuations"

Reviewed-by: alanb

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

  • 3e0bbd2: 8285368: Overhaul doc-comment inheritance
  • 3eeb681: 8167252: Some of Charset.availableCharsets() does not contain itself
  • 653a8d0: 8310129: SetupNativeCompilation LIBS should match the order of the other parameters
  • 947f149: 8308444: LoadStoreNode::result_not_used() is too conservative
  • 8b4af46: 8309974: some JVMCI tests fail when VM options include -XX:+EnableJVMCI
  • 0038491: 8309978: [x64] Fix useless padding
  • 5f3613e: 8309960: ParallelGC young collections very slow in DelayInducer
  • 83d9267: 8303513: C2: LoadKlassNode::make fails with 'expecting TypeKlassPtr'
  • de8aca2: 8307907: [ppc] Remove RTM locking implementation
  • 4c0e164: 8309717: C2: Remove Arena::move_contents usage
  • ... and 75 more: https://git.openjdk.org/jdk/compare/c052756154603a9d3a13200fa407a2dc124437f3...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 Jun 13, 2023
@theRealAph
Copy link
Contributor Author

theRealAph commented Jun 14, 2023

The implementation changes look good.

The update to test looks okay too although I would like to see if we can do better in SVC and STS when there is a SO.

That would be nice, but it's something of a can of worms.

In passing, I think all usages of tlr should be replaced with ThreadLocalRandom.current().

OK.

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

I'd probably go further and drop the TLR parameter from the choose method too but what you have is fine, let's go with that.

@theRealAph
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Jun 16, 2023

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

  • b412fc7: 8309937: Add @sealedGraph for some Panama FFM interfaces
  • fb024fd: 8248149: G1: change _cleaning_claimed from int to bool
  • c2b043e: 8310183: Update GitHub Actions to use boot JDK for building jtreg
  • 238c51e: 8293069: Make -XX:+Verbose less verbose
  • 8c9b85a: 8303916: ThreadLists.java inconsistent results
  • 227656f: 8309408: Thread.sleep cleanup
  • 32243ef: 8310128: Switch with unnamed patterns erroneously non-exhaustive
  • cfae6ef: 8309778: java/nio/file/Files/CopyAndMove.java fails when using second test directory
  • db133db: 8310106: sun.security.ssl.SSLHandshake.getHandshakeProducer() incorrectly checks handshakeConsumers
  • 353e581: 8309747: Update --release 21 symbol information for JDK 21 build 27
  • ... and 92 more: https://git.openjdk.org/jdk/compare/c052756154603a9d3a13200fa407a2dc124437f3...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 16, 2023

@theRealAph Pushed as commit 44a8aa0.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@AlanBateman
Copy link
Contributor

AlanBateman commented Jun 16, 2023

I didn't spot this before it was integrated but test/hotspot/jtreg/serviceability/jvmti/thread/GetStackTrace/getstacktr03/libgetstacktr03.cpp is sensitive to the stack trace so its list of expected frames needs to be updated to take account of runWith no longer overridden in the sub-class.

I've created JDK-8310211.

@dcubed-ojdk
Copy link
Member

@theRealAph -
So the GHA results for this PR show that serviceability/jvmti/thread/GetStackTrace/getstacktr03/getstacktr03
failed. Why wasn't this addressed prior to integration? We saw 5 instances of this failure mode in
every Mach5 Tier1 and 20 instances in every Mach5 Tier3 after this PR was integrated. This was not
an intermittent failure.

I've applied the fix that @AlanBateman proposed in JDK-8310211
and that appears to have solved the issue for Mach5 Tier1. I'll have to wait for the
fix to reach Mach5 Tier3 before I can declare that one is also good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants