Closed kimgimkigi closed 3 years ago
My error is similar to https://github.com/rohanpadhye/vasco/issues/14#issuecomment-555922901. Only 'SignAnalysis.java' and 'CopyConstantAnalysis.java' are different. But It goes to another error after fixing SignAnalysis with '!calledMethod.hasActiveBody()' check and return copy(invalue).
specialinvoke l0.<java.lang.Throwable: java.lang.Throwable fillInStackTrace(int)>(0)
java.lang.RuntimeException: no active body present for method <java.lang.Throwable: java.lang.Throwable fillInStackTrace(int)>
at soot.SootMethod.getActiveBody(SootMethod.java:337)
at vasco.soot.DefaultJimpleRepresentation.getControlFlowGraph(DefaultJimpleRepresentation.java:72)
at vasco.soot.DefaultJimpleRepresentation.getControlFlowGraph(DefaultJimpleRepresentation.java:47)
at vasco.ForwardInterProceduralAnalysis.initContext(ForwardInterProceduralAnalysis.java:293)
at vasco.ForwardInterProceduralAnalysis.doAnalysis(ForwardInterProceduralAnalysis.java:129)
at vasco.soot.examples.SignTest.internalTransform(SignTest.java:46)
at soot.SceneTransformer.transform(SceneTransformer.java:36)
at soot.Transform.apply(Transform.java:102)
at soot.ScenePack.internalApply(ScenePack.java:35)
at soot.Pack.apply(Pack.java:117)
at soot.PackManager.runWholeProgramPacks(PackManager.java:612)
at soot.PackManager.runPacksNormally(PackManager.java:495)
at soot.PackManager.runPacks(PackManager.java:419)
at soot.Main.run(Main.java:269)
at soot.Main.main(Main.java:141)
at vasco.soot.examples.SignTest.main(SignTest.java:127)
getControlFlowGraph In "DefaultJimpleRepresentation.java", It also has method.getActiveBody(). But in this case, I have no idea how to fix this case..
This is a standard problem with native Java methods, as documented in the README. Basically, the method java.lang.Throwable.fillInStackTrace
is not implemented in Java itself, but within the JVM. So, static analysis (e.g. sign analysis) cannot compute data-flow information within this method.
If you want to analyze programs that depend on native methods, you can extend the DefaultJimpleRepresentation
class to provide a representation that handles methods without bodies. For example, you may want to replace the methods with a no-op body. Or maybe you want to write mocks for each native method separately. The solution will vary based on the analysis and how much unsoundness or imprecision you are willing to tolerate.
Hi guys
I'm trying to perform SignTest in open source projects and it goes to java.lang.RuntimeException. Error occurred in the middle stage of SignTest.
My java command
While SignTest, exception occurred after this stages,
Following is stack traces of the bug.
But when I perform SignTest with the same commands and .jar in simple code like foo(within 100 lines of code), SignTest performed well. So I guess my error is related to too large space of Interprocedural relations in code. Can someone give me some advice?
Thanks