-
Notifications
You must be signed in to change notification settings - Fork 5.8k
8338714: vmTestbase/nsk/jdb/kill/kill001/kill001.java fails with JTREG_TEST_THREAD_FACTORY=Virtual #22620
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
Conversation
👋 Welcome back cjplummer! A progress list of the required criteria for merging this PR into |
@plummercj 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:
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 142 new commits pushed to the
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 |
@plummercj The following label will be automatically applied to this pull request:
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. |
Webrevs
|
} | ||
} | ||
|
||
public void run1() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a bit clear to rename run1 to runPinned or something better to avoid run + run1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also needs to support test runs with platforms threads. See how run()
checks if it is running in virtual thread mode or not. Either way it calls run()
, but in the virtual thread case it does so using VThreadPinner.
@@ -137,6 +137,9 @@ private String[] makeJdbCmdLine (String classToExecute) { | |||
/* Some tests need more carrier threads than the default provided. */ | |||
args.add("-R-Djdk.virtualThreadScheduler.parallelism=15"); | |||
} | |||
/* Some jdb tests need java.library.path setup for native libraries. */ | |||
String libpath = System.getProperty("java.library.path"); | |||
args.add("-R-Djava.library.path=" + libpath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, I wasn't sure how this would inherit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an unrelated change. ???
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jdk.test.lib.thread.VThreadPinner has a native library that must be loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix looks good modulo potential renaming of the run1()
method.
I think you and @AlanBateman didn't quite understand what I meant by:
The |
In fact, I understand it. I was thinking if renaming to something like |
It is wordy. Maybe runShared or runCommon, although I don't think either adds much value. |
Or it can be just something like |
Looking for one more review. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hitting approve, but the launcher change seems unrelated to the issue at hand.
@@ -137,6 +137,9 @@ private String[] makeJdbCmdLine (String classToExecute) { | |||
/* Some tests need more carrier threads than the default provided. */ | |||
args.add("-R-Djdk.virtualThreadScheduler.parallelism=15"); | |||
} | |||
/* Some jdb tests need java.library.path setup for native libraries. */ | |||
String libpath = System.getProperty("java.library.path"); | |||
args.add("-R-Djava.library.path=" + libpath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an unrelated change. ???
Thanks David and Serguei! /integrate |
Going to push as commit 414eb6b.
Your commit was automatically rebased without conflicts. |
@plummercj Pushed as commit 414eb6b. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This test fails after JDK-8338713 when using JTREG_TEST_THREAD_FACTORY=Virtual. The test uses JVMTI StopThread on a thread expecting it to be mounted. Before JDK-8338713 it would be mounted because it was blocked on a syncrhonized, which resulted in the thread being pinned. After JDK-8338713 this is no longer the case and the virtual thread has unmounted. This causes JVMTI StopThread to fail with JVMTI_ERROR_OPAQUE_FRAME because it only supports mounted virtual threads.
Fixed by using the VThreadPinner class to make sure the virtual threads remains pinned, and therefore mounted.
Testing:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22620/head:pull/22620
$ git checkout pull/22620
Update a local copy of the PR:
$ git checkout pull/22620
$ git pull https://git.openjdk.org/jdk.git pull/22620/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22620
View PR using the GUI difftool:
$ git pr show -t 22620
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22620.diff
Using Webrev
Link to Webrev Comment