RFR: 8273483: Zero: Clear pending JNI exception check in native method handler
Aleksey Shipilev
shade at openjdk.java.net
Thu Sep 9 09:50:08 UTC 2021
On Wed, 8 Sep 2021 10:26:42 GMT, Andrew Haley <aph 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
>
> Marked as reviewed by aph (Reviewer).
Thanks for review, @theRealAph. I'll integrate to get cleaner tier1 runs.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5411
More information about the hotspot-dev
mailing list