[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR: 8252657: JVMTI agent is not unloaded when Agent_OnAttach is failed
From:       Yasumasa Suenaga <ysuenaga () openjdk ! java ! net>
Date:       2020-11-24 5:45:55
Message-ID: 96QB1WTG_puWZM9TqQusV_43lTbHoGxCIJKBpAG43o0=.0e67d662-7fd6-46d1-a571-81604669efb7 () github ! com
[Download RAW message or body]

On Thu, 12 Nov 2020 01:34:33 GMT, Yasumasa Suenaga <ysuenaga@openjdk.org> wrote:

> > If we can change the spec that agent library would not be unloaded when \
> > `Agent_OnAttach()` failed, we can change like \
> > [webrev.00](https://cr.openjdk.java.net/~ysuenaga/JDK-8252657/webrev.00/). It is \
> > simple, and similar behavior with `Agent_OnLoad()`. It might be prefer for JVMTI \
> > agent developers.
> 
> In case of `Agent_OnLoad()`, if it is failed (it returns other than zero), JVM is \
> aborted and `Agent_OnUnload()` is not called. I think it is compliant with [JVMTI \
> spec of Agent_OnUnload()](https://docs.oracle.com/en/java/javase/15/docs/specs/jvmti.html#onunload) \
> which says uncontrolled shutdown (aborting JVM) is an exception to this rule. 
> I will add CSR for this fix, but I want to discuss what we should do before. I like \
> that `Agent_OnUnload()` wouldn't be called when `Agent_OnAttach()` is failed if we \
> can change the spec - it is consistent and friendly with `Agent_OnLoad()`.

I added [CSR for this PR](https://wiki.openjdk.java.net/display/csr/Main) and updated \
patch. Could you review it? I think it is reasonable to clarify the spec not to call \
`Agent_OnUnload()` when `Agent_OnLoad()` or `Agent_OnAttach()` are failed. It is \
nature for me, and it does not change current behavior in HotSpot.

-------------

PR: https://git.openjdk.java.net/jdk/pull/19


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic