Community
Participate
Working Groups
Build Identifier: java.lang.NegativeArraySizeException at org.aspectj.util.FileUtil.readStringArray(FileUtil.java:1070) at org.aspectj.weaver.patterns.WildTypePattern.readTypePattern150(WildTypePattern.java:1359) at org.aspectj.weaver.patterns.WildTypePattern.read(WildTypePattern.java:1338) at org.aspectj.weaver.patterns.TypePattern.read(TypePattern.java:308) at org.aspectj.weaver.patterns.WildAnnotationTypePattern.read(WildAnnotationTypePattern.java:331 ... Job.run(AutoBuildJob.java:242) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Compile error: NegativeArraySizeException thrown: null Reproducible: Sometimes
Are you doing a straightforward compile all from source, or are you binary weaving? Can you give me an idea of the kinds of pointcut you are using?
(In reply to comment #1) > Are you doing a straightforward compile all from source, or are you binary > weaving? Can you give me an idea of the kinds of pointcut you are using? Yes, it is a straightforward compile all from source. We're using SpringSource ToolSuite >= 2.5 in conjunction with Java 1.6.0_22, JAX WS (Metro) 2.1.7 and Maven 3.0.1, etc.
Created attachment 186927 [details] Error log from Helios SR 1
I can reproduce now this kind of error every time i synchronize first at all and afterwards want update incoming sources Eclipse want to build the workspace. 'Build automatically' is active. For reproducing this i have picked Eclipse 3.6 and STS 2.5.2 and all the plugins we are using an completed our kind of IDE. It was interesting to see, that the system is searching for some xml files that can't be found. The prefix is null! Please refer to the attachment. I think the error log can help to limit this problem maybe.
Even I get rid of 3rd party checkstyle-plugin Eclipse is throwing NegativeArrayException some times.
(In reply to comment #1) > Are you doing a straightforward compile all from source, or are you binary > weaving? Can you give me an idea of the kinds of pointcut you are using? Hi Andy, as far as i know it was straightforward compile but the last time i've discovered that AspectJ is doing compile time weaving. This seems like binary weaving. As you need a hint which kind of pointcuts are concerned I've discovered today that there are execution pointcuts on methods. One aspect in our application is to trace all exceptions which are thrown by our application. I hope this would be helpful to you Best regards Ünhan
(In reply to comment #6) > (In reply to comment #1) > > Are you doing a straightforward compile all from source, or are you binary > > weaving? Can you give me an idea of the kinds of pointcut you are using? > > Hi Andy, > > as far as i know it was straightforward compile but the last time i've > discovered that AspectJ is doing compile time weaving. This seems like binary > weaving. As you need a hint which kind of pointcuts are concerned I've > discovered today that there are execution pointcuts on methods. One aspect in > our application is to trace all exceptions which are thrown by our application. > I hope this would be helpful to you > > Best regards > Ünhan The other aspect concern validation of public method and constructor parameter calls.
Is there any way you can share some code with me? (can be privately, doesn't have to be through bugzilla) - I really want to fix this but if I can't recreate it then I'll have serious difficulty determining the cause. It is related to the serialized form of the aspect, but I would need to see the full text of the pointcuts involved in order to determine the problem.
(In reply to comment #8) > Is there any way you can share some code with me? (can be privately, doesn't > have to be through bugzilla) - I really want to fix this but if I can't > recreate it then I'll have serious difficulty determining the cause. It is > related to the serialized form of the aspect, but I would need to see the full > text of the pointcuts involved in order to determine the problem. Hello Andy, this would be a great help. We appreciate this offer and i understand you from developers point of view. Therefore i want to send you 2 aspects in hope that we can fix this. Additionally i want to mention that not only XP is concerned, even Windows 7 systems are concerned with this kind of bug. I'll send you an email. Should i send this 2 your gmail account? Kindly regards Ünhan
gmail account is fine, thanks!
Done ,-) Not 4 all
I have the sources now and the patterns of interest are like this: execution(*.new(.., @foo.bar.* (*), ..)) The interesting bit of the stack trace, pulled from the log is: ava.lang.NegativeArraySizeException at org.aspectj.util.FileUtil.readStringArray(FileUtil.java:1070) at org.aspectj.weaver.patterns.WildTypePattern.readTypePattern150(WildTypePattern.java:1359) at org.aspectj.weaver.patterns.WildTypePattern.read(WildTypePattern.java:1338) at org.aspectj.weaver.patterns.TypePattern.read(TypePattern.java:308) at org.aspectj.weaver.patterns.WildAnnotationTypePattern.read(WildAnnotationTypePattern.java:331) at org.aspectj.weaver.patterns.AnnotationTypePattern.read(AnnotationTypePattern.java:91) at org.aspectj.weaver.patterns.AnyWithAnnotationTypePattern.read(AnyWithAnnotationTypePattern.java:100) at org.aspectj.weaver.patterns.TypePattern.read(TypePattern.java:326) at org.aspectj.weaver.patterns.TypePatternList.read(TypePatternList.java:492) at org.aspectj.weaver.patterns.SignaturePattern.read(SignaturePattern.java:912) at org.aspectj.weaver.patterns.KindedPointcut.read(KindedPointcut.java:335) So we can see it is reading a signature pattern when things go wrong and from the line number it is reading the type pattern list for the parameters in the pointcut. The 'AnyWithAnnotationTypePattern' suggests it is reading the middle parameter: '@foo.bar.* (*)'. It seems sheer fluke that, given all the kinds of data that are being written out (bytes/strings/booleans/etc) the point when it reads the incorrect data from the stream just happens to be looking for the type of object that is there. An integer. The string arrays that area written out are preceeded by their length - 0 if there are no entries. The crash occurs because when reading the array back in we read a -1. What is interesting is that just before the string array in the stream is a type pattern list for any relevant type parameters. of course there are 0 of those in this case. However, a recent change (in 1.6.9) was whether the serialized form of a type pattern list included a source location. Up to 1.6.9 it did, after 1.6.9 it did not. The first entry in a serialized source location is the start position - and for a situation where there are 0 type parameters, the start position will be -1... Could that be the -1 being read? The question then might be, how did the -1 get into the output stream if 1.6.9 or later won't be writing it out.
Under bug 335682 I might have solved this, please grab an AJDT dev build: http://download.eclipse.org/tools/ajdt/36/dev/update
Hi Andy, I'll verify this until Monday Until now it seems good ,-) Thank u Ünhan
(In reply to comment #14) > Hi Andy, > > I'll verify this until Monday > Until now it seems good ,-) > > Thank u > Ünhan No problems registered since i've updated *THUMS_UP*
thanks for confirming the fix