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

C2: EliminateAutoBox regression after 8042786

    XMLWordPrintable

Details

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

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: