Re: [abc-users] Internal compiler error while compiling AJHotDraw

From: Guillaume Pothier <gpothier_at_gmail.com>
Date: Fri, 14 Mar 2008 17:51:53 +2000

Hi, I found the cause of the internal error I got:

> Caused by: java.lang.NullPointerException
> at abc.weaving.weaver.around.AdviceApplicationInfo.doWeave(AdviceApplicationInfo.java:420)

If have the around-inlining option set to off, so exitsShadowMethodObj
is never initialized (see line 361).
So I justed added null checks at lines 420 and 547:

if (! (Debug.v().removeDupAroundMethods && exitsShadowMethodObj !=
null && exitsShadowMethodObj.shadowMethodExists))

Is that a correct fix?
g

> at abc.weaving.weaver.around.ProceedMethod.doWeave(ProceedMethod.java:213)
> at abc.weaving.weaver.around.AdviceMethod.doWeave(AdviceMethod.java:250)
> at abc.weaving.weaver.around.AroundWeaver.doWeave(AroundWeaver.java:154)
> at abc.weaving.aspectinfo.AroundAdvice.weave(AroundAdvice.java:162)
> at abc.weaving.weaver.PointcutCodeGen.weave_one(PointcutCodeGen.java:359)
> at abc.weaving.weaver.PointcutCodeGen.weaveInAspectsPass(PointcutCodeGen.java:109)
> at abc.weaving.weaver.Weaver.weaveAdvice(Weaver.java:413)
> at abc.weaving.weaver.Weaver.weave(Weaver.java:277)
> at abc.ja.CompileSequence.weave(CompileSequence.java:293)
> at abc.main.CompileSequence.runSequence(CompileSequence.java:94)
> ... 2 more
>
> Any idea?
> g
>
> On Thu, Mar 13, 2008 at 10:59 AM, Pavel Avgustinov
>
>
> <pavel.avgustinov_at_magd.ox.ac.uk> wrote:
> > Hi Guillaume,
> >
> > We've now tracked this down, and the latest abc HEAD should be able to process
> > AJHotDraw correctly.
> >
> > Note that (as discussed on this list a few days ago) there is an occurrence of
> > around advice with a boolean return type applying to void joinpoints; abc
> > marks this as an error while ajc doesn't check it since the associated
> > pointcuts contain a conjunct of 'if(false)'. To simplify matters, we have
> > added a debug flag to avoid generating (and hence checking) advice with
> > statically false pointcuts. Thus, you will need to add "-debug
> > lazyAdviceGeneration" to your command-line before AJHotDraw compiles without
> > errors.
> >
> > Hope this helps,
> > - Pavel (also on behalf of Torbjörn and Julian)
> >
> >
> >
> > On Wednesday 12 March 2008 12:29:33 Guillaume Pothier wrote:
> > > Hi, I tried with rev 4924 (latest at the time I updated), and now I
> > > don't get any error, but... I started the compilation about 15 minutes
> > > ago and it still doesn't say anything... I guess that is not normal,
> > > or is it?
> > > g
> > >
> > > On Thu, Mar 13, 2008 at 6:37 AM, Pavel Avgustinov
> > >
> > > <pavel.avgustinov_at_magd.ox.ac.uk> wrote:
> > > > Hi Guillaume,
> > > >
> > > > Thank you very much for reporting this. Could you try abc revision 4921
> > > > or later? Torbjörn has committed a fix to the way location information is
> > > > computed, which will hopefully resolve this problem.
> > > >
> > > > Many thanks,
> > > > - Pavel
> > > >
> > > > On Wednesday 12 March 2008 02:31:39 Guillaume Pothier wrote:
> > > > > Hi,
> > > > > I'm having this error while compiling AJHotDraw (HEAD) with abc-ja
> > > > > (HEAD):
> > > > >
> > > > > Unexpected error of kind java.lang.NullPointerException
> > > > > Exception in thread "main" polyglot.util.InternalCompilerError:
> > > > > unhandled exception during compilation
> > > > > at abc.main.CompileSequence.runSequence(CompileSequence.java:89)
> > > > > at abc.main.Main.run(Main.java:487)
> > > > > at abc.main.Main.main(Main.java:144)
> > > > > Caused by: java.lang.IllegalArgumentException: Polyglot usage error:
> > > > > /home/gpothier/eclipse/workbench-3.1/AJHotDraw-cvs/src/aspects/org/jho
> > > > >tdraw /ccconcerns/commands/CommandObserver.aj: null
> >
> > > > > at abc.ja.CompileSequence.compile(CompileSequence.java:176)
> > > > > at abc.main.CompileSequence.runSequence(CompileSequence.java:79)
> > > > > ... 2 more
> > > > > Caused by: java.lang.Error:
> > > > > /home/gpothier/eclipse/workbench-3.1/AJHotDraw-cvs/src/aspects/org/jho
> > > > >tdraw /ccconcerns/commands/CommandObserver.aj: null
> >
> > > > > at abc.ja.jrag.PathPart.getCompilationUnit(PathPart.java:145)
> > > > > at
> > > > > abc.ja.jrag.FileNamesPart.addSourceFile(FileNamesPart.java:64) at
> > > > > abc.ja.jrag.Program.addSourceFile(Program.java:124)
> > > > > at abc.ja.CompileSequence.compile(CompileSequence.java:118)
> > > > > ... 3 more
> > > > > Caused by: java.lang.NullPointerException
> > > > > at
> > > > > abc.ja.jrag.IntertypeMethodDecl.Define_SimpleSet_lookupType(IntertypeM
> > > > >ethod Decl.java:960) at
> >
> > > > > abc.ja.jrag.AbstractDot.Define_SimpleSet_lookupType(AbstractDot.java:5
> > > > >40) at abc.ja.jrag.Expr.lookupType(Expr.java:746)
> >
> >
> > > > > at
> > > > > abc.ja.jrag.PackageOrTypeAccess.rewriteRule0(PackageOrTypeAccess.java:
> > > > >191) at
> > > > > abc.ja.jrag.PackageOrTypeAccess.rewriteTo(PackageOrTypeAccess.java:180
> > > > >) at abc.ja.jrag.ASTNode.getChild(ASTNode.java:836)
> > > > > at abc.ja.jrag.ASTNode.getChild(ASTNode.java:817)
> > > > > at abc.ja.jrag.Dot.getLeft(Dot.java:117)
> > > > > at
> > > > > abc.ja.jrag.AbstractDot.leftSide_compute(AbstractDot.java:341) at
> > > > > abc.ja.jrag.AbstractDot.leftSide(AbstractDot.java:337) at
> > > > > abc.ja.jrag.Dot.rewriteTo(Dot.java:148)
> > > > > at abc.ja.jrag.ASTNode.getChild(ASTNode.java:836)
> > > > > at abc.ja.jrag.ASTNode.getChild(ASTNode.java:817)
> > > > > at
> > > > > abc.ja.jrag.MethodDecl.lineNumber_compute(MethodDecl.java:804) at
> > > > > abc.ja.jrag.MethodDecl.lineNumber(MethodDecl.java:798) at
> > > > > abc.ja.parse.JavaParser.invokeReduceAction(JavaParser.java:4139) at
> > > > > beaver.Parser.reduce(Parser.java:539)
> > > > > at beaver.Parser.parse(Parser.java:447)
> > > > > at beaver.Parser.parse(Parser.java:407)
> > > > > at abc.ja.parse.JavaParser.parse(JavaParser.java:903)
> > > > > at abc.ja.CompileSequence$1.parse(CompileSequence.java:94)
> > > > > at abc.ja.jrag.PathPart.getCompilationUnit(PathPart.java:132)
> > > > > ... 6 more
> > > > >
> > > > >
> > > > > Any idea what this means? What additional information should I
> > > > > provide?
> > > > >
> > > > > Regards,
> > > > > g
> >
> >
> >
> >
>
Received on Thu Mar 13 2008 - 21:51:57 GMT

This archive was generated by hypermail 2.2.0 : Thu Mar 13 2008 - 22:30:12 GMT