RFR(MS): 8222072: JVMTI GenerateEvents() sends CompiledMethodLoad events to wrong jvmtiEnv

Jean Christophe Beyler jcbeyler at google.com
Tue Apr 9 16:29:41 UTC 2019


Hi Serguei,

I saw a nit here:

http://cr.openjdk.java.net/~sspitsyn/webrevs/2019/8222072-jvmti-GenerateEvents.1/test/hotspot/jtreg/serviceability/jvmti/GenerateEvents/MyPackage/GenerateEventsTest.java.html

arei -> are

- I'm not sure you needed two files for the agents, you could have re-used
some of the code and just called twice GetEnv but that is a detail.
- I thought JNIEnv was not supposed to be really kept because it should not
be used by another thread, is there not a risk that you are doing that? It
doesn't look like it but I've been surprised in the past
- Isn't there a chance that your second agent gets a normal
JVMTI_EVENT_COMPILED_METHOD_LOAD
before the GenerateEvents call and increments its counter?
   - I guess we'd see if it becomes flaky at some point? :)

Thanks!
Jc


On Mon, Apr 8, 2019 at 12:29 PM serguei.spitsyn at oracle.com <
serguei.spitsyn at oracle.com> wrote:

> Please, review a fix for:
>   https://bugs.openjdk.java.net/browse/JDK-8222072
>
> Webrev:
>
> http://cr.openjdk.java.net/~sspitsyn/webrevs/2019/8222072-jvmti-GenerateEvents.1/
>
>
> Summary:
>   The JVMTI GenerateEvents() must send CompiledMethodLoad events only to
> the agent which called it.
>   However, it sends events to all agents (jvmti environements) which
> violates the JVMTI spec.
>   The webrev above fixes this issue and adds new jtreg test:
>     test/hotspot/jtreg/serviceability/jvmti/GenerateEvents
>
>
> Testing:
>   Mach5 submission for:
>    - JVMTI tests: open/test/hotspot/jtreg/vmTestbase/nsk/jvmti
>    - new test: test/hotspot/jtreg/serviceability/jvmti/GenerateEvents
>
> Thanks,
> Serguei
>
>

-- 

Thanks,
Jc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/serviceability-dev/attachments/20190409/3afef611/attachment.html>


More information about the serviceability-dev mailing list