Please, review fix for:
https://bugs.openjdk.java.net/browse/JDK-8244571
Webrev:
http://cr.openjdk.java.net/~sspitsyn/webrevs/2020/8244571-jvmti-test-jnicheck.1/
Summary:
There are two places in the native part of test that cause
assert and WARNING with the -Xcheck:jni.
The assert is because there is no check for pending exception
after the call to:
jni->CallBooleanMethod(klass,
is_hid_mid);
Using a JNI ExceptionCheck() after the call fixes the issue.
The following call to the JVM TI function:
err = jvmti->GetClassLoaderClasses(loader,
&count, &loader_classes);
produces the warning (with a java level stack trace): WARNING: JNI
local refs: 94, exceeds capacity: 32
It is because the GetClassLoaderClasses returns an array of local
references to the loader classes.
Using a JNI EnsureLocalCapacity() before the
JVM TI call also fixes the issue.
Testing:
Running the test
test/hotspot/jtreg/serviceability/jvmti/HiddenClass locally.
Will run a mach5 job as well.
Thanks,
Serguei
- RFR (XS): 8244571: assert(!_thread->is_pendi... [email protected]
