8252657: JVMTI agent is not unloaded when Agent_OnAttach is failed#19
8252657: JVMTI agent is not unloaded when Agent_OnAttach is failed#19YaSuenag wants to merge 6 commits intoopenjdk:masterfrom
Conversation
|
/test |
|
👋 Welcome back ysuenaga! A progress list of the required criteria for merging this PR into |
|
@YaSuenag The following labels will be automatically applied to this pull request: |
|
/test approve |
|
/issue add JDK-8252657 |
|
/test |
|
@YaSuenag The primary solved issue for a PR is set through the PR title. Since the current title does not contain an issue reference, it will now be updated. |
|
Could not create test job |
|
/test |
|
Could not create test job |
|
/test |
|
@edvbld Can you approve me to run tier1 tests with /test PR command again? |
|
/test |
|
I was initially wrong by supporting this, and now I share David's concerns about unclear semantics of this. The questions are:
Yes, at least, a CSR is needed for this. |
JVMTI spec of Agent_OnUnload() says this function will be called when the agent library will be unloaded by platform specific mechanism. OTOH it also says
For example, we can add multiple Agent developers should have responsibility for the behavior when more than one agent is loaded at a time.
JVMTI spec says "unless it is statically linked into the executable", so I think we can ignore about Agent_OnUnload_L() in this PR.
Agent (
I will file CSR for this PR after this discussion. |
|
If we can change the spec that agent library would not be unloaded when |
Simplify timed join to use awaiNanos.
|
In case of I will add CSR for this fix, but I want to discuss what we should do before. I like that |
|
Mailing list message from David Holmes on serviceability-dev: On 16/12/2020 5:36 pm, Yasumasa Suenaga wrote:
I think it is clear this refers to the VM doing the unloading not David
|
|
@dholmes-ora Thank you for explanation! I updated CSR. Could you review it? |
|
CSR has been approved. I updated jvmti.xml to follow it (I haven't make any changes in other files in latest commit) |
dholmes-ora
left a comment
There was a problem hiding this comment.
Hi Yasumasa,
Spec update looks good.
VM tweak to call dll_unload on failure looks good.
I don't understand the test change though.
Thanks,
David
|
@YaSuenag 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 18 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 |
Thanks!
To check the agent is unloaded, call VM.dynlibs dcmd and check whether agent path is not contained. |
|
Mailing list message from David Holmes on serviceability-dev: On 14/01/2021 6:29 pm, Yasumasa Suenaga wrote:
Got it! Thanks. David |
sspitsyn
left a comment
There was a problem hiding this comment.
Hi Yasumasa,
Both the CSR and the fix look good.
Thank you for your patience with the process.
Thanks,
Serguei
|
/integrate |
|
@YaSuenag Since your change was applied there have been 21 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 90960c5. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
c = log(n) * log(log(n)) * 3 / 2, where n is available processor. it's only reasonable to use CICompilerCount=1 in debug. Co-authored-by: Xin Liu <xxinliu@amazon.com>
c = log(n) * log(log(n)) * 3 / 2, where n is available processor. it's only reasonable to use CICompilerCount=1 in debug. Co-authored-by: Xin Liu <xxinliu@amazon.com>
* Even more review comments
* Re-write of atomic copy loops
* Change name of UnsafeCopyMemory{,Mark} to UnsafeMemory{Access,Mark}
…enjdk#19) * Erase pattern signature for records * Erase pattern signature for deconstructors
Replaced manual region iteration with proper API closure pattern in reset_free_region_timestamps() and shrink_by_time_based_selection(). This is more maintainable and follows G1 API conventions. Issues: Thomas review openjdk#12-13, openjdk#15-16, openjdk#19, openjdk#21, openjdk#27-31
Replaced manual region iteration with proper API closure pattern in reset_free_region_timestamps() and shrink_by_time_based_selection(). This is more maintainable and follows G1 API conventions. Issues: Thomas review openjdk#12-13, openjdk#15-16, openjdk#19, openjdk#21, openjdk#27-31
If
Agent_OnAttach()in JVMTI agent which is attempted to load via JVMTI.agent_load dcmd is failed, it would not be unloaded.We've discussed it on serviceability-dev. This PR is a continuation of that.
This PR also includes to call
Agent_OnUnload()whenAgent_OnAttach()failed.How to reproduce:
Run JShell
Load JVMTI agent via
jcmd <PID> JVMTI.agent_loadwith "error" ("error" meansAgent_OnAttach()returns JNI_ERR)jcmd <PID> VM.dynlibsProgress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/19/head:pull/19$ git checkout pull/19