cfg_accurate: problem with __isoc99_scanf analysis
See original GitHub issueFound some strange behavior:
This is the analysis:
start_state = b.factory.blank_state(addr=addr)
start_state.stack_push(0x0)
cfg = b.analyses.CFG(fail_fast=True, starts=[addr], initial_state=start_state, context_sensitivity_level=3, keep_state=True, call_depth=100)
For this input:
#include <stdio.h>
int global;
int cmp() {
return global >= 0 && global <= 100;
}
int main(int argc, char *argv[])
{
int x;
cmp();
scanf("%d", &x);
return 0;
}
It creates this graph:
(but only with scanf
. If I replace scanf
with printf
, it doesn’t produce pathterminator nodes)
If I replace global
with a stack variable:
#include <stdio.h>
int global;
int cmp() {
int a;return a >=0 && a < 100;
}
int main(int argc, char *argv[])
{
int x;
cmp();
scanf("%d", &x);
return 0;
}
It also works fine:
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ViktorMKa : axt answered it in another issue. Check this out: https://github.com/axt/angr-utils
Unrelated to the issue, but i’d like to know how you output these neat-looking graphs. What i get, using
nx.write_dot(cfg.graph, name)
and viewing with xdot is much less informative.