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

AArch64: jtreg test test/jdk/sun/nio/cs/FindEncoderBugs.java fails

XMLWordPrintable

        This test fails with the following error on AArch64 with -Xcomp or
        tiered compilation:

          Buffer overrun: ISO-8859-1 "\u8a8e"[0/1] => UNMAPPABLE[1] ""[0/19] -114
          failures=1

          Passed = 223410156, failed = 10000

          STDERR:
          java.lang.AssertionError: Some tests failed
                  at FindEncoderBugs.main(FindEncoderBugs.java:526)

        The problem is caused by the encoder function for the ISO-8859-1
        character set writing one extra character to the output array when it
        encounters a character it can't encode.

        This is implemented as an intrinisc on AArch64. But the intrinisic
        doesn't excatly match the original Java code in ISO_8859_1.java:

          @HotSpotIntrinsicCandidate
          private static int implEncodeISOArray(char[] sa, int sp,
                                                byte[] da, int dp, int len) {
              int i = 0;
              for (; i < len; i++) {
                  char c = sa[sp++];
                  if (c > '\u00FF') // (1)
                      break;
                  da[dp++] = (byte)c; // (2)
              }
              return i;
          }

        In the intrinsic code statements (1) and (2) are swapped.

              njian Ningsheng Jian (Inactive)
              njian Ningsheng Jian (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: