[Soot-list] Exception that should not occur

Quentin Sabah quentin.sabah at inria.fr
Thu Jun 13 09:27:45 EDT 2013


Hi, this is probably caused by use-original-names. I did some work 
around it lately on the develop branch.

  - Are you using the develop branch of the git repo ? If yes, what is 
the current HEAD of your branch (type the command "git rev-parse HEAD")?

  - Also can you make the same analysis with use-original-names:false 
and tell if it is ok ?

That's all for now.


On 06/13/2013 03:15 PM, Zeinab Lashkaripour wrote:
> 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
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list


-- 
Quentin Sabah, CIFRE Ph.D. student
Grenoble University
INRIA-SPADES                   | STMicroelectronics/AST
Montbonnot, France             | Grenoble, France
mailto:quentin.sabah at inria.fr  | mailto:quentin.sabah at st.com
phone: +33 476 61 54 57        | phone: +33 476 58 44 14


More information about the Soot-list mailing list