Bug 125101 - StackOverFlow in ReferenceType.isAssignableFrom()
Summary: StackOverFlow in ReferenceType.isAssignableFrom()
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-24 19:40 EST by Eric Bodden CLA
Modified: 2006-01-31 09:20 EST (History)
0 users

See Also:


Attachments
the output generated by ajc (40.00 KB, application/octet-stream)
2006-01-24 19:41 EST, Eric Bodden CLA
no flags Details
the jar I weave into (83.84 KB, application/octet-stream)
2006-01-24 19:42 EST, Eric Bodden CLA
no flags Details
this contains the jar I weave into and all dependencies (I hope) (721.92 KB, application/zip)
2006-01-24 19:47 EST, Eric Bodden CLA
no flags Details
still found this aj core dump (49.50 KB, application/x-gzip)
2006-01-24 20:59 EST, Eric Bodden CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Bodden CLA 2006-01-24 19:40:36 EST
Hi.

I am weaving two aspects into a jar file "jar-to-jar". ajc 1.5.0 gives me a huge error message (see attachement). Would be great if I could get any recommendations on this.

Thanks!
Eric
Comment 1 Eric Bodden CLA 2006-01-24 19:41:40 EST
Created attachment 33558 [details]
the output generated by ajc

first 4 lines might be caused by the javac compilation that happens before and builds the jar (not to confuse you)
Comment 2 Eric Bodden CLA 2006-01-24 19:42:40 EST
Created attachment 33559 [details]
the jar I weave into
Comment 3 Eric Bodden CLA 2006-01-24 19:46:39 EST
Comment on attachment 33559 [details]
the jar I weave into

I will replace this...
Comment 4 Eric Bodden CLA 2006-01-24 19:47:26 EST
Created attachment 33560 [details]
this contains the jar I weave into and all dependencies (I hope)
Comment 5 Eric Bodden CLA 2006-01-24 19:48:11 EST
The commandline I use:

ajc -sourceroots "/home/user/ebodde/bin/sabs/install/benchmarks/Java/jlo-rt/aspects:/home/user/ebodde/bin/sabs/install/benchmarks/Java/jlo-rt/perf-tests" -classpath "/home/user/ebodde/bin/sabs/install/benchmarks/Java/jlo-rt/util/jasminclasses-2.2.2.jar:${CLASSPATH}:/home/user/ebodde/bin/sabs/local/system/temp/Java/jlo-rt/jlo-rt.jar:/home/user/ebodde/bin/sabs/install/benchmarks/Java/jlo-rt/lib/junit.jar:/home/user/ebodde/bin/sabs/install/benchmarks/Java/jlo-rt/lib/commons-collections-3.1.jar" -injars "/home/user/ebodde/bin/sabs/local/system/temp/Java/jlo-rt/jlo-rt.jar" -outjar "/home/user/ebodde/bin/sabs/local/system/temp/Java/jlo-rt/jlo-rt-instr.jar"

So - last mail for today. I promise :-)
Comment 6 Eric Bodden CLA 2006-01-24 20:59:41 EST
Created attachment 33566 [details]
still found this aj core dump
Comment 7 Andrew Clement CLA 2006-01-25 10:36:08 EST
It appears java.util.Collection is coming into the system as a 'simple' type - neither in its generic form or raw form - so it gets put into the typemap as a simple type.  this gets us horribly confused later when we are working with a subclass of it that treats it as raw.

(thanks for the code - I was able to recreate it here...)
Comment 8 Eric Bodden CLA 2006-01-25 11:47:35 EST
thanks for finding that out so quickly. could you please let me know ASAP when a fix is available - we are doing some benchmarks on AJ compilers and it would be a pity ajc not being one of them. Thanks!
Comment 9 Andrew Clement CLA 2006-01-25 11:50:04 EST
do you have to use a 1.5 VM for this? If you use an earlier one with a non-generic form of Collection in it, it will probably work.
Comment 10 Andrew Clement CLA 2006-01-25 12:06:13 EST
or ... compile with the -1.5 flag - but I suspect that will affect performance numbers you collect as we have more type analysis to do. 
Comment 11 Eric Bodden CLA 2006-01-25 12:28:46 EST
Oh great, that worked! We are testing the runtime performance of the generated code, so that should be fine. I thought -1.5 would be a default option (at least if you encounter Java 5 code) ...
Comment 12 Andrew Clement CLA 2006-01-25 12:36:21 EST
fix checked in for the problem.

-1.5 is not default unless LTW.
Comment 13 Andrew Clement CLA 2006-01-26 03:34:31 EST
build failed to upload last night, should be there a little later this morning.  Anyway, the real problem here was processing code built with 1.5 when running ajc in 1.4 mode.  We didn't do the right thing and attempted to create raw types rather than simple types in the weaver where the compiler had done the right thing and created simple types.  Basically the fix was to put a check in our weaver to only build raw types if the system was running in 1.5 mode.
Comment 14 Andrew Clement CLA 2006-01-31 09:20:55 EST
fix available.