Bug 256897 - AbortException while processing classfile generated from Scala source
Summary: AbortException while processing classfile generated from Scala source
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-28 09:22 EST by Miles Sabin CLA
Modified: 2009-02-24 17:56 EST (History)
3 users (show)

See Also:


Attachments
Failing classfile (6.96 KB, application/octet-stream)
2008-11-28 09:22 EST, Miles Sabin CLA
no flags Details
Corresponding stacktrace (32.97 KB, text/plain)
2008-11-28 09:23 EST, Miles Sabin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miles Sabin CLA 2008-11-28 09:22:09 EST
The attached classfile caused the attached stacktrace during load time weaving via Equinox Aspects. Note that the Scala bundle doesn't directly use aspects (it uses org.eclipse.contribution.weaving.jdt) and no advice applies to it.

I could provide (non-minimal) source but I suspect that the binary is more useful. I someone can tell me what bytecode construct is causing the weaver grief I should be able to put together minimal Scala source which reproduces the problem.
Comment 1 Miles Sabin CLA 2008-11-28 09:22:56 EST
Created attachment 119000 [details]
Failing classfile
Comment 2 Miles Sabin CLA 2008-11-28 09:23:22 EST
Created attachment 119001 [details]
Corresponding stacktrace
Comment 3 Andrew Eisenberg CLA 2008-11-28 12:26:07 EST
Adding Martin to the CC because this may also be equinox aspects related.
Comment 4 Andrew Clement CLA 2008-11-28 14:10:32 EST
Seem to be 3 issues here:

1. Should the scala class have even been passed to the weaver.  I don't think equinox aspects is providing enough control over which bundles get a weaver and which aspects apply to that bundle.  (But there is another open bug already discussing the scope of bundle weaving)

2. The real message is swallowed when the AbortException is constructed so I can't see what was wrong with the bytecode to prevent it being handled by AspectJ correctly.

3. AspectJ doesn't like something in that bytecode.  I can't seem to cause the failure locally by weaving a dumb aspect into the attached .class file.  Not sure if that is due to an older version of AspectJ being used when it fails, or something else.

I presume the pointcuts used in the org.eclipse.contribution.weaving.jdt bundle use within() to limit the matching scope?  And not just a targeted execution() ?
Comment 5 Andrew Eisenberg CLA 2008-11-28 17:29:12 EST
To get around this problem, try using import-package instead of require-bundle for the jdt weaving plugin.
Comment 6 Andrew Eisenberg CLA 2008-11-28 17:32:54 EST
(In reply to comment #4)
> I presume the pointcuts used in the org.eclipse.contribution.weaving.jdt bundle
> use within() to limit the matching scope?  And not just a targeted execution()
> ?

Not doing that.  Thought that using execution would be enough to limit scope.  If it would make weaving faster (and safer), I will.
Comment 7 Andrew Clement CLA 2008-11-28 18:23:20 EST
execution() will limit scope to just the particular methods but it is not as efficient in terms of evaluation as a within() pointcut for dismissing types we don't need to touch.
Comment 8 Andrew Clement CLA 2009-02-24 17:56:34 EST
downgrading urgency because appropriate usage of equinox aspects means the scala code doesn't need to be woven by AspectJ.