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

setup.sh incorrect #1

Open
mtullsen opened this issue Nov 13, 2018 · 9 comments
Open

setup.sh incorrect #1

mtullsen opened this issue Nov 13, 2018 · 9 comments

Comments

@mtullsen
Copy link

in setup.sh, these packages are incompatible:
pip install angr==7.8.9.26
pip install networkx==1.11

When I allow pip to install networkx==2.1, I get an error as follows:

WARNING | 2018-11-11 02:34:23,538 | angr.engines.successors | Exit state has over 256 possible solutions. Likely unconstrained; skipping. <BV64 global_c0001fb_492_64{UNINITIALIZED}>
WARNING | 2018-11-11 02:34:24,897 | angr.engines.successors | Exit state has over 256 possible solutions. Likely unconstrained; skipping. <BV64 global_c000205_499_64{UNINITIALIZED}>
[02:34:37,328] [+] CFG generated.
[02:34:37,328] [+] Normalizing CFG...
[02:34:37,970] [+] Done.
[02:34:37,986] [*] CFG has 27087 nodes and 49902 edges
[02:34:38,046] [+] Loading basic block abstractions from file...
Traceback (most recent call last):
File "./source/BOPC.py", line 512, in <module>
  abstract(mark, args.abstractions, args.binary)
File "./source/BOPC.py", line 333, in abstract
  mark.load_abstractions(filename)            # simply load the abstractions
File "/home/tullsen/src/3rd/BOPC/source/mark.py", line 464, in load_abstractions
  for node, attr in self.__cfg.graph.nodes_iter(data=True):
AttributeError: 'DiGraph' object has no attribute 'nodes_iter'

Which is surprising to me because 'nodes_iter' seems to have been dropped from NetworkX 1.X when moving to NetworkX 2.0.

@ispoleet
Copy link
Collaborator

Code won't work with networkx 2.1 as interfaces are different. Installing a different version than the
suggested one is not an issue of setup.sh ;)

@mtullsen
Copy link
Author

I probably put in too much information, but
pip install angr==7.8.9.26
is incompatible with
pip install networkx==1.11

@gannimo
Copy link
Member

gannimo commented Nov 14, 2018

Mark, can you also list the command that produced the error? You only posted the error message. Thanks!

@gannimo gannimo reopened this Nov 14, 2018
@mtullsen
Copy link
Author

I ran this (pretty sure binary was nginx1):

./source/BOPC.py -dd -b $__binary__ -a load --capability all save

@mtullsen
Copy link
Author

I concur with @ispoleet, the code appears to need networkx==1.11 and doesn't work with networkx==2.1. What I want to know is how setup.sh works for anyone else? Can you get networkx==1.11 to work with angr==7.8.9.26?

@gannimo
Copy link
Member

gannimo commented Nov 15, 2018

Oddly, it worked for me on Debian 9:

✘ gannimo@bumblebee  ~  pip list|grep "angr|networkx"
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
angr (7.8.9.26)
networkx (1.11)

Can you try another binary instead of nginx and see if it works (see the timeout discussion in the other issue)?

@mtullsen
Copy link
Author

No change, i.e.,

    __binary__=~/src/3rd/BOPC/evaluation/sudo
    ./source/BOPC.py -dd -b $__binary__ -a saveonly
    ./source/BOPC.py -dd -b $__binary__ -a load --capability all save

gives the same results as it did for

    __binary__=~/src/3rd/BOPC/evaluation/nginx1

BTW, not sure if the above two commands really need to be run sequentially or what.

The problem seems to be that BOPC currently relies on networkx==1.11. Note that nodes_iterm has been removed from networkx==2.1: https://networkx.github.io/documentation/latest/release/migration_guide_from_1.x_to_2.0.html

While angr==7.8.9.26 really appears to require networkx==2.1

    $ grep networkx **/*(.)   # zsh at top of angr source
    angr-7.8.9.26/setup.py:        'networkx==2.1',
    angr-7.8.9.26/angr.egg-info/requires.txt:networkx==2.1
    ...

So, I'm at the limits of my understanding of python, pip, packages, etc: why you can have what you have while pip is not allowing me to do the same.

@gannimo
Copy link
Member

gannimo commented Nov 17, 2018

This dependency issue is really odd as it installed fine on my work machine. I was able to reproduce the error on my laptop though. We'll have to update BOPC to the new networkx version to resolve this error. I'll keep the issue open and signal when the rewrite is done.

Thanks for reporting!

@glguy
Copy link

glguy commented Jan 31, 2019

I was able to get the install working by changing setup.sh to call pip2 instead of pip because the latter is using Python 3 on recent versions of Ubuntu. Is that perhaps related to the problems that people have been having above?

To get certain BOPC commands running I had to run pip2 uninstall networkx to remove network-2.1 as required by angr-7.8.9.26 and then manually reinstall networkx-1.11. Even though this version of networkx was listed in the setup.sh script, pip seemed unwilling to downgrade the version by running the command.

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

No branches or pull requests

4 participants