RFR: JDK-8276809: java/awt/font/JNICheck/FreeTypeScalerJNICheck.java shows JNI warning on Windows

Sergey Bylokhov serb at openjdk.java.net
Tue Nov 9 20:55:39 UTC 2021


On Tue, 9 Nov 2021 19:45:07 GMT, Phil Race <prr at openjdk.org> wrote:

>> src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsEnv.cpp line 129:
>> 
>>> 127: 
>>> 128:     JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
>>> 129:     JNU_CallStaticMethodByName(env, &ignoreException,
>> 
>> As far as understand from the previous fix the "ignoreException" parameter does not suppress the currently raised exception, it just suppresses the warning in the XCheck:jni. So it will be good to propagate an exception to the user if this code is executed on the "java" thread, and log it by the trace macro if it is executed on a toolkit thread.
>
> Yeah this looks like the wrong fix.
> -Xcheck:jni only warns like this if there are actual exceptions, doesn't it ?
> So if we had one, where was it ?
> 
> Note that Windows Server 2019 is a staple of the CI testing at Oracle and the test hasn't failed in the > 2 months since it was integrated, so I'm wondering why it fails in your case ?
> Was this a debug build perhaps ?

I think Xcheck:jni raises a warning when two JNI calls are made in a row w/o calling exception check in between. So it is not necessary to have an actual exception to produce a warning.

Probably it is reproduced there, because that system is "true" headless, and the execution code path is just different, or something like that, need to check what is the next/prev JNI call.
Or maybe this method really throw an exception, need some more detail.

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

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



More information about the client-libs-dev mailing list