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

C2: EliminateAutoBox regression after 8042786

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 8u40, 9
    • hotspot
    • b15
    • 9
    • b40
    • x86_64
    • Verified

        Originally reported at http://stackoverflow.com/questions/25942010/how-is-arrayoutofboundsexception-possible-in-string-valueofint

        The following test case crashes JVM when it should normally runs forever.

        public class EliminateAutoBoxCrash {
            private static final int[] values = new int[256];

            public static void main(String[] args) {
                byte[] bytes = new byte[] {-1};
                while (true) {
                    for (Byte b : bytes) {
                        values[b & 0xff]++;
                    }
                }
            }
        }

        Note autoboxing: Byte b.
        Workaround: -XX:-EliminateAutoBox

        Initial investigation shows that the bug has been introduced with the fix for JDK-8042786.

              vlivanov Vladimir Ivanov
              apangin Andrei Pangin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: