Bug 324767 - Compile error: NullPointerException thrown
Summary: Compile error: NullPointerException thrown
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.9   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-08 12:29 EDT by Jesse Englert CLA
Modified: 2010-09-09 13:59 EDT (History)
2 users (show)

See Also:


Attachments
JVM Error Log (16.87 KB, application/octet-stream)
2010-09-08 18:45 EDT, Jesse Englert CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Englert CLA 2010-09-08 12:29:50 EDT
Build Identifier: I20100608-0911

I was editing and saving an Aspect file when Eclipse crashed and quit. Here's the event details from the last error in the log before the crash:

eclipse.buildId=I20100608-0911
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product


Error
Tue Sep 07 18:30:32 PDT 2010
Compile error: NullPointerException thrown: null

java.lang.NullPointerException
at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.buildInterTypeAndPerClause(AjLookupEnvironment.java:546)
at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.collectAllITDsAndDeclares(AjLookupEnvironment.java:382)
at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.completeTypeBindings(AjLookupEnvironment.java:202)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:616)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:357)
at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:371)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:1019)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:268)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.batchBuild(AjBuildManager.java:181)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:316)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:185)
at org.aspectj.ajde.core.internal.AjdeCoreBuildManager.performBuild(AjdeCoreBuildManager.java:127)
at org.aspectj.ajde.core.AjCompiler.build(AjCompiler.java:88)
at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:245)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:317)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


Reproducible: Didn't try
Comment 1 Andrew Eisenberg CLA 2010-09-08 12:36:25 EDT
An AspectJ bug by the looks of it.

You say that this bug caused Eclipse itself to quit?  Do you have anything on the command line for that?

This kind of bug doesn't usually cause Eclipse to shut down, unless there is an out of memory error involved in the mix.  I'd recommend bumping up your heap size and perm gen size, which you can do by adding something like this to your eclipse.ini:
   
   -vmargs 
   -Xmx768M 
   -XX:PermSize=64M 
-XX:MaxP
ermSize=256M
Comment 2 Jesse Englert CLA 2010-09-08 12:41:13 EDT
My eclipse.ini file has the following VM args:

-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms1024m
-Xmx1024m
-Xss2m
-XX:MaxPermSize=256m
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UnlockExperimentalVMOptions
-XX:+UseG1GC

I can't be sure that this is what caused Eclipse to crash. It was just the last error in the Error Log.
Comment 3 Jesse Englert CLA 2010-09-08 13:01:15 EDT
Not sure if this is relevant but the crash happened while I was editing a before() advice that affects all JComponent methods (including subclasses) on a large Swing project. This Aspect does slow down my build quite a bit especially with the Cross References view open, and uses a lot of heap space so maybe it was an OOM.
Comment 4 Jesse Englert CLA 2010-09-08 18:45:14 EDT
Created attachment 178464 [details]
JVM Error Log

Attaching the JVM error log for posterity. I don't see anything related to AspectJ or AJDT though.
Comment 5 Andrew Clement CLA 2010-09-09 13:59:08 EDT
The null indicates a sourcetypebinding was being examined (looking at its membertypes) before the membertypes have been set.  Even if the aspect has no member types the array should be initialized to an empty array constant before it is first referenced.

I've put in a guard with a message to the console when this occurs.