-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8252657: JVMTI agent is not unloaded when Agent_OnAttach is failed #19
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
|
/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 Yasumasa Suenaga on serviceability-dev: Hi David,
Thank you so much! However I think following sentence should be removed because DLL unloading mechanism is not hooked, and also `Agent_OnUnload()` wouldn't be called by dll unloading - it depends on VM termination / failure / non-zero value from entry points. "this function will be called if some platform specific mechanism causes the unload (an unload mechanism is not specified in this document)" If you are OK, I will update CSR. Cheers, Yasumasa On 2020/12/16 11:09, David Holmes wrote:
|
|
Mailing list message from David Holmes on serviceability-dev: On 16/12/2020 4:33 pm, Yasumasa Suenaga wrote:
Yes I think it is reasonable to allow this. But of course there must be
I'm not sure you mean exactly by DLL unloading mechanism is not hooked. Cheers,
|
|
Mailing list message from Yasumasa Suenaga on serviceability-dev: Hi David,
I want to say we do not hook `FreeLibrary()` on Windows and `dlclose()` on Linux. Cheers, On 2020/12/16 15:48, David Holmes wrote:
|
|
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) |
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.
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 |
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.
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
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