Error handling lambda expressions
I am trying to run the DACAPO benchmark using TamiFlex to handle reflective calls. I am following the instructions mentioned here: https://github.com/secure-software-engineering/tamiflex/wiki/DaCapoAndSoot
Dumped the class files and refl log for the batik-small benchmark using java -javaagent:poa-2.0.3.jar -jar dacapo-9.12-bach.jar batik -s small
When I try running Soot using the refl log generated and the dumped class files, I get the following error:
Unknown method for signature: <java.awt.GraphicsEnvironment$$Lambda$1.2048834776: void
To confirm the behaviour with lambda expressions, I wrote a simple program which uses lambda expressions: // A Java program to demonstrate simple lambda expressions import java.util.ArrayList; public class tamiflex_lambda { public static void main(String args[]) { // Creating an ArrayList with elements // {1, 2, 3, 4} ArrayList<Integer> arrL = new ArrayList<Integer>(); arrL.add(1); arrL.add(2); arrL.add(3); arrL.add(4);
// Using lambda expression to print all elements
// of arrL
arrL.forEach(n -> System.out.println(n));
// Using lambda expression to print even elements
// of arrL
arrL.forEach(n -> { if (n%2 == 0) System.out.println(n); });
}
}
and dumped the refl.log and the class files.
The contents of the refl.log:
Constructor.newInstance;<tamiflex_lambda$$Lambda$1.2093631819: void
When I try running it on soot.Main, I get the following error:
java -cp .:soot-4.3.0-jar-with-dependencies.jar:out followup.Followup_Main_test java.util.List.add -f J
The soot arguments are [-v, -cp, .:out, -pp, -w, -app, -p, cg.spark, enabled:true, -p, cg, all-reachable:true, -p, cg, reflection-log:out/refl.log, -p, wjop.si, enabled:false, -verbose, -debug, -main-class, tamiflex_lambda, -f, J, -d, test, tamiflex_lambda]
Soot starting
Soot started on Tue May 24 17:08:37 IST 2022
java.lang.RuntimeException: Unknown method for signature: <tamiflex_lambda$$Lambda$1.2093631819: void
When I decompile the tamiflex_lambda$$Lambda$1.class file using the command "javap -c tamiflex_lambda$$Lambda$1.class ", the contents are as follows:
final class tamiflex_lambda$$Lambda$1 implements java.util.function.Consumer { public void accept(java.lang.Object); Code: 0: aload_1 1: checkcast #15 // class java/lang/Integer 4: invokestatic #21 // Method tamiflex_lambda.lambda$main$0:(Ljava/lang/Integer;)V 7: return } It does not contain a constructor.
Is this to be expected? Can TamiFlex handle lambda expressions ?