[Soot-list] Method without CodeAttribute

Bernhard Berger berber at tzi.de
Thu Jan 3 02:26:42 EST 2013


Hi, folks!

Today I came across a class file that soot was not able to load (some dependencies of my project). It is the class javax.servlet.GenericServlet that can be found here [1]. The class contains a class initializer <clinit> without a code attribute which leads to a NullPointerException. In particular, coffi loads the method in soot.coffi.ClassFile.parseMethod. The parsing process stops if the code attribute cannot be found without assigning a value to the instruction field of m. Later on, soot.coffi.CFG.<init> dereferences the field without checking for null. I took a look at the source but I've no idea how to fix this "bug". I am even unsure whether the class file is correct (On the one hand, javap accepts the class file. On the other hand, java throws a java.lang.ClassFormatError)

I think I can find another library containing a proper version of this class to circumvent the problem but I wanted to report the behavior for other users of soot.

Bernhard

[1] http://download.java.net/maven/2/javaee/javaee-api/5/javaee-api-5.jar


More information about the Soot-list mailing list