My favorites | Sign in
Google
                
New issue | Search
for
| Advanced search | Search tips
Issue 497: Unexpected internal compiler error - Analyzing permutation #1
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  scottb@google.com
Closed:  Jan 2007
Type-Defect
Priority-High
Milestone-1_3_Final


Sign in to add a comment
 
Reported by chobantonov, Dec 06, 2006
GWT Release:
1.2.22

Detailed description:
When compiling to JavaScript, I'm getting the following error:
   Analyzing permutation #1
      [ERROR] Unexpected internal compiler error
java.lang.NullPointerException
        at
com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$GenerateJavaScriptVisitor.endVisit(GenerateJavaScriptAST.java:861)
        at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:79)
        at com.google.gwt.dev.jjs.ast.Holder.traverse(Holder.java:38)
        at
com.google.gwt.dev.jjs.ast.JBinaryOperation.traverse(JBinaryOperation.java:62)
        at com.google.gwt.dev.jjs.ast.Holder.traverse(Holder.java:38)
        at
com.google.gwt.dev.jjs.ast.JExpressionStatement.traverse(JExpressionStatement.java:20)
        at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:19)
        at
com.google.gwt.dev.jjs.ast.JIfStatement.traverse(JIfStatement.java:27)
        at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:19)
        at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:115)
        at com.google.gwt.dev.jjs.ast.JClassType.traverse(JClassType.java:36)
        at com.google.gwt.dev.jjs.ast.JProgram.traverse(JProgram.java:521)
        at
com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST.execImpl(GenerateJavaScriptAST.java:1430)
        at
com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST.exec(GenerateJavaScriptAST.java:1383)
        at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compile(JavaToJavaScriptCompiler.java:336)
        at
com.google.gwt.dev.GWTCompiler.realizePermutation(GWTCompiler.java:598)
        at
com.google.gwt.dev.GWTCompiler.compilePermutations(GWTCompiler.java:346)
        at com.google.gwt.dev.GWTCompiler.distill(GWTCompiler.java:295)
        at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:629)
        at com.google.gwt.dev.GWTCompiler.main(GWTCompiler.java:192)

The same code is working fine if I use the simulated mode.

Is it possible to turn some debugging (or something else) to figure out
which class from my code is causing the problem? I don't mind changing my
code to compensate for the problem for now. 

Workaround if you have one:
I would appreciate if you can provide some advice to use as workaround. 

Links to the relevant GWT Developer Forum posts:

Comment 1 by gwt.team.morrildl, Dec 08, 2006
(No comment was entered for this change.)
Owner: ---
Labels: -Priority-Medium Priority-High
Comment 2 by gwt.team.morrildl, Dec 08, 2006
chobantonov:  can you attach the code that's causing the error?  Otherwise there won't be much we can do aside 
from reading over that code and guessing.
Owner: ---
Comment 3 by s...@mail.ru, Dec 08, 2006
See http://code.google.com/p/google-web-toolkit/issues/detail?id=501
You might want to try 1.2.11
Comment 4 by chobantonov, Dec 08, 2006
I'm attaching the code that is causing the problem.
Steps to reproduce:
1. Unzip
2. cd test
3. execute the compile script. It should fail with the above exception
compile-problem.zip
440 KB   Download
Comment 5 by gwt.team.morrildl, Dec 13, 2006
(No comment was entered for this change.)
Owner: gwt.team.scottb
Comment 6 by gwt.team.scottb, Dec 18, 2006
Reproduced this.
Status: Accepted
Comment 7 by gwt.team.scottb, Dec 20, 2006
A fix has been submitted for code review.
patch2-scottb-issue497-r187
9.7 KB   Download
Status: Started
Comment 8 by gwt.team.scottb, Dec 21, 2006
Submitted as r220.
Status: FixedNotReleased
Labels: Milestone-1_3_Final
Comment 9 by gwt.team.scottb, Jan 19, 2007
Released in 1.3.3
Status: Fixed
Comment 10 by lior.dratler, Feb 15, 2007
Hi,
I have tries version 1.3.3 and the problem (seems) is still there:

[exec] Analyzing permutation #1
     [exec] [ERROR] Unexpected internal compiler error
     [exec] com.google.gwt.dev.jjs.impl.InternalCompilerException: Error during dispatch
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.dispatch(GenerateJavaAST.java:322)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.dispProcessStatement(GenerateJavaAST.java:356)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.processMethod(GenerateJavaAST.java:1185)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.processType(GenerateJavaAST.java:288)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST.exec(GenerateJavaAST.java:1971)
     [exec] at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compile(JavaToJavaScriptCompiler.java:295)
     [exec] at com.google.gwt.dev.GWTCompiler.realizePermutation(GWTCompiler.java:658)
     [exec] at com.google.gwt.dev.GWTCompiler.compilePermutations(GWTCompiler.java:413)
     [exec] at com.google.gwt.dev.GWTCompiler.distill(GWTCompiler.java:337)
     [exec] at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:689)
     [exec] at com.google.gwt.dev.GWTCompiler.main(GWTCompiler.java:208)
     [exec] Caused by: com.google.gwt.dev.jjs.impl.InternalCompilerException: Error
during dispatch
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.dispatch(GenerateJavaAST.java:322)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.dispProcessExpression(GenerateJavaAST.java:341)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.processStatement(GenerateJavaAST.java:1368)
     [exec] at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
     [exec] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [exec] at java.lang.reflect.Method.invoke(Method.java:585)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.dispatch(GenerateJavaAST.java:310)
     [exec] ... 10 more
     [exec] Caused by: com.google.gwt.dev.jjs.impl.InternalCompilerException: Cannot
create a ThisRef of the appropriate type.
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.createThisRef(GenerateJavaAST.java:1717)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.createThisRef(GenerateJavaAST.java:1678)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.processExpression(GenerateJavaAST.java:961)
     [exec] at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
     [exec] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [exec] at java.lang.reflect.Method.invoke(Method.java:585)
     [exec] at
com.google.gwt.dev.jjs.impl.GenerateJavaAST$JavaASTGenerationVisitor.dispatch(GenerateJavaAST.java:310)
     [exec] ... 16 more
Comment 11 by gwt.team.scottb, Feb 15, 2007
Hi lior,

This looks like a completely different problem, and in fact is not reproduced by the
test case chobantanov submitted.  Please enter a new issue and attach the offending
project.

Thanks,
Scott

Comment 12 by giancarlo.todone, Sep 15, 2007
Using gwt-windows-1.4.60 under NetBeans I get 

<<

init:
deps-clean:
do-clean:
Deleting 4 files from C:\Documents and Settings\jean\playPlate\build\web\WEB-INF\lib
Deleted 1 directory from C:\Documents and Settings\jean\playPlate\build\web\WEB-INF\lib
Deleting directory C:\Documents and Settings\jean\playPlate\build
Deleting directory C:\Documents and Settings\jean\playPlate\dist
check-clean:
clean:
init:
deps-module-jar:
deps-ear-jar:
deps-jar:
Created dir: C:\Documents and Settings\jean\playPlate\build\web\WEB-INF\classes
Created dir: C:\Documents and Settings\jean\playPlate\build\web\META-INF
Copying 1 file to C:\Documents and Settings\jean\playPlate\build\web\META-INF
Copying 13 files to C:\Documents and Settings\jean\playPlate\build\web
library-inclusion-in-archive:
Copying 1 file to C:\Documents and Settings\jean\playPlate\build\web\WEB-INF\lib
Copying 1 file to C:\Documents and Settings\jean\playPlate\build\web\WEB-INF\lib
Copying 1 file to C:\Documents and Settings\jean\playPlate\build\web\WEB-INF\lib
Copying 1 file to C:\Documents and Settings\jean\playPlate\build\web\WEB-INF\lib
library-inclusion-in-manifest:
Compiling 28 source files to C:\Documents and
Settings\jean\playPlate\build\web\WEB-INF\classes
Copying 1 file to C:\Documents and Settings\jean\playPlate\build\web\WEB-INF\classes
Output will be written into C:\Documents and
Settings\jean\playPlate\build\web\org.jean.Main
   Analyzing permutation #1
      [ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
        at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:538)
        at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:529)
        at
com.google.gwt.dev.jjs.ast.JVisitor.doAcceptWithInsertRemove(JVisitor.java:521)
        at com.google.gwt.dev.jjs.ast.JVisitor.acceptWithInsertRemove(JVisitor.java:81)
        at com.google.gwt.dev.jjs.ast.JClassType.traverse(JClassType.java:50)
        at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
        at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:509)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:69)
        at
com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$CreateNamesAndScopesVisitor.visit(GenerateJavaScriptAST.java:253)
        at com.google.gwt.dev.jjs.ast.JClassType.traverse(JClassType.java:48)
        at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
        at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:515)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:77)
        at com.google.gwt.dev.jjs.ast.JProgram.traverse(JProgram.java:699)
        at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
        at com.google.gwt.dev.jjs.ast.JVisitor.doAccept(JVisitor.java:509)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:69)
        at
com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST.execImpl(GenerateJavaScriptAST.java:1783)
        at
com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST.exec(GenerateJavaScriptAST.java:1653)
        at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compile(JavaToJavaScriptCompiler.java:385)
        at com.google.gwt.dev.GWTCompiler.realizePermutation(GWTCompiler.java:688)
        at com.google.gwt.dev.GWTCompiler.compilePermutations(GWTCompiler.java:411)
        at com.google.gwt.dev.GWTCompiler.distill(GWTCompiler.java:335)
        at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:755)
        at com.google.gwt.dev.GWTCompiler.run(GWTCompiler.java:745)
        at com.google.gwt.dev.GWTCompiler.main(GWTCompiler.java:213)
Caused by: java.lang.NullPointerException
        at java.util.TreeMap.compare(TreeMap.java:1093)
        at java.util.TreeMap.getEntry(TreeMap.java:347)
        at java.util.TreeMap.get(TreeMap.java:265)
        at com.google.gwt.dev.js.ast.JsScope.findExistingNameNoRecurse(JsScope.java:212)
        at com.google.gwt.dev.js.ast.JsScope.declareName(JsScope.java:94)
        at
com.google.gwt.dev.jjs.impl.GenerateJavaScriptAST$CreateNamesAndScopesVisitor.visit(GenerateJavaScriptAST.java:299)
        at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:141)
        at com.google.gwt.dev.jjs.ast.JVisitor.doTraverse(JVisitor.java:527)
        ... 24 more
         [ERROR] at SimpleAnimator.java(75): public abstract void finalize();
         [ERROR] at SimpleAnimator.java(5): abstract class SimpleAnimator extends
Object implements Animator, Rule 
         [ERROR] at FadeIn.java(7): final class FadeIn extends SimpleAnimator 
         [ERROR] <no source info>: <JProgram>
[ERROR] Build failed
C:\Documents and Settings\jean\playPlate\nbproject\build-gwt.xml:13: Java returned: 1

>>

only when i try to compile using the OBFUSCATED flag. Things go fine when using
DETAILED or PRETTY. The code to reproduce this is quite big, I'm trying to reproduce
it without the need of the whole project. Guess it's because of the heavy use of
inheritance and polymorphism.
Comment 13 by gwt.team.scottb, Sep 15, 2007
giancarlo.todone, I believe this is a different issue than the one that was fixed
here.  Can you please file this into a new issue?

Thanks,
Scott

Comment 14 by gwt.team.scottb, Sep 17, 2007
Thanks, the new issue is #1659.

Comment 15 by sumitcha...@google.com, Apr 28, 2008
 
Owner: scottb
Sign in to add a comment