Bug 270998 - BCException when load-time weaving clone()
Summary: BCException when load-time weaving clone()
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: 1.6.3   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-02 12:09 EDT by Jochen Wuttke CLA
Modified: 2013-06-24 11:04 EDT (History)
1 user (show)

See Also:


Attachments
Aspect to reproduce exception (1.58 KB, text/plain)
2009-04-02 12:09 EDT, Jochen Wuttke CLA
no flags Details
ajcore dump (150.27 KB, text/plain)
2009-04-02 12:10 EDT, Jochen Wuttke CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jochen Wuttke CLA 2009-04-02 12:09:57 EDT
Created attachment 130718 [details]
Aspect to reproduce exception

Build ID: M20090211-1700

Steps To Reproduce:
1. LTW the attached aspect against Tomcat
2. The exception will occur during Tomcat startup.



More information:
After a tip from Andy I tried to explicitly exclude clone() from weaving, but my naive approach (see attached aspect) did not resolve the problem.
Comment 1 Jochen Wuttke CLA 2009-04-02 12:10:34 EDT
Created attachment 130719 [details]
ajcore dump
Comment 2 Jochen Wuttke CLA 2009-04-03 05:31:53 EDT
I've dug a little deeper into this and it looks like the exception happens when the weaver processes calls to clone(). What I find strange is that this happens in classes that don't match the pointcut at all (I would assume that call(* javax.servlet.jsp.PageContext.*(..)) would preclude all weaving to method calls that are not part of a subclass of PageContext ?!)
Comment 3 Jochen Wuttke CLA 2009-04-04 10:30:56 EDT
After some more experimentation I figured out that the part that is causing the problem is 

call(* javax.servlet.jsp.PageContext.*(..))

Even with this minimal pointcut (which I believe can be determined statically) LTW gives the BC exception.
Comment 4 Andrew Clement CLA 2009-04-30 16:52:21 EDT
can you tell me where to get the jar that I can weave that pointcut against which will show the failure.  I don't really want to setup tomcat, I just want to weave against a jar and see the failure.
Comment 5 Jochen Wuttke CLA 2009-05-01 07:34:23 EDT
You can download the binary distro from:
http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.9/bin/apache-tomcat-6.0.9.zip 

You'll have to set x permissions on all shell-scripts in the bin directory, and then you'll have to fix "setclasspath.sh" to set the classpath properly for using LTW, but that should be it.
The behavior I observed while trying this is a little odd, because when I start the server, I get no weaving messages whatsoever, but when I call shutdown, I get all the weaving and the errors. Probably a logging problem, but just so you know what to expect.
Comment 6 Andrew Clement CLA 2013-06-24 11:04:04 EDT
unsetting the target field which is currently set for something already released