Bug 325158 - [comparator] IllegalArgumentException in comparitor's Signature.appendTypeSignature
Summary: [comparator] IllegalArgumentException in comparitor's Signature.appendTypeSig...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 3.7 M3   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-13 15:50 EDT by David Williams CLA
Modified: 2010-10-20 13:59 EDT (History)
5 users (show)

See Also:


Attachments
console log showing the exception (31.15 KB, text/plain)
2010-09-13 15:55 EDT, David Williams CLA
no flags Details
ant script used to invoke operation (just in case related) (1.37 KB, text/xml)
2010-09-13 15:57 EDT, David Williams CLA
no flags Details
one problematic jar, from WTP 3.2.2 release (826.12 KB, application/octet-stream)
2010-10-19 16:25 EDT, David Williams CLA
no flags Details
Proposed fix (1.31 KB, patch)
2010-10-20 10:09 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix (7.39 KB, patch)
2010-10-20 12:17 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2010-09-13 15:50:59 EDT
I'll attach full console log and ant script used to invoke it, 

but tried to use the "comparator" feature while doing a p2 mirror operation, but it fails with 

Caused by: java.lang.IllegalArgumentException
        at org.eclipse.equinox.p2.internal.repository.comparator.java.Signature.appendTypeSignature(Signature.java:815)


BTW, I tried with Java 5 and 6 (to run the code) and originally with 3.6 level code, but then moved up to M20100909 build, all with same result (except last case also threw segment fault, after the exception, which I assume is unrelated).
Comment 1 David Williams CLA 2010-09-13 15:55:48 EDT
Created attachment 178771 [details]
console log showing the exception
Comment 2 David Williams CLA 2010-09-13 15:57:56 EDT
Created attachment 178772 [details]
ant script used to invoke operation (just in case related)
Comment 3 David Williams CLA 2010-09-13 15:59:50 EDT
setting to major, since this basically prevents use of the function. 

Note, even if there is some error in our byte codes that cause this (which would be bad all by itself) there's no way to tell which bundle it is failing on). Maybe I'll try there -verbose flag.
Comment 4 David Williams CLA 2010-09-13 17:12:49 EDT
verbose did help diagnose the specific bundle involved. 

I said "mirroring ... org.eclipse.jpt.eclipselink.ui" right before the exception occurred. 

I ran again with that bundle excluded, and it ran to completion.  
<exclude>
  <artifact id="org.eclipse.jpt.eclipselink.ui" />
</exclude>
Comment 5 David Williams CLA 2010-09-13 17:18:09 EDT
Neil, added you for awareness, since involved org.eclipse.jpt.eclipselink.ui. 

At this point, I'm not sure if old (released) version that has the "odd" signature, or the new (about to be released) version, or both. In either case, there's no indication (from what I know right now) that there's anything "invalid" about it ... could be a real bug in comparator? as far as I know. 

So, awareness only at this point ... but, might not hurt to have someone peek at it? :)
Comment 6 David Williams CLA 2010-09-13 21:42:40 EDT
The first test was comparing WTP 3.2.1 to our about to be released 3.2.2. 

To expand the test, I tried our WTP 3.2.0 release (from June) compared to 3.2.1 (our July release) and had same problem with org.eclipse.jpt.eclipselink.ui. 

But then I tried WTP 3.2.0 vs. our 3.2.2 build, and the exception occurred on org.eclipse.jpt.ui (before it got to eclipselink.ui) ... very mysterious (to me).
Comment 7 Andrew Niefer CLA 2010-10-14 18:20:13 EDT
This is like bug 325311.

We will need to catch the exception and report a class format problem.

Also need to figure out if this is a real problem with the .class file, or a bug in the disassembler.

David can you get the original jars that caused both this and bug 325311?
Comment 8 David Williams CLA 2010-10-19 16:25:25 EDT
Created attachment 181221 [details]
one problematic jar, from WTP 3.2.2 release

This is one of the problematic jars, as far as I can tell. 

Hopefully you can find the needle in this haystack ... if not, I can try and reproduce the problem (stop excluding the jar) if that would help narrow down the specific class or something.
Comment 9 Andrew Niefer CLA 2010-10-19 17:02:56 EDT
The problem class file is 
org/eclipse/jpt/eclipselink/ui/internal/details/EclipseLinkConvertComposite$7.class
Comment 10 Olivier Thomann CLA 2010-10-19 18:17:42 EDT
I am investigating.
Comment 11 Olivier Thomann CLA 2010-10-20 09:21:24 EDT
This is a bug in the Signature class. I have a fix for it.
Comment 12 Olivier Thomann CLA 2010-10-20 10:09:12 EDT
Created attachment 181291 [details]
Proposed fix
Comment 13 Olivier Thomann CLA 2010-10-20 12:17:15 EDT
Created attachment 181311 [details]
Proposed fix

Improve previous patch to better handle corrupted .class files.
See bug 325311 for a case with a corrupted .class file.
Comment 14 Andrew Niefer CLA 2010-10-20 13:59:38 EDT
Patch released to head.  Thanks Olivier.