Bug 291300 - java.lang.IllegalStateException at org.aspectj.apache.bcel.generic.InstructionBranch.updatePosition(InstructionBranch.java:176)
Summary: java.lang.IllegalStateException at org.aspectj.apache.bcel.generic.Instructio...
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.5   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-04 17:04 EDT by yoav CLA
Modified: 2009-10-05 15:18 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yoav CLA 2009-10-04 17:04:34 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
Build Identifier:  20090920-1017

Stack trace:
java.lang.IllegalStateException
at org.aspectj.apache.bcel.generic.InstructionBranch.updatePosition(InstructionBranch.java:176)
at org.aspectj.apache.bcel.generic.BranchHandle.updatePosition(BranchHandle.java:92)
at org.aspectj.apache.bcel.generic.InstructionList.setPositions(InstructionList.java:934)
at org.aspectj.apache.bcel.generic.InstructionList.setPositions(InstructionList.java:858)
at org.aspectj.apache.bcel.generic.InstructionL ... ternal.jobs.Worker.run(Worker.java:55)

Error message:
Compile error: IllegalStateException thrown: Unable to pack method, jump (with opcode=153) is too far: 41164



Reproducible: Always

Steps to Reproduce:
1. Start Eclipse with: eclipse.exe -Xmx1024M
Without -Xmx1024M the compiler constantly runs out of heap memory.
2. Re-build project
Comment 1 Andrew Clement CLA 2009-10-05 12:21:13 EDT
I'm afraid this is a known limitation of AspectJ.  If you weave a big method and that causes it to become *too big* then we cannot cope.  Are you able to refactor the large method prior to weaving it?
Comment 2 yoav CLA 2009-10-05 13:22:10 EDT
Is there a way to tell which method is it?

Actually this is a project that I am porting from AspectJ 1.5.2 so it used to work. Is this a new limitation?

(In reply to comment #1)
> I'm afraid this is a known limitation of AspectJ.  If you weave a big method
> and that causes it to become *too big* then we cannot cope.  Are you able to
> refactor the large method prior to weaving it?
Comment 3 Andrew Clement CLA 2009-10-05 14:15:57 EDT
It is not a new limitation, it is a JVM spec thing - but it is possible that for 1.5.2 it either:
- wasn't policed (so produced broken bytecode that may never have actually been executed - or executed and worked by accident)
- is affected by some fixes to weaving that are now doing something more correctly but is taking up a little more space.

I suspect the former...

I'll look to improve diagnostics to include the method name.  unfortunately at the moment the problem is discovered at a very low level where the method is not known.  if you use -debug when building you may get an indication of the class name in which the problem method exists.
Comment 4 yoav CLA 2009-10-05 14:59:09 EDT
which is the big problematic method? the advice or the advised method described in the point cut?

This is not production code so I can't really verify it worked perfectly in version 1.5.2, but it did compile and some examples worked.
Comment 5 Andrew Clement CLA 2009-10-05 15:18:50 EDT
the problematic method will be the advised one - the addition of code to call the advise is making it too large (or rather making some of the jumps within it too far)