Bug 341926 - Internal compiler error java.lang.StackOverflowError
Summary: Internal compiler error java.lang.StackOverflowError
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-05 10:51 EDT by Michael Neifeld CLA
Modified: 2013-06-24 11:02 EDT (History)
1 user (show)

See Also:


Attachments
compiler core 1 (438.04 KB, text/plain)
2011-04-05 10:59 EDT, Michael Neifeld CLA
no flags Details
core dump 2 (434.69 KB, text/plain)
2011-04-05 11:00 EDT, Michael Neifeld CLA
no flags Details
new core dump (429.96 KB, text/plain)
2011-04-07 09:51 EDT, Michael Neifeld CLA
no flags Details
Output (1.54 MB, text/plain)
2011-04-07 09:52 EDT, Michael Neifeld CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Neifeld CLA 2011-04-05 10:51:27 EDT
Build Identifier: org.aspectj:aspectjrt:1.6.10 and org.aspectj:aspectjweaver:1.6.10

We have tree with many Maven projects.When compiler compiles project with more than 1500 classes it's crashed with SOE, a smaller project within the tree passed successfully.

Reproducible: Always
Comment 1 Michael Neifeld CLA 2011-04-05 10:59:43 EDT
Created attachment 192565 [details]
compiler core 1
Comment 2 Michael Neifeld CLA 2011-04-05 11:00:29 EDT
Created attachment 192566 [details]
core dump 2
Comment 3 Andrew Clement CLA 2011-04-05 12:31:56 EDT
This is likely to be happening due to the type discarding that can happen when building large projects - some types are discarded in order to free up memory, the types are brought back again later if required.  When being brought back it looks like they are being incorrectly created - and in this case the raw form of a type is pointing to itself when it should be pointing to the generic form.

I've put in a guard to prevent the recursion.  I've also put in some diagnostics to try to pin down who is building the bad type - this will manifest as an exception trace but it won't stop compilation.  If you want to try this build (it would be great if you could, to collect some diagnostics), then use our maven repo for snapshots:

<repository>
    <id>maven.springframework.org</id>
    <name>SpringSource snapshots</name>
    <url>http://maven.springframework.org/snapshot</url>
</repository>

The AspectJ version tag is 1.6.12.BUILD-SNAPSHOT in that repo.
Comment 4 Michael Neifeld CLA 2011-04-07 09:49:17 EDT
I've try it, but it didn't helped. But I've found workaround for this - it seems like AspectJ Compiler passes out if it can't find sources in src directory or test directory. It looks like it try compile all classes again for test-classes target directory.
More over, I've found it crashes at any simple problem and don't have option to ignore problem.

I've attached new core dump and output for the build with recommended artifact.

Here also copy&paste from another log (with workaround):

[INFO] ------------------------------------------------------------------------
[INFO] Building BL
[INFO]    task-segment: [deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: auto-clean}]
[INFO] Deleting directory M:\MiBAS_v17.0_hudson_view_nightly\MiBAS\BL\target
[INFO] Deleting file-set: ./target (included: [**/*.*], excluded: [])
[INFO] Preparing source:jar
[WARNING] Removing: jar from forked lifecycle, to prevent recursive invocation.
[INFO] [clean:clean {execution: auto-clean}]
[INFO] Deleting file-set: ./target (included: [**/*.*], excluded: [])
[INFO] [source:jar {execution: attach-sources}]
[INFO] Building jar: M:\MiBAS_v17.0_hudson_view_nightly\MiBAS\BL\target\BL-17.0-sources.jar
[INFO] [buildnumber:create {execution: create-counter}]
[INFO] Storing buildNumber: 551 at timestamp: 1302162488673
[INFO] [buildnumber:create {execution: create-date}]
[INFO] Storing buildNumber: 2011-04-07 at timestamp: 1302162488673
[INFO] [buildnumber:create {execution: mibas.label}]
[INFO] Storing buildNumber: MiBAS-v17.0-552-2011-04-07 at timestamp: 1302162488673
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1534 source files to M:\MiBAS_v17.0_hudson_view_nightly\MiBAS\BL\target\classes
[INFO] [aspectj:compile {execution: default}]
[ERROR] unrecognized single argument: "-noImportError"
[ERROR] no sources specified
[ERROR] AspectJ Compiler 1.6.9

	Usage: <options> <source file | @argfile>..

AspectJ-specific options:
	-inpath <list>      use classes in dirs and jars/zips in <list> as source
	                    (<list> uses platform-specific path delimiter)
	-injars <jarList>   use classes in <jarList> zip files as source
	                    (<jarList> uses classpath delimiter)
	                    deprecated - use inpath instead.
	-aspectpath <list>  weave aspects in .class files from <list> dirs and jars/zip into sources
	                    (<list> uses classpath delimiter)
	-outjar <file>      put output classes in zip file <file>
	-outxml             generate META-INF/aop.xml
	-outxmlfile <file>  specify alternate destination output of -outxml
	-argfile <file>     specify line-delimited list of source files
	-showWeaveInfo      display information about weaving
	-incremental        continuously-running compiler, needs -sourceroots
	                    (reads stdin: enter to recompile and 'q' to quit)
	-sourceroots <dirs> compile all .aj and .java files in <dirs>
	                    (<dirs> uses classpath delimiter)
	-crossrefs          generate .ajsym file into the output directory
	-emacssym           generate .ajesym symbol files for emacs support
	-Xlint              same as '-Xlint:warning'
	-Xlint:<level>      set default level for crosscutting messages
	                    (<level> may be ignore, warning, or error)
	-Xlintfile <file>   specify properties file to set per-message levels
	                    (cf org/aspectj/weaver/XlintDefault.properties)
	-X                  print help on non-standard options

Standard Eclipse compiler options:
 Options enabled by default are prefixed with '+'
 
 Classpath options:
    -cp -classpath <directories and zip/jar files separated by ;>
                       specify location for application classes and sources
    -bootclasspath <directories and zip/jar files separated by ;>
                       specify location for system classes
    -d <dir>           destination directory (if omitted, no directory is created)
    -d none            generate no .class files
    -encoding <enc>    specify custom encoding for all sources. Each file/directory can override it
                       when suffixed with '['<enc>']' (e.g. X.java[utf8])
 
 Compliance options:
    -1.3               use 1.3 compliance level (implicit -source 1.3 -target 1.1)
    -1.4             + use 1.4 compliance level
    -1.5               use 1.5 compliance level
    -1.6               use 1.6 compliance level
    -source <version>  set source level (1.3, 1.4, 1.5 or 1.6)
    -target <version>  set classfile target (1.1 to 1.4)
 
 Warning options:
    -deprecation     + deprecation outside deprecated code
    -nowarn            disable all warnings except xlint or declare warning
    -warn:none         disable all warnings except xlint or declare warning
    -warn:<warnings separated by ,>    enable exactly the listed warnings
    -warn:+<warnings separated by ,>   enable additional warnings
    -warn:-<warnings separated by ,>   disable specific warnings
      allDeprecation       deprecation including inside deprecated code
      allJavadoc           invalid or missing javadoc
      assertIdentifier   + 'assert' used as identifier
      charConcat         + char[] in String concat
      conditionAssign      possible accidental boolean assignment
      constructorName    + method with constructor name
      deprecation        + deprecation outside deprecated code
      emptyBlock           undocumented empty block
      fieldHiding          field hiding another variable
      finally            + finally block not completing normally
      indirectStatic       indirect reference to static member
      intfNonInherited   + interface non-inherited method compatibility
      javadoc              invalid javadoc
      localHiding          local variable hiding another variable
      maskedCatchBlock   + hidden catch block
      nls                  string literal lacking non-nls tag //$NON-NLS-<n>$
      noEffectAssign     + assignment without effect
      pkgDefaultMethod   + attempt to override package-default method
      semicolon            superfluous semicolon
      unqualifiedField     unqualified reference to field
      unusedImport       + unused import declaration
      unusedLocal          unread local variable
      unusedPrivate        unused private member declaration
      unusedThrown         unused declared thrown exception
      uselessTypeCheck     unnecessary cast/instanceof operation
      specialParamHiding   constructor or setter parameter hiding another field
      staticReceiver     + non-static reference to static member
      syntheticAccess      synthetic access for innerclass
      tasks(<tags separated by |>) tasks identified by tags inside comments
 
 Debug options:
    -g[:lines,vars,source] custom debug info
    -g:lines,source  + both lines table and source debug info
    -g                 all debug info
    -g:none            no debug info
    -preserveAllLocals preserve unused local vars for debug purpose
 
 Advanced options:
    -log <file>        log to a file
    -proceedOnError    do not stop at first error, dumping class files with problem methods
    -verbose           enable verbose output
    -referenceInfo     compute reference info
    -progress          show progress (only in -log mode)
    -time              display speed information 
    -noExit            do not call System.exit(n) at end of compilation (n==0 if no error)
    -repeat <n>        repeat compilation process <n> times for perf analysis
    @<file>            read command line arguments from file
 
    -? -help           print this help message
    -v -version        print compiler version
    -showversion       print compiler version and continue

[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Not compiling test sources
[INFO] [surefire:test]
[INFO] Tests are skipped.
[INFO] [jar:jar]
[INFO] Building jar: M:\MiBAS_v17.0_hudson_view_nightly\MiBAS\BL\target\BL-17.0.jar
Comment 5 Michael Neifeld CLA 2011-04-07 09:51:14 EDT
Created attachment 192739 [details]
new core dump
Comment 6 Michael Neifeld CLA 2011-04-07 09:52:29 EDT
Created attachment 192740 [details]
Output
Comment 7 Andrew Clement CLA 2011-04-12 12:13:21 EDT
Unfortunately that latest ajcore file seems to show the compile was still done with 1.6.10 and not my debug build, so the same problem did show up.

> AspectJ Compiler 1.6.10 built on Friday Oct 22, 2010 at 03:50:26 GMT

looks like the '-noImportError' isn't working for AspectJ - I've never used it myself and a quick check reveals no testcases, I've raised bug 342605 to cover that.

I don't quite understand the workaround:

> But I've found workaround for this - it seems like AspectJ Compiler 
> passes out if it can't find sources in src directory or test directory. 
> It looks like it try compile all classes again for test-classes target
> directory. More over, I've found it crashes at any simple problem 
> and don't have option to ignore problem.

is your workaround to try and compile pieces of the app rather than the whole thing in one go?  Why do you think it is trying to compile classes again?  In a regular maven build I'd expect a two stage compile (at least), the app code is built then the test-classes are built referring to the compiled app code through the classpath.
Comment 8 Michael Neifeld CLA 2011-04-27 03:36:17 EDT
Hi,
Sorry for such delay.
If you will look in output file you can found following lines:
[DEBUG] Configuring mojo 'org.codehaus.mojo:aspectj-maven-plugin:1.3.1:test-compile' -->
[DEBUG]   (s) argumentFileName = builddef.lst
[DEBUG]   (f) aspectDirectory = M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java
[DEBUG]   (f) basedir = M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL
[DEBUG]   (s) complianceLevel = 6.0
[DEBUG]   (f) forceAjcCompile = true
[DEBUG]   (f) project = MavenProject: com.mot.nsa:BL:17.0 @ M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\pom.xml
[DEBUG]   (s) showWeaveInfo = true
[DEBUG]   (s) source = 6.0
[DEBUG]   (s) target = 6.0
[DEBUG]   (f) testAspectDirectory = M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\test\java
[DEBUG]   (s) verbose = false
[DEBUG]   (f) weaveMainSourceFolder = true
[DEBUG]   (f) weaveWithAspectsInMainSourceFolder = true
[DEBUG] -- end configuration --
[INFO] [aspectj:test-compile {execution: default}]
[DEBUG] Adding -aspectpath: M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\target\classes
[DEBUG] Running : ajc -showWeaveInfo -source 6.0 -target 6.0 -classpath d:\maven_repository\com\mot\nsa\JUC\4.0\JUC-4.0.jar;d:\maven_repository\com\mot\nsa\JAC\3.0\JAC-3.0.jar;d:\maven_repository\com\mot\nsa\MM\4.0.0\MM-4.0.0.jar;d:\maven_repository\com\mot\nsa\LM\4.0\LM-4.0.jar;d:\maven_repository\com\mot\nsa\nsa-core-api\2.0\nsa-core-api-2.0.jar;d:\maven_repository\com\mot\nsa\av-ws-solinc-group1-api\17.0\av-ws-solinc-group1-api-17.0.jar;d:\maven_repository\com\mot\nsa\av-ws-solinc-group1-impl\17.0\av-ws-solinc-group1-impl-17.0.jar;d:\maven_repository\xerces\xercesImpl\2.9.1\xercesImpl-2.9.1.jar;d:\bea\wlserver_10.3\server\lib\ojdbc6.jar;d:\bea\wlserver_10.3\server\lib\wljmsclient.jar;d:\maven_repository\simple-jndi\simple-jndi\0.11.4.1\simple-jndi-0.11.4.1.jar;d:\maven_repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;d:\maven_repository\commons-dbcp\commons-dbcp\1.2.2\commons-dbcp-1.2.2.jar;d:\maven_repository\commons-pool\commons-pool\1.4\commons-pool-1.4.jar;d:\maven_repository\com\mot\nsa\CNA\1.0\CNA-1.0.jar;d:\maven_repository\commons-lang\commons-lang\2.4\commons-lang-2.4.jar;d:\maven_repository\org\aspectj\aspectjrt\1.6.12.BUILD-SNAPSHOT\aspectjrt-1.6.12.BUILD-SNAPSHOT.jar;d:\maven_repository\commons-io\commons-io\1.4\commons-io-1.4.jar;d:\maven_repository\log4j\log4j\1.2.15\log4j-1.2.15.jar;d:\maven_repository\javax\mail\mail\1.4.1\mail-1.4.1.jar;d:\maven_repository\javax\activation\activation\1.1\activation-1.1.jar;d:\maven_repository\com\sun\jdmk\jmxtools\1.2.1\jmxtools-1.2.1.jar;d:\maven_repository\com\sun\jmx\jmxri\1.2.1\jmxri-1.2.1.jar;d:\maven_repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar;d:\bea\wlserver_10.3\server\lib\wlclient.jar;d:\maven_repository\commons-dbutils\commons-dbutils\1.3\commons-dbutils-1.3.jar;d:\maven_repository\javax\jms\jms\1.1\jms-1.1.jar;d:\maven_repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;d:\maven_repository\com\sun\xml\messaging\saaj\saaj-impl\1.3.2\saaj-impl-1.3.2.jar;d:\maven_repository\javax\xml\soap\saaj-api\1.3\saaj-api-1.3.jar;d:\maven_repository\com\mot\nsa\nsa-core-impl\2.0\nsa-core-impl-2.0.jar;M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\target\test-classes;M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\target\classes -aspectpath M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\target\classes -d M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\target\test-classes M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\Account.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\AllocatedNumbers.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\BillingAttribute.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\BillingAttributeValue.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\Device.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\FolderRange.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\HandsetDef.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\HDR.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\IPKeyChoice.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\Service.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\ServiceProperty.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\Simcard.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\SIMCardAttributeDef.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\Subscriber.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\nsa\provisioning\model\subscriber\SubscriberKeyChoice.java 

...

M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\com\mot\nsa\logic\admin\LogMessageOperation.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\com\mot\nsa\logic\admin\AuditInquiriesOperations.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\com\mot\nsa\logic\br\BRDAO.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\com\mot\nsa\logic\br\Validator.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\com\mot\nsa\bl\common\DAO.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\com\mot\nsa\bl\billing\logic\qdp\QDPDAO.java M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\src\main\java\com\mot\nsa\bl\billing\logic\qdp\QDPOperations.java 
[DEBUG] Compiling and weaving 1534 sources to M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\target\test-classes
[DEBUG] Argumentsfile written : M:\bmn011_MiBAS_v17.0_dev_loc\MiBAS\BL\target\test-classesbuilddef.lst
[DEBUG] directory classpath entry does not exist: d:\java\jdk1.6.0_20\jre\lib\sunrsasign.jar
[DEBUG] zipfile classpath entry does not exist: d:\java\jdk1.6.0_20\jre\classes
[DEBUG] Pipelining compilation
[ERROR] Internal compiler error
java.lang.StackOverflowError
....
just before first error occured.
I don't know if it accidental, but this second attempt to compile same classes.
Comment 9 Andrew Clement CLA 2013-06-24 11:02:21 EDT
unsetting the target field which is currently set for something already released