RFR (S): JDK-8164086: Checked JNI pending exception check should be cleared when returning to Java frame
david.holmes at oracle.com
Wed Sep 7 05:37:12 UTC 2016
On 6/09/2016 5:51 PM, David Simms wrote:
> Updated webrev: http://cr.openjdk.java.net/~dsimms/8164086/webrev3/
No further comments from me, but note my original comment re the
platform specific code.
> On 06/09/16 01:20, David Holmes wrote:
>> Hi David,
>> On 5/09/2016 6:02 PM, David Simms wrote:
>>> Hi David,
>>> I can make the checks silent, but the launcher itself produces warnings
>>> from checked JNI (it's use of unchecked Java method invocations), and
>>> this causes the test
>>> to fail, with unchecked exception warnings popping up in the output.
>> I've looked back at your original changes in this area but I'm still
>> not seeing exactly where the unchecked back-to-back JNI calls are
>> happening. For example NewPlatformString can return with an exception
>> pending, but will return NULL, and the calling code has checks for NULL.
> Calls "CallStaticObjectMethod" from "NewPlatformString", then on line
> 1531 make another call "CallStaticObjectMethod".
> No exception check is made. The Xcheck:jni code cannot interpreter the
> return value from JNI "Call<X>Method" functions, so it triggers the
> "unchecked" exception warning at line 1531.
Ah I see. No bug in the launcher code though as it only makes the second
JNI call if the original did not return NULL and hence there can be no
This is a limitation of the unchecked warning facility as it can't take
control flow into account. :(
>>> But yeah, I could adjust the test the ignore any start-up warnings and
>>> drop the changes to the launcher...
>> Unless we can more clearly identify exactly where the launcher has a
>> problem I would prefer not to involve it in these changes. But I would
>> like to understand exactly why the launcher is triggering the check.
> Dropped launcher changes, adjusted the test to ignore any previous
Yep - that seems best: only monitor the test itself not the overall VM
> /David Simms
More information about the core-libs-dev