JDK-8073868 : Regex matching causes java.lang.ArrayIndexOutOfBoundsException: 64
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 8u31
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_8
  • CPU: x86
  • Submitted: 2015-02-24
  • Updated: 2015-09-29
  • Resolved: 2015-03-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b59Fixed
Related Reports
Duplicate :  
Description
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.


Comments
Sorry, didn't see the other bug was a duplicate. Fixed in original joni here: https://github.com/jruby/joni/issues/15
16-03-2015