RFR: 8323664: java/awt/font/JNICheck/FreeTypeScalerJNICheck.java still fails with JNI warning on some Windows configurations [v3]
Alexey Ivanov
aivanov at openjdk.org
Mon Feb 12 11:42:54 UTC 2024
On Sun, 11 Feb 2024 19:33:06 GMT, Phil Race <prr at openjdk.org> wrote:
>> As I said before, the new code just quiesces JNI warnings. It is anyway only used in debug builds. And in the case one sees a "real" exception before entering the assertion handler, this exception will be on the stack when returning to Java and cause the trouble it should then cause. I guess in that case an incorrect tracing of the assertion is no problem. And, after all, the current behavior is not changed.
>>
>> I would rather like to pull your attention to a "real fix": Please have a look at #17614 ([JDK-8185862](https://bugs.openjdk.org/browse/JDK-8185862)). It would be good if that can be reviewed and integrated since it will fix a few errors that we see on Windows testing.
>
> Yes, I'll take a look at that soon. Remember there are two issues behind all of this
> (1) We don't have a real headless build for windows and this can cause failures of windows APIs and Java exceptions
> (2) debug builds use asserts on failures of windows APIs
>
> (2) is partially addressed here
> (1) is partially addressed in the other fix. I can't be sure its completely addressed
I thought about it a bit more…
Since `Java_sun_awt_Win32GraphicsEnvironment_initDisplay` does not call other JNI functions after `DWMIsCompositionEnabled`, it is reasonable to leave a possible raised exception unhandled — it will handled by JVM after `initDisplay` returns.
Perhaps, it's better to handle the exception inside the assertion handler:
if (env->ExceptionCheck()) {
env->ExceptionDescribe();
env->ExceptionClear();
}```
Or maybe not, if `ExceptionCheck()` is enough to silence the warning and the raised exception is still thrown after the control is returned to JVM.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17404#discussion_r1486066949
More information about the client-libs-dev
mailing list