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

AArch64: String.compareTo() can read memory after string

    Details

    • Subcomponent:
    • Introduced In Version:
      11
    • Resolved In Build:
      b22
    • CPU:
      aarch64
    • OS:
      linux

      Description

      There is a bug in stub code of AArch64 String.compareTo() intrinsics. It can be reproduced by below Java code and VM options.

      public class Test {
        public static void main(String[] args) {
          String str1 = "/home/pengfei/backup/Android/projects/ActionBarSherlock/tree/master/actionbarsherlock/res/";
          String str2 = "/home/pengfei/backup/Android/projects/ActionBarSherlock/tree/master/actionbarsherlock/res/\u6d4b\u8bd5.png";
          System.out.println(str1.compareTo(str2));
        }
      }

      // $ java -Xint Test
      // -6
      // $ java -Xcomp -XX:-TieredCompilation -XX:-Inline Test
      // -27979

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dpochepk Dmitrij Pochepko
                Reporter:
                pli Pengfei Li
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: