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

mathExact: assert(i < _max) failed: oob: i=1, _max=1

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: hs25
    • Fix Version/s: hs25
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b57
    • CPU:
      x86, x86_64
    • Verification:
      Not verified

      Backports

        Description

        When running some javascript through nashorn this assert was detected.

        Small java repro:

        public class Nested {
            public static int value = 17;

            public static void main(String[] args) throws Exception {
                for (int i = 0; i < 100; ++i) {
                    int result = runTest();
                    System.out.println(result);
                }
            }

            public static int runTest() {
                int sum = 0;
                for (int j = 0; j < 100000; j = java.lang.Math.addExact(j, 1)) {
                    sum = 1;
                    for (int i = 0; i < 5; ++i) {
                        sum = sum * value; //* value;
                    }
                }
                return sum;
            }
        }

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rbackman Rickard Backman
                  Reporter:
                  rbackman Rickard Backman
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: