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

C2: EliminateAutoBox regression after 8042786

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 8u40, 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Introduced In Build:
      b15
    • Introduced In Version:
      9
    • Resolved In Build:
      b40
    • CPU:
      x86_64
    • Verification:
      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

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: