[Soot-list] Truncated class file

Patrick LAM plam at sable.mcgill.ca
Mon May 8 12:15:08 EDT 2006


Eduardo S. Cordeiro wrote:
> I wrote a SceneTransformer which takes classes and finds identical
> methods to remove replicas, keeping only one instance of each replica
> pair (or triple, etc). The transformer first removes the methods and
> then replaces calls to removed methods by calls to the remaining ones
> they were replicas of. Call replacement is made by changing the
> SootMethodRef object associated with an InvokeExpr.
>
> When I open the resulting class files in a class file viewer, such as
> jclasslib, everything seems in order; I've checked the constant pool
> information, method bodies and the initial bytes which give method count
> and constant pool size and found no problem. But when I try to run
> transformed programs on the VMs specified below (those I have access
> to), a java.lang.ClassFormatException is thrown, with the message
> "Truncated class file", which is apparently thrown from the <clinit> of
> the main class.
>
> Have I used the wrong strategy to remove these methods (hopefully) or is
> this a bug with method removal (please no)?

Hi Eduardo,

I'm not aware of any Soot problems with method removal, but I've never
heard of a "truncated class file" error.  It would be useful if you could
post all of the relevant examples on a webpage somewhere; it's hard to
tell what's going on from your description.  It doesn't sound like there
should be anything wrong.

pat





More information about the Soot-list mailing list