JDK-8037937 : javac: AssertionError during LVT generation, wrong variable ranges
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2014-03-19
  • Updated: 2014-09-25
  • Resolved: 2014-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 8 JDK 9
8u20Fixed 9 b16Fixed
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows 7 Ultimate 64-Bit

A DESCRIPTION OF THE PROBLEM :
Compiler crashes when rebuilding a project with many thousand classes

ADDITIONAL REGRESSION INFORMATION: 
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)


ERROR MESSAGES/STACK TRACES THAT OCCUR :
Information:Using javac 1.8.0 to compile java sources
Information:java: An exception has occurred in the compiler (1.8.0). 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.
Information:java: 	at com.sun.tools.javac.util.Assert.check(Assert.java:45)
Information:java: 	at com.sun.tools.javac.jvm.ClassWriter.writeCode(ClassWriter.java:1189)
Information:java: 	at com.sun.tools.javac.jvm.ClassWriter.writeMethod(ClassWriter.java:1110)
Information:java: 	at com.sun.tools.javac.jvm.ClassWriter.writeMethods(ClassWriter.java:1602)
Information:java: 	at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1692)
Information:java: 	at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1620)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:749)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1570)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1534)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:904)
Information:java: 	at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:863)
Information:java: 	at com.sun.tools.javac.main.Main.compile(Main.java:523)
Information:java: 	at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
Information:java: 	at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
Information:java: 	at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:160)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:378)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:282)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:188)
Information:java: 	at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:160)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1095)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:809)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:857)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:772)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:595)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:352)
Information:java: 	at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:184)
Information:java: 	at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:129)
Information:java: 	at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:224)
Information:java: 	at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
Information:java: 	at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:133)
Information:java: 	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
Information:java: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Information:java: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Information:java: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
Information:java: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Information:java: 	at java.lang.Thread.run(Thread.java:744)
Information:java: Errors occurred while compiling module 'mnet-platform'
Information:Compilation completed with 2 errors and 3 warnings in 12 sec
Information:2 errors
Information:3 warnings
Error:java: java.lang.AssertionError
Error:java: 	at com.sun.tools.javac.util.Assert.error(Assert.java:126)
D:\MNet\VIVA\BaseSys\trunk\Libs\Platform\trunk\src\main\java\mnet\basicgui\HTMLTextEditorDialog.java
Warning:(64, 17) java: mnet.util.SwingWorker in mnet.util has been deprecated
D:\MNet\VIVA\BaseSys\trunk\Libs\Platform\trunk\src\main\java\mnet\data\formulaeditor\AbstractFormulaEditor.java
Warning:(11, 17) java: mnet.util.SwingWorker in mnet.util has been deprecated
D:\MNet\VIVA\BaseSys\trunk\Libs\Platform\trunk\src\main\java\mnet\data\datatree\DataModul.java
Warning:java: Class dependency information may be incomplete! Error parsing generated class D:\MNet\VIVA\BaseSys\trunk\Libs\Platform\trunk\target\classes\mnet\data\datatree\DataModul.class
Error: 0
java.lang.ArrayIndexOutOfBoundsException: 0
	at org.jetbrains.asm4.ClassReader.readClass(ClassReader.java:2170)
	at org.jetbrains.asm4.ClassReader.accept(ClassReader.java:577)
	at org.jetbrains.asm4.ClassReader.accept(ClassReader.java:533)
	at org.jetbrains.jps.builders.java.dependencyView.ClassfileAnalyzer.analyze(ClassfileAnalyzer.java:585)
	at org.jetbrains.jps.builders.java.dependencyView.Mappings$11.associate(Mappings.java:2196)
	at org.jetbrains.jps.incremental.java.OutputFilesSink.save(OutputFilesSink.java:94)
	at org.jetbrains.jps.incremental.java.JavaBuilder$ClassProcessingConsumer$2.run(JavaBuilder.java:922)
	at org.jetbrains.jps.incremental.java.JavaBuilder$4.run(JavaBuilder.java:409)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:37)
	at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:744)

REPRODUCIBILITY :
This bug can be reproduced always.


Comments
Test case: class Test { Object m(boolean cond1, boolean cond2) { Object o; if (cond1) { if (cond2) { o = null; } else { o = null; return null; } } return null; } } Thanks to the original bug reporter and his team for their commitment. Also, thanks for their help to find a test case that reproduces this bug.
15-05-2014

I have sent a mail to the user.
24-03-2014

May be related to JDK-8027660 (which was fixed for JDK8, though).
24-03-2014