Open gkastrinis opened 9 years ago
I did the same and got success in poa step using oracle java 8. The command that I used is:
java -javaagent:poa.jar Main
java -jar booster-2.0.3.jar -p cg reflection-log:out/refl.log -cp out -main-class Main Main
ad.r r0;
virtualinvoke <java.lang.Class: java.lang.reflect.Field[] getFields()>;
store.r $r54;
staticget <java.lang.System: java.io.PrintStream out>;
push "Public Fields are: ";
virtualinvoke <java.io.PrintStream: void println(java.lang.String)>;
load.r $r54;
arraylength;
store.i i1;
push 0;
store.i i0;
Block 11:
[preds: 9 ] [succs: 12 ]
load.r $r54;
load.r r2;
load.r r19;
virtualinvoke <java.lang.reflect.Method: java.lang.Object invoke(java.lang.Object,java.lang.Object[])>;
pop;
computed blockHeight == 0 recorded blockHeight = 1
at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:1898)
at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:1903)
at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:1903)
at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:1903)
at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:1903)
at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:1903)
at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:1903)
at soot.baf.JasminClass.calculateStackHeight(JasminClass.java:1903)
at soot.baf.JasminClass.emitMethodBody(JasminClass.java:321)
at soot.AbstractJasminClass.emitMethod(AbstractJasminClass.java:697)
at soot.AbstractJasminClass.<init>(AbstractJasminClass.java:576)
at soot.baf.JasminClass.<init>(JasminClass.java:91)
at soot.PackManager.writeClass(PackManager.java:893)
at soot.PackManager.writeOutput(PackManager.java:475)
at soot.PackManager.writeOutput(PackManager.java:400)
at soot.Main.run(Main.java:199)
at soot.Main.main(Main.java:141)
at de.bodden.tamiflex.booster.ReflInliner.main(ReflInliner.java:53)
What is the reason for this and how can i resolve it ? Thanks @ericbodden
Hello I can explain the error regarding Class.getDeclaredField. The Booster can only deal with certain kinds of reflective calls and Class.getDeclaredField is not one of them. Hence you should configure the POA to not include calls to Class.getDeclaredField.
The problem with the block height definitely looks like a bug in the booster's transformation.
Two years later, but I also had the Hasher problem. The issue is in how Tamiflex detects references to proxy or generated classes: in the Hasher and ClassRenamer, any LDC instruction for a string that contains some list of tokens is considered a reference to a generated name. This leads to a false positive when transforming java.lang.reflect.Proxy$ProxyClassFactory
, which generates proxy classes. As a part of this process, the ProxyClassFactory constructs the proxy class name by appending the literal string $Proxy
to a string builder. As it happens, $Proxy
is exactly one of the tokens that identifies a generated class name, but no such mapping actually exists as one would expect.
A quick and hacky solution is to simply whitelist the $Proxy
constant in the java.lang.reflect.Proxy$ProxyClassFactory
class' apply method. @ericbodden If you are accepting PR I can submit a generalization of this whitelisting, along with the EXPAND_FRAMES
errors mentioned in https://github.com/Sable/soot/issues/652.
Hello.
@ericbodden If you are accepting PR I can submit a generalization of this whitelisting, along with the EXPAND_FRAMES errors mentioned in Sable/soot#652.
Yes please! Thanks!
Cheers Eric
I was thinking id let that one simmer and let where i put it learn an algorythm. The peogram needs to be able to stand and deliver in a tough spot for a bit to do so. When it finds a release it will be frail but smart.
It will let ya know when its had enough.. ya wont be able to igmore it.
Hi, everyone, I am facing the issue with EXPAND_FRAMES Sable/soot#652 when running tamiflex on another benchmark (not DaCapo). Was that issue ever solved or does anyone know what causes it?
I am trying to run the play-out agent on a jar, get the reflection log and then use the booster jar to create a new jar. During those steps I encounter various issues.
Reflect.jar is produced from this file https://bitbucket.org/yanniss/doop-benchmarks/src/f9b3ea7e8d0e909777b2ee459b614b80c8b75e74/demos/src/hello/Reflect.java?at=default against jre1.6.
If instead I use java 8, it works ok.
Then I try to use the results with the booster jar.
Am I missing some step in the process? Thanks in advance.