-
Notifications
You must be signed in to change notification settings - Fork 142
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
How to deal with the results related to function call in data flow analysis? #646
Comments
Hi @yuffon, I understand you are writing your own analysis, is that correct? In that case you are defining your own flow functions and it seems that you are killing the old fact in the normal flow function of the first statement. I am a bit confused about your dataflow domain. In the solver dump, the set of facts you see per statement denotes the facts that hold before executing the statement. Are you aware of the already existing typestate analysis in phasar? Maybe it is more efficient to start from there or at least get an inspiration about how it could be done. IFDS is not the best choice for typestate analysis, as the dataflow domain will be large. You will always need pairs of variable and their associated typestate. Your facts look like they don't track the variable, which is incorrect as these functions (mainly) change state of the variables/pointed-to data passed to it. Hope to help. |
Hi Martin,
The dataflow domain is a set of pairs {object, state}.
I did not kill the fact before the call instruction. I will check my code carefully.
OK, I will check it.
Thanks for your remind.
|
Hi Martin, |
I believe this was an internally used old branch, I cannot recommend using that one. Instead, please start from development or master and change the LLVM version in the top level CMakeLists.txt. I think it should be possible to fix compile errors then with little effort. Maybe you need to undo a few changes that were required in the transition 12->14. |
Thanks. I will try it. |
Hi @yuffon , did you succeed? |
Hi Mory,
and
and
and
In my problem, the only flow function related to trunc instruction is getNormalFlowFunction(). This flow function works well for other types of instructions.
The second time:
|
Hi @yuffon, could you please provide your analysis target so that we can try to reproduce your problem? Also, without your flow functions it is hard to judge where things are going wrong. Issues 4 and 5 look like you are not loading the LLVM module through phasar's IRDB. The sorting of results etc. depends on a value annotation pass of phasar, where instructions are assigned an ID. As you can see above, these IDs are -1 everywhere. Cheers |
Thanks @martin. |
Hi @MMory, I have tested the new version of phasar with LLVM 14. I also fix one bug in my project. Forward IFDS is OK to me. Thanks. |
Hi,
I am using phasar to conduct type state analysis.
I want to push a finite state automata when meeting special function calls.
In my IFDS problem, I push the automata states in calltoret flow function.
But when I dump the analysis results, I find that the data flow facts are postponed by one instruction after function call.
For example, when I need to push state 0 to state 1 after function "fopen".
But I find that the result on the call instruction to "fopen" are killed except for the zero fact.
The pushed new state emerges after the instruction which follows the call instruction to "fopen".
Here is one piece of the dumped results on three sequential instructions. The middle one is the call instruction to "fopen". The state before the call is state 0. The data flow fact after the call instruction is zero fact. The new state 1 emerges after the store instruction.
I don't know whether it is a feature of phasar or it is a bug in my code.
Anyone has meet this problem?
The text was updated successfully, but these errors were encountered: