crytic / rattle

evm binary static analysis
https://www.trailofbits.com/presentations/rattle/
344 stars 41 forks source link

FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot' #20

Closed nxqbao closed 5 years ago

nxqbao commented 5 years ago

I tried to get rattle running and got FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'

Traceback (most recent call last):
  File "rattle-cli.py", line 203, in <module>
    main()
  File "rattle-cli.py", line 189, in main
    subprocess.call(['dot', '-Tpng', f'-o{out_file}', t.name])
  File "~/.pyenv/versions/3.7.0/lib/python3.7/subprocess.py", line 304, in call
    with Popen(*popenargs, **kwargs) as p:
  File "~/.pyenv/versions/3.7.0/lib/python3.7/subprocess.py", line 756, in __init__
    restore_signals, start_new_session)
  File "~/.pyenv/versions/3.7.0/lib/python3.7/subprocess.py", line 1499, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'

I also tried to fix dot path but can find it no where

nxqbao commented 5 years ago

I did not have graphviz in my /usr/lib but graphviz package for python. Installing it by apt-get solved my problem

nxqbao commented 5 years ago

Now i got following error

[+] Wrote _dispatch to output/_dispatch.png
Couldn't get a file descriptor referring to the console
[+] Wrote kill() to output/kill().png
Couldn't get a file descriptor referring to the console
[+] Wrote _fallthrough to output/_fallthrough.png
Couldn't get a file descriptor referring to the console
nxqbao commented 5 years ago

https://github.com/trailofbits/rattle/blob/2ec580f6963ee876b90326576bc328cca0d03c79/rattle-cli.py#L194

Replace open by xdg-open. It works on Ubuntu.