JDK-8152911 : javac assertion error when compiling overlay sources
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-03-29
  • Updated: 2016-10-10
  • Resolved: 2016-10-04
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 b139Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
When compiling overlay sources such as for jsr166 the compiler crashes with this stack trace, instead javac should display a suitable error and fail gracefully. A reproducer attached.

An exception has occurred in the compiler (9-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError
	at com.sun.tools.javac.util.Assert.error(jdk.compiler@9-internal/Assert.java:155)
	at com.sun.tools.javac.util.Assert.checkNull(jdk.compiler@9-internal/Assert.java:54)
	at com.sun.tools.javac.code.Symtab.enterModule(jdk.compiler@9-internal/Symtab.java:753)
	at com.sun.tools.javac.comp.Modules.enterModule(jdk.compiler@9-internal/Modules.java:257)
	at com.sun.tools.javac.comp.Modules.enterModules(jdk.compiler@9-internal/Modules.java:235)
	at com.sun.tools.javac.comp.Modules.enter(jdk.compiler@9-internal/Modules.java:203)
	at com.sun.tools.javac.main.JavaCompiler.readSourceFile(jdk.compiler@9-internal/JavaCompiler.java:816)
	at com.sun.tools.javac.main.JavaCompiler.readSourceFile(jdk.compiler@9-internal/JavaCompiler.java:778)
	at com.sun.tools.javac.main.JavaCompiler.access$100(jdk.compiler@9-internal/JavaCompiler.java:97)
	at com.sun.tools.javac.main.JavaCompiler$1.complete(jdk.compiler@9-internal/JavaCompiler.java:339)
	at com.sun.tools.javac.code.ClassFinder.fillIn(jdk.compiler@9-internal/ClassFinder.java:362)
	at com.sun.tools.javac.code.ModuleFinder.lambda$findSingleModule$0(jdk.compiler@9-internal/ModuleFinder.java:206)
	at com.sun.tools.javac.code.Symbol.complete(jdk.compiler@9-internal/Symbol.java:601)
	at com.sun.tools.javac.comp.Modules.setCompilationUnitModules(jdk.compiler@9-internal/Modules.java:361)
	at com.sun.tools.javac.comp.Modules.enter(jdk.compiler@9-internal/Modules.java:205)
	at com.sun.tools.javac.main.JavaCompiler.initModules(jdk.compiler@9-internal/JavaCompiler.java:1020)
	at com.sun.tools.javac.main.JavaCompiler.initModules(jdk.compiler@9-internal/JavaCompiler.java:1012)
	at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler@9-internal/JavaCompiler.java:906)
	at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-internal/Main.java:261)
	at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-internal/Main.java:143)
	at com.sun.tools.javac.Main.compile(jdk.compiler@9-internal/Main.java:55)
	at com.sun.tools.javac.Main.main(jdk.compiler@9-internal/Main.java:41)

Comments
javac, and by extension javadoc, should never crash, so this is a useful reproducer. That being said, any time you are compiling additional sources for an existing module, I would expect -Xmodule to be involved: in this case -Xmodule:java.base. (The option name needs to be updated in line with the new-style option naming work; but that's a separate issue.)
29-08-2016

Here's the repro recipe from JDK-8164980: ~/ws/jdk9/jdk $ (rm -rf /tmp/t9; mkdir -p /tmp/t9; ../build/linux-x86_64-normal-server-release/images/jdk/bin/javadoc -d /tmp/t9 -sourcepath src/java.base/share/classes $(find -name ArrayDeque.java))
29-08-2016