JDK-8164086 : Checked JNI pending exception check should be cleared when returning to Java frame
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8u60,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-08-16
  • Updated: 2017-01-16
  • Resolved: 2016-09-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b138Fixed
Related Reports
Relates :  
Relates :  
Description
JDK-8043224 introduced a thread flag for warning the user when -Xcheck:jni should complain about native code not clearing or checking exceptions.

Said flag should be implicitly cleared when returning to Java frame.

That is, native code which makes a call normally requiring an exception check (e.g. calling Java method), does not need to check for exceptions if said code calls no other JNI API. Returning to Java frame should clear the pending check flag (for -Xcheck:jni warnings) and allow the exception to propagate to Java code as per normal.

Without this fix, there are quite a number of false warnings produced by core-library native code, causing some noise during JVM testing and when users need -Xcheck:jni