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

Regex matching causes java.lang.ArrayIndexOutOfBoundsException: 64

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8u31
    • core-libs
    • b59
    • x86
    • windows_8

        FULL PRODUCT VERSION :
        java version "1.8.0_31"
        Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
        Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Windows 8 [Version 6.2.9200]

        A DESCRIPTION OF THE PROBLEM :
         ran into a strange java.lang.ArrayIndexOutOfBoundsException: 64 error while parsing text using Nashorn Javascript engine. To reproduce the problem in JJS:

        var col0 = " xxxx, xxx xxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ";
        var name = /([^\s]+),(.*)+/.exec(col0);

        Some other variants of the test string also cause the same exception, for example.

        var col0 = "x, xxxxxxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ";

        Happens with JDK8 versions 25, 31 and 40ea (on Windows 8).

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        run "jjs.exe"
        jjs> var col0 = " Lönn, Per Gustaf Magnusson Dörring, Knut Johan Anton ";
        jjs> var name = /([^\s]+),(.*)+/.exec(col0);
        java.lang.ArrayIndexOutOfBoundsException: 64



        REPRODUCIBILITY :
        This bug can be reproduced always.

              hannesw Hannes Wallnoefer
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: