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

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

XMLWordPrintable

    • b25

        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.

              coleenp Coleen Phillimore
              thartmann Tobias Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: