8304438: jcmd JVMTI.agent_load should obey EnableDynamicAgentLoading#14244
8304438: jcmd JVMTI.agent_load should obey EnableDynamicAgentLoading#14244sspitsyn wants to merge 11 commits intoopenjdk:masterfrom
Conversation
|
👋 Welcome back sspitsyn! A progress list of the required criteria for merging this PR into |
|
@sspitsyn The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
|
/label remove core-libs |
|
@AlanBateman |
|
For the "load" command implemented in attachListener, do you remember why EnableDynamicAgentLoading is checked in attach_listener_thread_entry? Looking at it now, I wonder why the check isn't in load_agent. The code in attach_listener_thread_entry shouldn't have to special-case commands. |
|
Thank you for the comment. |
Yes, maybe JvmtiAgentList::load_agent, JvmtiAgent::load, or invoke_Agent_OnAttach. As part of the change to emit a warning when agent code is loaded into a running VM, invoke_Agent_OnAttach needs to check if EnableDynamicAgentLoading has been set on the command line, so looking at this VM option in one place would be nice. |
I've moved the EnableDynamicAgentLoading check to the invoke_Agent_OnAttach. |
|
A change in behaviour like this requires a CSR request - the code has been doing the wrong thing for a long time now! /csr needed |
|
@dholmes-ora has indicated that a compatibility and specification (CSR) request is needed for this pull request. @sspitsyn please create a CSR request for issue JDK-8304438 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
Thank you for the comment. It was not fully clear if a CSR is needed in this case. |
plummercj
left a comment
There was a problem hiding this comment.
Except for the possible addition of some comments regarding what is meant by "loaded", the changes look good.
plummercj
left a comment
There was a problem hiding this comment.
Sorry, previous comment was for another review.
|
@sspitsyn 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 |
AlanBateman
left a comment
There was a problem hiding this comment.
Implementation change looks fine. Once your branch is sync up to main line then it should mean EnableDynamicAgentLoading is only used in one function, so easy to understand.
|
/integrate |
|
Alan, Chris and Alex, thank you for review! |
The VM option EnableDynamicAgentLoading was added in JDK 9, default true, to allow deployment to choose whether to allow agents to be loaded/started in the VM. The VM option does the right thing for tools using the Attach API but jcmd JVMTI.agent_load was missed. This should be fixed to disallow loading JVMTI agents when the EnableDynamicAgentLoading is false.
The CSR is:
JDK-8309250: jcmd JVMTI.agent_load should obey EnableDynamicAgentLoading
Testing:
test/jdk/sun/tools/jcmd/TestJcmdNoAgentLoad.javaProgress
Issues
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/14244/head:pull/14244$ git checkout pull/14244Update a local copy of the PR:
$ git checkout pull/14244$ git pull https://git.openjdk.org/jdk.git pull/14244/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 14244View PR using the GUI difftool:
$ git pr show -t 14244Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/14244.diff
Webrev
Link to Webrev Comment