Failures in class verification of your MIDP library

"Mark Crocker" <[email protected]> Thu, 24 Apr 2003 18:22:00 -0400 (EDT)
Newsgroups gmane.comp.java.enhydra.kxml
Message-ID <[email protected]>
Sorry about the blank message yesterday.  Here's the question I tried to ask yesterday...

I have discovered a minor problem when attempting to verify several classes in an older version of the KXML library, which is used in several Midlets, such as the the "Reservas 0.0.1" Midlet that is available via midlet.org at http://midlet.org/category.jsp?parentLevel=303.  I am using the JustIce verifier, which is now a part of the Apache BCEL 5.0 package (available from http://jakarta.apache.org/bcel/).

From what I can tell, the verification failure is legitimate, though probably not critical.  The problem is that there are non zero padding bytes in select instructions of method bytecode.  Several other Midlets that I've found on midlet.org have the same problem, both with embedded KXML code and some non KXML code.  There doesn't seem to be any verification problem with the latest version of KXML.

I am curious about the source of this problem because it is interfering with my Purifier project, which is a pure Java minimal preverifier (see: http://www.markcrocker.com/~mcrocker/Computer/Purifier/).  Could you please let me know which compiler and preverifier you used with these earlier versions of the KXML library?  For example, if you used jikes instead of Sun's javac, then it might be saving padding bytes incorrectly.  Perhaps you used a third party preverifier, an optimizer or even a watermarking program that uses these padding bytes to store a signature.

Whatever the case is, I would appreciate it if you could let me know.

Thanks;

P.S. Here are some of the technical details if you're curious:

	Running the verifier produces errors of the form:

		Pass 3a, method 4 ['public void write(char arg1)
		                throws java.io.IOException']:
		VERIFIED_REJECTED
		Bad bytecode in the code array of the Code attribute of method 'public void write(char arg1)
		                throws java.io.IOException'.


	Catching the Exception itself produces a StackTrace starting with:

		oorg.apache.bcel.verifier.exc.AssertionViolatedException: INTERNAL ERROR: Some RuntimeException occured while verify()ing class 'org.kxml.io.XmlWriter', method 'public void write(char arg1)
		                throws java.io.IOException'. Original RuntimeException's stack trace:
		---
		org.apache.bcel.generic.ClassGenException: org.apache.bcel.generic.ClassGenException: Padding byte != 0: 1

		...


           __    
     __   / /\   
    /  /\/ / /_  ------------------------------------
   /  /  \/ / /\ Mark Crocker                        
  /  / /\ \ \/ / [email protected]            
 /  /  \_\/\  /  http://www.markcrocker.com/~mcrocker
/__/ /\ \ \_\/   ------------------------------------
\  \ \_\/        
 \  \ \          
  \__\/