JDK-8080976 : Unexpected AIOOB thrown from 1.9.0-ea-b64 on (regression)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86_64
  • Submitted: 2015-05-25
  • Updated: 2017-08-07
  • Resolved: 2015-05-29
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 9
9 b69Fixed
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.9.0-ea"
Java(TM) SE Runtime Environment (build 1.9.0-ea-b65)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-b65, mixed mode)


FULL OS VERSION :
Checked on Windows and Linux, 64-bit. Same behavior.

A DESCRIPTION OF THE PROBLEM :
Expected behavior:
  The code re-reads a valid bz2 resource, looping and printing (infinitely):
  Round...
  Round...
  Round...

Actual behavior (64-Bit Server VM, build 1.9.0-ea-b64, mixed mode):
  Round...
  Round...
  Round...
  Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 314297
          at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.setupBlock(BZip2CompressorInputStream.java:820)

Definitely something with the compilation because disabling loop
unrolling (or running in interpreted mode) doesn't trigger the bug.


THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No

THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

REGRESSION.  Last worked in version 8u45

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The bug repro code is at the link below:
http://download.carrotsearch.com/jvm/repro.zip

- Self contained maven project (copied commons compress sources so that one can
  tweak them if needed). An additional bz2 resource is needed (included).
- (optionally) build with:
  mvn package
- Run with:
  java -jar target/Repro-0.0.0.jar
- Running in interpreted mode does *not* cause any error:
  java -Xint -jar target/Repro-0.0.0.jar
- Running without loop unrolls does *not* cause any error:
  java -Xbatch -XX:LoopUnrollLimit=0 -jar target/Repro-0.0.0.jar

EXPECTED VERSUS ACTUAL BEHAVIOR :
The program should run without AIOOBs, the input is valid.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
  Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 314297
          at org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream.setupBlock(BZip2CompressorInputStream.java:820)

(the index does vary from run to run).

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Source code in the ZIP link pasted above (not a trivial snippet).
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Disable loop unrolling. Run in interpreted mode.


Comments
Possibly related
28-05-2015

ILW=unexpected expcetion, regression; reproduclbe, but haven't seen in other cases;-XX:LoopUnrollLimit=0 = HMM => P2
28-05-2015

Bug not reproduceable with -XX:-SuperWordReductions. I suspect superword reduction doesn't take the loop variant use of the result of the reduction into account.
26-05-2015