Integrated: 8273483: Zero: Clear pending JNI exception check in native method handler

Aleksey Shipilev shade at openjdk.java.net
Thu Sep 9 09:50:09 UTC 2021


On Wed, 8 Sep 2021 10:08:50 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> If you run Zero with existing tier1 test, then it would fail like this:
> 
> 
> $ CONF=linux-x86_64-zero-fastdebug make exploded-test TEST=runtime/jni/checked/TestCheckedJniExceptionCheck.java
> 
>  stdout: [TEST STARTED
> testSingleCallNoCheck start
> WARNING in native method: JNI call made without checking exceptions when required to from CallVoidMethod
> at java.lang.Object.getClass(java.base/Native Method)
> at java.io.PrintStream.println(java.base/PrintStream.java:1035)
> at TestCheckedJniExceptionCheck.testSingleCallNoCheck(TestCheckedJniExceptionCheck.java:82)
> at TestCheckedJniExceptionCheck.test(TestCheckedJniExceptionCheck.java:66)
> at TestCheckedJniExceptionCheck.main(TestCheckedJniExceptionCheck.java:203)
> testSingleCallNoCheck end
> 
> 
> In other words, there is a warning from the native call to Object.getClass from the test println itself, which it does not expect. This is because Zero does not clear the pending JNI exception check flag. All other (template) interpreter implementation do clear it in native call handlers. So the test rightfully reports the excess warning. 
> 
> Additional testing:
>  - [x] Linux x86_64 Zero, `runtime/jni` tests now pass

This pull request has now been integrated.

Changeset: aa931118
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/aa9311182ae88312a70b18afd85939718415b77c
Stats:     6 lines in 1 file changed: 6 ins; 0 del; 0 mod

8273483: Zero: Clear pending JNI exception check in native method handler

Reviewed-by: aph

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

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


More information about the hotspot-dev mailing list