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

Sergey Bylokhov serb at openjdk.java.net
Fri Nov 19 20:10:13 UTC 2021


On Fri, 19 Nov 2021 09:14:15 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

>> The new test java/awt/font/JNICheck/FreeTypeScalerJNICheck.java introduced with https://bugs.openjdk.java.net/browse/JDK-8269223 adds -Xcheck:jni to an awt related test, and shows on Windows server 2019 the following JNI warning , so the test  JNICheck/FreeTypeScalerJNICheck.java fails on this Windows version.
>> 
>> :stdErr:
>> Thu Oct 28 01:27:10 CEST 2021
>> stdout: [WARNING in native method: JNI call made without checking exceptions when required to from CallStaticVoidMethodV
>>                at sun.awt.Win32GraphicsEnvironment.initDisplay(java.desktop at 18.0.0.1-internal/Native Method)
>>                at sun.awt.Win32GraphicsEnvironment.initDisplayWrapper(java.desktop at 18.0.0.1-internal/Win32GraphicsEnvironment.java:95)
>>                at sun.awt.Win32GraphicsEnvironment.<clinit>(java.desktop at 18.0.0.1-internal/Win32GraphicsEnvironment.java:63)
>>                at sun.awt.PlatformGraphicsInfo.createGE(java.desktop at 18.0.0.1-internal/PlatformGraphicsInfo.java:34)
>>                at java.awt.GraphicsEnvironment$LocalGE.createGE(java.desktop at 18.0.0.1-internal/GraphicsEnvironment.java:93)
>>                at java.awt.GraphicsEnvironment$LocalGE.<clinit>(java.desktop at 18.0.0.1-internal/GraphicsEnvironment.java:84)
>>                at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(java.desktop at 18.0.0.1-internal/GraphicsEnvironment.java:106)
>>                at FreeTypeScalerJNICheck.runTest(FreeTypeScalerJNICheck.java:53)
>>                at FreeTypeScalerJNICheck.main(FreeTypeScalerJNICheck.java:44)
>> 
>> We can get rid of the warning by adjusting a JNU_CallStaticMethodByName call in awt_Win32GraphicsEnv.cpp .
>
> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
> 
>   do you run FreeTypeScalerJNICheck.java test on Windows

> I understand that this is about the debug build on Windows only. So why not solve it like this: [d042029](https://github.com/openjdk/jdk/commit/d042029509a8cbdb723f78e2cfee4e2885775814) ?

The current issue does not produce any debug assertions nor try to open a debugger, so it is different. We need to check why the jni warning is produced, probably we call more java methods via jni in the debug build?

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

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



More information about the client-libs-dev mailing list