question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError in Docker

See original GitHub issue

Description

Getting TypeError when trying to scan a truffle project with mythril docker image.

How to Reproduce

$ docker run -v <path-to-contract-folder>:/tmp -w "/tmp" mythril/myth --truffle
 

Traceback

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/instructions.py", line 996, in sstore_
    index = util.get_concrete_int(index)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/util.py", line 76, in get_concrete_int
    raise TypeError("Got a symbolic BitVecRef")
TypeError: Got a symbolic BitVecRef

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/myth", line 11, in <module>
    load_entry_point('mythril==0.19.11', 'console_scripts', 'myth')()
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/interfaces/cli.py", line 328, in main
    mythril.analyze_truffle_project(args)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/mythril.py", line 210, in analyze_truffle_project
    self.sigs, *args, **kwargs
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/support/truffle.py", line 58, in analyze_truffle_project
    transaction_count=args.transaction_count,
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/analysis/symbolic.py", line 76, in __init__
    self.laser.sym_exec(address)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/svm.py", line 106, in sym_exec
    self._execute_transactions(main_address)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/svm.py", line 154, in _execute_transactions
    execute_message_call(self, address)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/transaction/symbolic.py", line 57, in execute_message_call
    laser_evm.exec()
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/svm.py", line 186, in exec
    new_states, op_code = self.execute_state(global_state)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/svm.py", line 213, in execute_state
    global_state
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/instructions.py", line 153, in evaluate
    return instruction_mutator(global_state)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/instructions.py", line 112, in wrapper
    new_global_states = self.call_on_state_copy(func, func_obj, global_state)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/instructions.py", line 77, in call_on_state_copy
    return func(func_obj, global_state_copy)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/ethereum/instructions.py", line 1033, in sstore_
    new = Or(new, key_argument != index_argument)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/laser/smt/bool.py", line 56, in Or
    union = a.annotations + b.annotations
AttributeError: 'bool' object has no attribute 'annotations'

Environment

Docker Mythril version: 0.19.11

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

1reaction
tlxnithincommented, Jan 10, 2019

@elenadimitrova If you have development branch code in your local, replace the Docker file with below code and build it again.

FROM ubuntu:bionic

RUN apt-get update \
  && apt-get install -y \
     libsqlite3-0 \
     libsqlite3-dev \
  && apt-get install -y \
     build-essential \
     locales \
     python-pip-whl=9.0.1-2 \
     python3-pip=9.0.1-2 \
     python3-setuptools \
     software-properties-common \
  && add-apt-repository -y ppa:ethereum/ethereum \
  && apt-get update \
  && apt-get install -y \
     solc \
     libssl-dev \
     python3-dev \
     pandoc \
     git \
     wget \
  && ln -s /usr/bin/python3 /usr/local/bin/python

COPY ./requirements.txt /opt/mythril/requirements.txt

RUN cd /opt/mythril \
  && pip3 install -r requirements.txt

RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.en
ENV LC_ALL en_US.UTF-8

COPY . /opt/mythril
RUN cd /opt/mythril \
  && python setup.py install

COPY signatures.db /usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/signatures.db

ENTRYPOINT ["/usr/local/bin/myth"]

Build it with below command. docker build -t mythril/myth-dev .

And then try running it again.

1reaction
elenadimitrovacommented, Jan 10, 2019

@norhh I have the same issue as above and trying out the dev container is even failing to start the myth run. Command I am using for reference is

docker run -it -v "$PWD"/build:/build mythril/myth-dev myth --truffle

Result is:

Traceback (most recent call last):
  File "/usr/local/bin/myth", line 11, in <module>
    load_entry_point('mythril==0.19.11', 'console_scripts', 'myth')()
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/interfaces/cli.py", line 301, in main
    enable_online_lookup=args.query_signature,
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/mythril.py", line 105, in __init__
    self.mythril_dir = self._init_mythril_dir()
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/mythril/mythril.py", line 138, in _init_mythril_dir
    copyfile(str(parent_dir / "signatures.db"), db_path)
  File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.6/dist-packages/mythril-0.19.11-py3.6.egg/signatures.db'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to execute script docker-compose: TypeError: '<' not ...
After installation of docker, I just type the command and get the errors, so that, there are no other steps to reproduce the...
Read more >
docker - TypeError: Object(...) is not a function when mounting ...
docker - TypeError: Object(...) is not a function when mounting a volume from the local directory into a next. js container - Stack...
Read more >
How to Fix docker-compose "TypeError: You must specify a ...
Solved: docker-compose "TypeError: You must specify a directory to build in path" - Designcise.
Read more >
TypeError & MemoryError with fmriprep-docker - Neurostars
Hello everybody! I got TypeError & MemoryError when I used fmriprep-docker(21.0.1) to preprocess data but actually I've used fMRIprep to the ...
Read more >
ERROR: for prowlarr a bytes-like object is required, not 'str'
I am trying to use LMDS(http s://greenfrognest.com/lmdsondocker.php) which uses docker-compose. i am trying to use prowlarr(ht ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found