Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8166358

Re-enable String verification in java_lang_String::create_from_str()

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      JEP 254: Compact Strings (JDK-8054307) added verification code to java_lang_String::create_from_unicode(), create_from_str() and create_from_symbol() to verify the result of compressing a String to Latin-1:
      http://hg.openjdk.java.net/jdk9/sandbox/hotspot/rev/387da3650bc3

      This verification failed in the past due to invalid UTF-8 Strings being passed through JNI (see also JDK-8164561). To avoid this, the verification in java_lang_String::create_from_str() was temporarily disabled:
        // This check is too strict because the input string is not necessarily valid UTF8.
        // For example, it may be created with arbitrary content via jni_NewStringUTF.

      We need to investigate if this code can/should be enabled again and fix JNI tests that pass invalid UTF-8 Strings. We should also check if additional verification is necessary to avoid passing invalid UTF-8 Strings through VM internal code.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                thartmann Tobias Hartmann
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: