[Soot-list] Question about inner class and failure to verify using ASM3.3.1

Henddher Pedroza hpedro2 at uic.edu
Fri Oct 26 10:38:37 EDT 2012


Hello all again,

Posting again with original attachment replaced.

Here is more info about the issue:

Stepping through the verifier code in ASM 3.3.1 makes me believe that 
the issue is in the .class file generated by Soot 2.5.0. Soot generates 
46 and compiler 1.7 generates 51.

When Issue$1 is being verified by ASM, the enclosing name and enclosing 
desc of the inner class is read in preparation for visiting the outer 
class. However, ASM 3.3.1 expects enclosing desc to be null because the 
inner class is not defined within a method. When ASM checks if enclosing 
desc is null, it finds that it is empty-string instead which is unexpected.

The fundamental question is this:

When an inner class is defined within the body of another class, the 
field is tagged as synthetic and the class attribute of the inner class 
is tagged as "EnclosingMethod" but also the enclosing name and enclosing 
desc are empty strings both. Is this correct?
Where in the specification are these points explained?

(the 4 classes are attached: both pairs, Issue.class and Issue$1.class 
pair, from compiler and from Soot 2.5.0. The source code Issue.java and 
a README)

Thanks in advance. Any help is very appreciated.

-Henddher

On 10/25/2012 06:21 PM, Henddher Pedroza wrote:
>
> Hello,
>
> I am using Soot 2.5.0 and ASM3.3.1 BasicVerifier and Analyzer and came
> across an issue:
>
> BasicVerifier+Analyzer throws IAE "invalid method descr(null or empty)"
> when I try to verify a .jar file.
>
> The source .java is as follows:
>
> //Issue.java:
> import java.io.Serializable;
> public class Issue {
>      Serializable serializable = new Serializable() {
>          public void dummy() {
>          }
>      };
> }
>
> I compile the class with javac 1.7.0_05.
> $ javac -d . Issue.java
>
> Then, I ran the classes through Soot 2.5.0:
> $ java soot.Main -app -d output.jar -outjar Issue
>
> Soot started on Thu Oct 25 17:05:28 CDT 2012
> Transforming Issue...
> Transforming Issue$1...
> Writing to Issue.class
> Writing to Issue$1.class
> Soot finished on Thu Oct 25 17:05:29 CDT 2012
> Soot has run for 0 min. 1 sec.
>
> Finally, I run the .jar through ASM 3.3.1 Analyzer+BasicVerifier, the
> exception happens when checking Issue$1.class, after checking 
> Issue.class:
> $ java -jar asm311verifier.jar output.jar -pd
>
> java.lang.IllegalArgumentException: Invalid method descriptor (must not
> be null or empty)
>      at
> org.objectweb.asm.util.CheckMethodAdapter.checkMethodDesc(CheckMethodAdapter.java:1104) 
>
>      at
> org.objectweb.asm.util.CheckClassAdapter.visitOuterClass(CheckClassAdapter.java:405) 
>
>      at org.objectweb.asm.ClassReader.accept(ClassReader.java:572)
>      at org.objectweb.asm.ClassReader.accept(ClassReader.java:425)
>
> I have attached the source, original .class and transformed classes
> should anyone wanted to experiment.
>
> Any advice?
>
> Thanks in advance.
>
> - Henddher
>
>
>
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: classes.jar
Type: application/x-java-archive
Size: 2270 bytes
Desc: not available
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20121026/1e394ca3/attachment.jar 


More information about the Soot-list mailing list