-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8309171: Test vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java fails after JDK-8308341 #14239
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
…05t001/TestDescription.java fails after JDK-8308341
👋 Welcome back dholmes! A progress list of the required criteria for merging this PR into |
@dholmes-ora 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
|
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.
Thumbs up. The fix appears to do exactly what you described in the bug report.
Hopefully your in process testing goes well.
@dholmes-ora 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 no new commits pushed to the ➡️ To integrate this PR with the above commit message to the |
Please note that the associated test is now in the problem list, see #14250 |
vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java The previous entry looked like this:
|
I skimmed through the JVMTI spec and I don't see anything to set expectations that a thread can potentially JNI attach before the "live phase". However, once the VM is in the live phase and the VMInit callback is invoked then it's game on. This makes me wonder if VM_Creation_State needs an additional state between IN_PROGRESS and CREATED to indicate that the VM is initialized so IN_PROGRESS -> "new-state" in Threads::create_vm and before JvmtiExport::post_vm_initialized, and "nw-state" -> CREATED when Threads::create_vm completes. That would prevent JNI attach before entering the live phase. |
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.
Looks to me like the places you touched here are equivalent to the way it used to be originally.
If we could lock the VM init section, then any thread trying to do anything that depended on VM to be initialized, would just sit waiting till the VM is ready... |
Thanks for the reviews @dcubed-ojdk and @gerard-ziemski ! I have address the indentation issue and removed the recently added ProblemList entry. @AlanBateman perhaps we should look further at the "live phase" but I don't think this is inherently tied to JVMTI. In theory the core libs could create a native thread that wants to attach during VM init. Either way I'm reluctant to introduce any change in behaviour other than that which was needed to fix the GetCreatedJavaVMs related crash. But I can file a RFE to look at this. /integrate |
Going to push as commit 0119969. |
@dholmes-ora Pushed as commit 0119969. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The fix for JDK-8308341 overlooked the fact that during VM initialization agents can run and create native threads that will attach to (and potentially detach from) the VM. The check that VM init was complete before allowing those operations was too strong and has to be reverted. All the guards, except for that of GetCreatedJavaVMs itself, is reverted to the way it was before JDK-8308341.
Testing: tiers 1-4 (in progress)
Thanks.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14239/head:pull/14239
$ git checkout pull/14239
Update a local copy of the PR:
$ git checkout pull/14239
$ git pull https://git.openjdk.org/jdk.git pull/14239/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14239
View PR using the GUI difftool:
$ git pr show -t 14239
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14239.diff
Webrev
Link to Webrev Comment