JDK-8197930 : JNI exception pending in initializeEncoding of jni_util.c
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 7,8,11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • Submitted: 2018-02-14
  • Updated: 2019-10-04
  • Resolved: 2018-06-12
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 11 JDK 7 JDK 8 Other
11 b18Fixed 7u241Fixed 8u231Fixed openjdk8u232Fixed
Description
JNI exception pending in initializeEncoding of jni_util.c:856
The returns are not checked.
    String_init_ID = (*env)->GetMethodID(env, strClazz,
                                          "<init>", "([BLjava/lang/String;)V");
    String_coder_ID = (*env)->GetFieldID(env, strClazz, "coder", "B");
    String_value_ID = (*env)->GetFieldID(env, strClazz, "value", "[B");

Comments
Fix Request (8u) Backporting this one keeps codebases in sync when dealing with corner cases. This one depends on JDK-8030993. Patch does not apply cleanly, because it expects Compact Strings that are not available in 8u. Left only "CHECK_NULL(String_init_ID);" from the original patch. Passes hotspot_all, java/lang, java/io, java/nio tests. 8u RFR: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2019-June/009599.html
12-06-2019