Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: Attempt to create SootMethodRef with null returnType #1696

Closed
kimgimkigi opened this issue Jul 8, 2021 · 5 comments · May be fixed by #1697
Closed

java.lang.IllegalArgumentException: Attempt to create SootMethodRef with null returnType #1696

kimgimkigi opened this issue Jul 8, 2021 · 5 comments · May be fixed by #1697

Comments

@kimgimkigi
Copy link

kimgimkigi commented Jul 8, 2021

Steps to reproduce:
1.) ...

Files used to reproduce:
...

Soot version:

trunk

Command line:

-cp junit.jar:build -pp -w -app -keep-line-number -keep-bytecode-offset -p jb use-original-names -p cg implicit-entry:false -p cg.spark enabled -p cg.spark simulate-natives -p cg safe-forname -p cg safe-newinstance -main-class org.jfree.chart.plot.junit.PlotPackageTests -f none org.jfree.chart.plot.junit.PlotPackageTests

Max Memory:

3641MB

Stack trace:

java.lang.IllegalArgumentException: Attempt to create SootMethodRef with null returnType :sun.reflect.annotation.AnnotationType===retention
	at soot.SootMethodRefImpl.<init>(SootMethodRefImpl.java:87)
	at soot.Scene.makeMethodRef(Scene.java:1939)
	at soot.jimple.toolkits.callgraph.OnFlyCallGraphBuilder.addType(OnFlyCallGraphBuilder.java:608)
	at soot.jimple.spark.solver.OnFlyCallGraph$2.visit(OnFlyCallGraph.java:170)
	at soot.jimple.spark.sets.HybridPointsToSet.forall(HybridPointsToSet.java:119)
	at soot.jimple.spark.solver.OnFlyCallGraph.updatedNode(OnFlyCallGraph.java:167)
	at soot.jimple.spark.solver.PropWorklist.handleVarNode(PropWorklist.java:158)
	at soot.jimple.spark.solver.PropWorklist.propagate(PropWorklist.java:81)
	at soot.jimple.spark.SparkTransformer.propagatePAG(SparkTransformer.java:238)
	at soot.jimple.spark.SparkTransformer.internalTransform(SparkTransformer.java:155)
	at soot.SceneTransformer.transform(SceneTransformer.java:36)
	at soot.Transform.apply(Transform.java:105)
	at soot.RadioScenePack.internalApply(RadioScenePack.java:64)
	at soot.jimple.toolkits.callgraph.CallGraphPack.internalApply(CallGraphPack.java:61)
	at soot.Pack.apply(Pack.java:118)
	at soot.PackManager.runWholeProgramPacks(PackManager.java:619)
	at soot.PackManager.runPacksNormally(PackManager.java:500)
	at soot.PackManager.runPacks(PackManager.java:425)
	at soot.Main.run(Main.java:280)
	at soot.Main.main(Main.java:142)
	at vasco.soot.examples.SignTest.main(SignTest.java:119)

Hi guys
I'm trying to use Soot with vasco(https://github.com/rohanpadhye/vasco) to perform SignAnalysis.
But I get IllegalArgumentException about SootMethodRefImpl.

In SootMethodRefImpl, it looks returnType null check(Line:85) and error occurred from that line.
So I tried to figure out class and method name, finally I got error caused by "sun.reflect.annotation.AnnotationType" class and "retention" methods.

It seems like those are related to annotations but my main_class does not have "retention" annotations.
How can I solve this problem? Plz give advice!
Thanks

@kimgimkigi
Copy link
Author

Those are caused by junit.framework.testsuite
But I still cannot understand why error related with retention annotations

@canliture
Copy link
Contributor

canliture commented Jul 11, 2021

The easiest way to suppress the thrown exceptions is setting Soot options:

  • in programming way:Options.v().set_allow_phantom_refs(true);

  • or in command line options way: -allow-phantom-refs

But I think it's not a correct way to solve the problem.

Days ago, the problem bothered me a lot. And now I think I have solved the problem.
Pull Request have pushed, look at #1697

@kimgimkigi
Copy link
Author

@canliture
Thanks for reply. I tried with your changes, but I still get same errors.
Maybe my error from other issues.

@canliture
Copy link
Contributor

@canliture
Thanks for reply. I tried with your changes, but I still get same errors.
Maybe my error from other issues.

please give me the files that can reproduce the crash,I think I can solve the problem.After all,I have solved the problem in my environment.

By the way,what version you are using?4.3.0-snapshort?what thunk version?

@kimgimkigi
Copy link
Author

@canliture
I was using 4.2.1. After some effort, I finally caught my error was related to Java heap memory.
Thanks for your attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants