[Soot-list] Exception that should not occur

Zeinab Lashkaripour lashkaripour at yahoo.com
Thu Jun 13 09:15:48 EDT 2013


Hi Everyone,

I am facing a problem that should not occur. I have added jasper-runtime-5.5.23.jar to the libraries of my project. I am using the command line bellow:
     "-p", "tag.ln", "enabled",
     "-p", "jb", "use-original-names:true",
     "-keep-line-number",
     "-src-prec", "java",
     "-validate",
    "-cp", "....."
     "-f", "jimple", "--app",
     "-process-dir", "..",
                   

When I run Soot at the point: 

    Transforming org.apache.jasper.runtime.ProtectedFunctionMapper...      

I get the exception [1]. I original code of org.apache.jasper.runtime.ProtectedFunctionMapper (the method related to the exception) is shown in [2]. In this code I have shown the related part inside the method in bold-red. As you can see we have "method" as the second parameter but the related jimple of this code [3] uses "l5" instead of "method" (bold-red). 

Does anyone have any suggestions? 


Regards,
Zeinab


------------------------------------------------------------------------------

[1]
Exception in thread "main" java.lang.RuntimeException: no defs for value: l5! in <org.apache.jasper.runtime.ProtectedFunctionMapper: void mapFunction(java.lang.String,java.lang.Class,java.lang.String,java.lang.Class[])>
    at soot.Body.validateUses(Body.java:336)
    at soot.Body.validate(Body.java:233)
    at soot.jimple.JimpleBody.validate(JimpleBody.java:66)
    at soot.PackManager.runBodyPacks(PackManager.java:777)
    at soot.PackManager.runBodyPacks(PackManager.java:463)
    at soot.PackManager.runBodyPacks(PackManager.java:380)
    at soot.PackManager.runPacks(PackManager.java:357)
    at soot.Main.run(Main.java:198)
    at soot.Main.main(Main.java:141)
    at MyMain.main(MyMain.java:88)
------------------------------------------------------------------------------
[2]
public void mapFunction(String fnQName, Class c, String methodName, Class[] args)
 {
    Method method;
    if (System.getSecurityManager() != null) {
      try {
        method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { private final Class val$c;
          private final String val$methodName;
          private final Class[] val$args;
          public Object run() throws Exception { return this.val$c.getDeclaredMethod(this.val$methodName, this.val$args);}
        });
      }
      catch (PrivilegedActionException ex)
      {
        Method method;
        throw new RuntimeException("Invalid function mapping - no such method: " + ex.getException().getMessage());
      }
    }
    else {
      try
      {
        method = c.getDeclaredMethod(methodName, args);
      } catch (NoSuchMethodException e) {
        throw new RuntimeException("Invalid function mapping - no such method: " + e.getMessage());
      }
    }
   this.fnmap.put(fnQName, method);
  }
------------------------------------------------------------------------------
[3]
this := @this: org.apache.jasper.runtime.ProtectedFunctionMapper
fnQName := @parameter0: java.lang.String
c := @parameter1: java.lang.Class
methodName := @parameter2: java.lang.String
args := @parameter3: java.lang.Class[]
$z0 = staticinvoke <org.apache.jasper.security.SecurityUtil: boolean isPackageProtectionEnabled()>()
if $z0 == 0 goto virtualinvoke c.<java.lang.Class: java.lang.reflect.Method getDeclaredMethod(java.lang.String,java.lang.Class[])>(methodName, args)
$r0 = new org.apache.jasper.runtime.ProtectedFunctionMapper$2
specialinvoke $r0.<org.apache.jasper.runtime.ProtectedFunctionMapper$2: void <init>(org.apache.jasper.runtime.ProtectedFunctionMapper,java.lang.Class,java.lang.String,java.lang.Class[])>(this, c, methodName, args)
$r1 = staticinvoke <java.security.AccessController: java.lang.Object doPrivileged(java.security.PrivilegedExceptionAction)>($r0)
method = (java.lang.reflect.Method) $r1
goto [?= $r9 = this.<org.apache.jasper.runtime.ProtectedFunctionMapper: java.util.HashMap fnmap>]
$r2 := @caughtexception
ex = $r2
$r3 = new java.lang.RuntimeException
$r4 = new java.lang.StringBuffer
specialinvoke $r4.<java.lang.StringBuffer: void <init>()>()
$r4 = virtualinvoke $r4.<java.lang.StringBuffer: java.lang.StringBuffer append(java.lang.String)>("Invalid function mapping - no such method: ")
$r5 = virtualinvoke ex.<java.security.PrivilegedActionException: java.lang.Exception getException()>()
$r6 = virtualinvoke $r5.<java.lang.Exception: java.lang.String getMessage()>()
$r4 = virtualinvoke $r4.<java.lang.StringBuffer: java.lang.StringBuffer append(java.lang.String)>($r6)
$r7 = virtualinvoke $r4.<java.lang.StringBuffer: java.lang.String toString()>()
specialinvoke $r3.<java.lang.RuntimeException: void <init>(java.lang.String)>($r7)
throw $r3
virtualinvoke c.<java.lang.Class: java.lang.reflect.Method getDeclaredMethod(java.lang.String,java.lang.Class[])>(methodName, args)
goto [?= $r9 = this.<org.apache.jasper.runtime.ProtectedFunctionMapper: java.util.HashMap fnmap>]
$r8 := @caughtexception
e = $r8
$r3 = new java.lang.RuntimeException
$r4 = new java.lang.StringBuffer
specialinvoke $r4.<java.lang.StringBuffer: void <init>()>()
$r4 = virtualinvoke $r4.<java.lang.StringBuffer: java.lang.StringBuffer append(java.lang.String)>("Invalid function mapping - no such method: ")
$r6 = virtualinvoke e.<java.lang.NoSuchMethodException: java.lang.String getMessage()>()
$r4 = virtualinvoke $r4.<java.lang.StringBuffer: java.lang.StringBuffer append(java.lang.String)>($r6)
$r7 = virtualinvoke $r4.<java.lang.StringBuffer: java.lang.String toString()>()
specialinvoke $r3.<java.lang.RuntimeException: void <init>(java.lang.String)>($r7)
throw $r3
$r9 = this.<org.apache.jasper.runtime.ProtectedFunctionMapper: java.util.HashMap fnmap>
virtualinvoke $r9.<java.util.HashMap: java.lang.Object put(java.lang.Object,java.lang.Object)>(fnQName, l5)
return
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20130613/aee71583/attachment.html 


More information about the Soot-list mailing list