Conversation
|
Hi @FoggyDawn, I think this is a configuration issue, for the following reasons:
Additionally, I notice you referenced the code for resolving static methods in PTA: Tai-e/src/main/java/pascal/taie/analysis/pta/core/solver/DefaultSolver.java Lines 650 to 651 in bb5141b However, the changes in your PR also modify the logic for invoke SPECIAL, which broadens the scope of impact. Therefore, I believe this issue is not something CHABuilder needs to address, but rather can be reframed as a question of whether the allowPhantom option handling is comprehensive enough, for the following reasons: When I provide an incomplete program—for example, by deliberately removing a class file that the analyzed program's classpath needs to reference—the question becomes whether Tai-e's I suggest including the Please continue to track this in #206 going forward. |
|
I agree it can be a ad-hoc fix. I'm not very sure about the real error reason, cause I thought missing class in class path will be reported during world build, and did not think of that possibility. |
|
Fixed in 7243cea. |
change:
in file CHABuilder.Java
callSite.getMethodRef().resolve() may casue exceptions, use CallGraphs.resolveCallee(null, callSite) instead.
test case:
XCorpus -- aoi-2.8.1
error log before repair:
Exception in thread "main" pascal.taie.ir.proginfo.MethodResolutionFailedException: Cannot resolve <com.sun.opengl.util.BufferUtil: java.nio.FloatBuffer newFloatBuffer(int)>
at pascal.taie.ir.proginfo.MethodRef.resolve(MethodRef.java:184)
at pascal.taie.analysis.graph.callgraph.CHABuilder.resolveCalleesOf(CHABuilder.java:167)
at pascal.taie.analysis.graph.callgraph.CHABuilder.lambda$buildCallGraph$1(CHABuilder.java:129)
at java.base/java.util.ArrayList$Itr.forEachRemaining(ArrayList.java:1003)
at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1845)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762)
at pascal.taie.analysis.graph.callgraph.CHABuilder.buildCallGraph(CHABuilder.java:128)
at pascal.taie.analysis.graph.callgraph.CHABuilder.build(CHABuilder.java:102)
at pascal.taie.analysis.graph.callgraph.CallGraphBuilder.analyze(CallGraphBuilder.java:67)
at pascal.taie.analysis.graph.callgraph.CallGraphBuilder.analyze(CallGraphBuilder.java:37)
at pascal.taie.analysis.AnalysisManager.runProgramAnalysis(AnalysisManager.java:148)
at pascal.taie.analysis.AnalysisManager.runAnalysis(AnalysisManager.java:135)
at pascal.taie.analysis.AnalysisManager.lambda$execute$0(AnalysisManager.java:104)
at pascal.taie.util.Timer.runAndCount(Timer.java:93)
at pascal.taie.analysis.AnalysisManager.lambda$execute$1(AnalysisManager.java:103)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at pascal.taie.analysis.AnalysisManager.execute(AnalysisManager.java:102)
at pascal.taie.Main.executePlan(Main.java:154)
at pascal.taie.Main.lambda$main$0(Main.java:62)
at pascal.taie.util.Timer.lambda$runAndCount$0(Timer.java:112)
at pascal.taie.util.Timer.runAndCount(Timer.java:93)
at pascal.taie.util.Timer.runAndCount(Timer.java:111)
at pascal.taie.util.Timer.runAndCount(Timer.java:107)
at pascal.taie.Main.main(Main.java:52)
log after repair:
cg starts ...
Building call graph by CHA
Ignore methods of java.lang.Object
Call graph has 28841 reachable methods and 334714 edges
Dumping call graph to /home/byx/testSpace/javaprjs/aoi-2.8.1/cha-output/call-graph.dot
Dumping reachable methods to /home/byx/testSpace/javaprjs/aoi-2.8.1/cha-output/reachable-methods.txt
Dumping call edges to /home/byx/testSpace/javaprjs/aoi-2.8.1/cha-output/call-edges.txt
cg finishes, elapsed time: 15.79s
Tai-e finishes, elapsed time: 24.82s
options:
optionsFile: null
printHelp: false
classPath:
appClassPath:
mainClass: artofillusion.ArtOfIllusion
inputClasses: []
javaVersion: 5
prependJVM: false
allowPhantom: true
worldBuilderClass: pascal.taie.frontend.soot.SootWorldBuilder
outputDir: ../../testSpace/javaprjs/aoi-2.8.1/cha-output
preBuildIR: false
worldCacheMode: false
scope: APP
nativeModel: true
planFile: null
analyses:
cg: algorithm:cha;dump:true;dump-methods:true;dump-call-edges:true;
onlyGenPlan: false
keepResult: