RFR: 8273483: Zero: Clear pending JNI exception check in native method handler
Aleksey Shipilev
shade at openjdk.java.net
Wed Sep 8 10:17:13 UTC 2021
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
-------------
Commit messages:
- Fix
Changes: https://git.openjdk.java.net/jdk/pull/5411/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5411&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8273483
Stats: 6 lines in 1 file changed: 6 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/5411.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5411/head:pull/5411
PR: https://git.openjdk.java.net/jdk/pull/5411
More information about the hotspot-dev
mailing list