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

java.lang.ArrayIndexOutOfBoundsException: 19530773 in javac

XMLWordPrintable

    • x86

      FULL PRODUCT VERSION :
      java version "1.8.0_111"
      Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
      Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 10.0.14393]

      A DESCRIPTION OF THE PROBLEM :
      Compile a class that uses another class with a java.lang.ClassFormatError in it will make the copiler throw a java.lang.ArrayIndexOutOfBoundsException.

      Execute following two lines in Windows cmd.exe

      path "C:\Program Files\Java\jdk1.8.0_20\bin"
      javac -cp F:\Java\World F:\Java\World\duo\Main.java

      I could create the bug in any directory on F:\ and C:\. F:\ is a flash disk.

      I have tried...

      * cd F:\Java\World
        javac duo\Main.java

      * Change package from duo to World.duo

      * restart the computer

      * Copy to C:

      * Copy the text of Main.java
        Renamed Main.java to Main.txt
        Create a new file called Main.java, paste the text in it.

      ...But, it's the same problem and error message.

      The strange thing is that it the exception is not thrown when there are errors in the code.

      Solution:
      This java.lang.ArrayIndexOutOfBoundsException: 19530773 in the compiler because of an not compiled class. Just run the class and java will complain on another class. Then recompile the class that the compiler complains on.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Try to compile a class that uses a class with an java.lang.ClassFormatError in it.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I excepted that
      javac -cp F:\Java\World F:\Java\World\duo\Main.java
      should compile the file "F:\Java\World\duo\Main.java".
      ACTUAL -
      Following text was printed in the javac output.

      An exception has occurred in the compiler (1.8.0_20). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.ArrayIndexOutOfBoundsException: 19530773
              at com.sun.tools.javac.jvm.ClassReader.nextInt(ClassReader.java:379)
              at com.sun.tools.javac.jvm.ClassReader.skipMember(ClassReader.java:2167)
              at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2223)
              at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2322)
              at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2509)
              at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2440)
              at com.sun.tools.javac.jvm.ClassReader.access$000(ClassReader.java:76)
              at com.sun.tools.javac.jvm.ClassReader$1.complete(ClassReader.java:240)
              at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
              at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)
              at com.sun.tools.javac.jvm.ClassReader.loadClass(ClassReader.java:2621)
              at com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:1886)
              at com.sun.tools.javac.comp.Resolve.findGlobalType(Resolve.java:1986)
              at com.sun.tools.javac.comp.Resolve.findType(Resolve.java:2064)
              at com.sun.tools.javac.comp.Resolve.findIdent(Resolve.java:2089)
              at com.sun.tools.javac.comp.Resolve.resolveIdent(Resolve.java:2363)
              at com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:3174)
              at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
              at com.sun.tools.javac.comp.Attr.attribType(Attr.java:669)
              at com.sun.tools.javac.comp.Attr.attribType(Attr.java:662)
              at com.sun.tools.javac.comp.MemberEnter.visitVarDef(MemberEnter.java:656)
              at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:852)
              at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:437)
              at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:449)
              at com.sun.tools.javac.comp.MemberEnter.finishClass(MemberEnter.java:459)
              at com.sun.tools.javac.comp.MemberEnter.finish(MemberEnter.java:1409)
              at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1207)
              at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
              at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)
              at com.sun.tools.javac.comp.Enter.complete(Enter.java:493)
              at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
              at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
              at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
              at com.sun.tools.javac.main.Main.compile(Main.java:523)
              at com.sun.tools.javac.main.Main.compile(Main.java:381)
              at com.sun.tools.javac.main.Main.compile(Main.java:370)
              at com.sun.tools.javac.main.Main.compile(Main.java:361)
              at com.sun.tools.javac.Main.compile(Main.java:56)
              at com.sun.tools.javac.Main.main(Main.java:42)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Following text was printed in the javac output after "javac -cp F:\Java\World F:\Java\World\duo\Main.java"

      An exception has occurred in the compiler (1.8.0_20). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.ArrayIndexOutOfBoundsException: 19530773
              at com.sun.tools.javac.jvm.ClassReader.nextInt(ClassReader.java:379)
              at com.sun.tools.javac.jvm.ClassReader.skipMember(ClassReader.java:2167)
              at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2223)
              at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2322)
              at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2509)
              at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:2440)
              at com.sun.tools.javac.jvm.ClassReader.access$000(ClassReader.java:76)
              at com.sun.tools.javac.jvm.ClassReader$1.complete(ClassReader.java:240)
              at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
              at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)
              at com.sun.tools.javac.jvm.ClassReader.loadClass(ClassReader.java:2621)
              at com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:1886)
              at com.sun.tools.javac.comp.Resolve.findGlobalType(Resolve.java:1986)
              at com.sun.tools.javac.comp.Resolve.findType(Resolve.java:2064)
              at com.sun.tools.javac.comp.Resolve.findIdent(Resolve.java:2089)
              at com.sun.tools.javac.comp.Resolve.resolveIdent(Resolve.java:2363)
              at com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:3174)
              at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2011)
              at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:607)
              at com.sun.tools.javac.comp.Attr.attribType(Attr.java:669)
              at com.sun.tools.javac.comp.Attr.attribType(Attr.java:662)
              at com.sun.tools.javac.comp.MemberEnter.visitVarDef(MemberEnter.java:656)
              at com.sun.tools.javac.tree.JCTree$JCVariableDecl.accept(JCTree.java:852)
              at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:437)
              at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:449)
              at com.sun.tools.javac.comp.MemberEnter.finishClass(MemberEnter.java:459)
              at com.sun.tools.javac.comp.MemberEnter.finish(MemberEnter.java:1409)
              at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1207)
              at com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)
              at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)
              at com.sun.tools.javac.comp.Enter.complete(Enter.java:493)
              at com.sun.tools.javac.comp.Enter.main(Enter.java:471)
              at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)
              at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)
              at com.sun.tools.javac.main.Main.compile(Main.java:523)
              at com.sun.tools.javac.main.Main.compile(Main.java:381)
              at com.sun.tools.javac.main.Main.compile(Main.java:370)
              at com.sun.tools.javac.main.Main.compile(Main.java:361)
              at com.sun.tools.javac.Main.compile(Main.java:56)
              at com.sun.tools.javac.Main.main(Main.java:42)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Recompile duo\map\Map.java. Main.java uses this class.

      Run the class that has an error in it. There may be an java.lang.ClassFormatError thrown. At the end of the first line there is a path to a class. Recompile that class and the bug is fixed.

            fmatte Fairoz Matte
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: