Closed lollipop190 closed 11 months ago
This behavior is not a bug. As you correctly pointed out, the recommended solution is to use the -scope REACHABLE
option.
Interprocedural analyses typically rely on a call graph to connect call sites and their corresponding callees. Additionally, the call graph also determines which parts of the program are reachable. Analyzing the entire application code within the context of the interprocedural analysis may not be reasonable, as certain portions of the application code may not be reachable according to the call graph. This indicates that they are not connected within the ICFG.
Thanks for reply. So is there any possibility that i can run Interprocedural analyses on the entire application? Or alternatively, any methods that i can run maybe, something like the same analysis again after the first analysis on the residual portions of the application code ? Since i really need to run the Interprocedural analysis on the whole application code even that is not reachable.
If your really need to analyze all application methods within an interprocedural analysis, you must first ensure that they are reachable. This can be accomplished by designating them as entry methods in the pointer analysis, and you just need to create a Plugin
and then call Solver.addEntryPoint()
(with app methods as arguments) in Plugin.onStart()
.
For more information about plugin system in the pointer analysis, please refer to Pointer Analysis Framework.
Thanks a lot, i am gonna give it a try.
Your situation sounds a bit unusual. If you find that the reachable method analyzed by the pointer analysis is significantly less than expected, it might be due to reflection. In that case, you need to initiate the appropriate reflection analysis to analyze most of the ANTLR methods. You can try adding reflection-log:java-benchmarks/dacapo-2006/antlr-refl.log
to the pta
options.
Hi, Sorry for the delay and thanks a lot for the reply. But honestly, i am new to static analysis and not able to understand the reflection analysis you mentioned. and secondly, i assume the part of methods in application may be never reached if they are called only when triggered instead of called by main methods. finally, the solution that i tried works fine for me, so i will stick to it for now. Thanks again!
Describe the bug
Hi, i use Tai-e to perform an Inter-procedural analysis, (such as InterConstantPropgation). But Every time the option "-scope APP" is spcified, which is default, Tai-e will always report NullPointerException as below:
i went deep down to the bug source and noticed that the JMethod arg of the method getCFGOf tended to be methods of implicit-entries defined in AbstractWorldBuilder.java:
i did't run with the implicit-entries eliminated since the wiki warns the potential unsoundness, and plus, pta can run perfectly with default options. i am also relunctant to run Tai-e with option -scpoe REACHABLE since i want all code of app to be analyzed, but it indeed works well.
i also manully modify the field implicitEntries of AbstractWorldBuilder with an empty list, but Tai-e still gives me the same error only with the arg of getCFGOf as methods in Thread or ThreadGroup.
so, i was wondering if there was something that i did wrong or Tai-e really had relevant bug, since it looks quite trivial and no issues have ever been submitted before.
Thanks a lot.
Tai-e arguments
-cp java-benchmarks/dacapo-2006/antlr.jar:java-benchmarks/dacapo-2006/antlr-deps.jar -m dacapo.antlr.Main -java 8 -a inter-const-prop
Runtime environment infomation
OS: MacOS IDE: Jetbrains IDEA Tai-e Version: the newest code in master branch. JDK: 17