Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] NullPointerException in org.aspectj.weaver.ReferenceType.getTypeVariables() - Aspectj 1.5.3

Hi Alejandro,

I've been browsing bugzilla to see if your problem has already been addressed.  I have fixed many things to do with null delegates but 1.5.3 is quite a while ago and i can't specifically remember a problem in getTypeVariables().  A null delegate is not something I can just guard against as it indicates some violation somewhere of a basic assumption made during compilation.  I wouldn't necessarily recommend moving to 1.5.4 as I don't know it is specifically fixed in that release - and if I were suggesting to upgrade to any release, i'd say go for 1.6.2 as it has about 200 other fixes since 1.5.4.  However, I can understand your situation with not necessarily wanting to upgrade right now.  I am happy to investigate this issue with you but will probably need to give you a debug version of 1.5.3 that includes extra debug around the failure.  If we simply know the reference type in question it may help us with the problem.

However, intermittent failures during the 1.5.3 release were typically down to the new pipeline compilation feature that had been added in that release.  The pipeline is only loosely defined to ensure aspects go first, other types follow in any order - and depending on the JVM and the machine, that order can vary.  You could try turning on the verbose mode for the ant task (or is it the debug mode, one of those!) and that should tell you the ordering with lots of 'compiled:' and 'woven:' messages.  If the pipeline is to blame then each time the failure occurs that ordering will be the same, and when there is no failure it will be different.  Or the pipeline can be turned off completely with X="-Xset:pipelineCompilation=false" in the Ant iajc call - but that will use much more memory as everything is compiled first then everything is woven.

Other times I've seen issues with delegates in those early generics supporting releases were when type bounds were arrays (eg. int[]) or were themselves other type variables.

let me know how you want to proceed, either on the list or via email.

cheers,
Andy.

2008/10/6 Alejandro Bascuas <alej@xxxxxxxxxx>

Hi,

We have a project that at build time performs binary weaving of aspects on class files produced by IBM Java (J2RE 1.5.0 IBM J9 2.3 Linux amd64-64). We're running AspectJ 1.5.3. Upgrading to 1.5.4 is an option, but would be more work than we'd rather do in the immediate future.


At a particular point in the build, we intermittently hit a NullPointerException in org.aspectj.weaver.ReferenceType:


    [iajc] info Pipelining compilation

    [iajc] info weaver operating in reweavable mode.  Need to verify any required types exist.

    [iajc] java.lang.NullPointerException

    [iajc]         at org.aspectj.weaver.ReferenceType.getTypeVariables(ReferenceType.java:555)

    [iajc]         at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.fixUpCircularDependencies(BcelGenericSignatureToTypeXConverter.java:257)

    [iajc]         at org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.classTypeSignature2TypeX(BcelGenericSignatureToTypeXConverter.java:47)

    [iajc]         at org.aspectj.weaver.bcel.BcelObjectType.ensureGenericSignatureUnpacked(BcelObjectType.java:685)

    [iajc]         at org.aspectj.weaver.bcel.BcelObjectType.getDeclaredInterfaces(BcelObjectType.java:201)

    [iajc]         at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:398)

    [iajc]         at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)

    [iajc]         at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1156)

    [iajc]         at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1158)

    [iajc]         at org.aspectj.weaver.ResolvedType.getInterTypeMungersIncludingSupers(ResolvedType.java:1135)

    [iajc]         at org.aspectj.weaver.ResolvedType.checkInterTypeMungers(ResolvedType.java:1202)

    [iajc]         at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1588)

    [iajc]         at org.aspectj.weaver.bcel.BcelWeaver.weaveWithoutDump(BcelWeaver.java:1563)

    [iajc]         at org.aspectj.weaver.bcel.BcelWeaver.weaveAndNotify(BcelWeaver.java:1341)

    [iajc]         at org.aspectj.weaver.bcel.BcelWeaver.weave(BcelWeaver.java:1161)


Looking at the source code, it is clear that the 'delegate' field is set to null. This problem doesn't occur all the time, but often enough to cause us concern. It happens on multiple build servers at seemingly random times. Our main build servers run 64bit Intel Xeon CPUs, with 4 GB of RAM, and SLES 10 SP1. To my knowledge no one has encountered this running an Ant build on a development workstation (32bit Windows).


Any help you can provide is greatly appreciated. We're looking to simply understand what the problem is so our paranoia can decrease and hopefully a workaround so that we don't see it again.


Thanks,


Alejandro Bascuas
Small-Medium Enterprise Platform Development
IBM - Rochester, MN

Dept: V2TA Bldg: 050-3 Office: H110
T/L 553-1962; Direct (507)253-1962
alej@xxxxxxxxxx

_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev



Back to the top