smartbugs / smartbugs

SmartBugs: A Framework to Analyze Ethereum Smart Contracts

Home Page:https://smartbugs.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

During handling of the above exception, another exception occurred

taylorgag opened this issue · comments

Sorry to bother you, when I use the command python3 smartBugs.py --tool all --file dataset/60.sol, its outputs are:

Analysing file [1/11]: dataset/60.sol [maian]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
400 Client Error for http+docker://localhost/v1.41/containers/5af4f1b5002011ca9610073e737946f0961f40735ac8045ebf24a40c31b4ae1d/start: Bad Request ("OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/runMAIANall.sh": stat /runMAIANall.sh: no such file or directory: unknown")
unsupported operand type(s) for +: 'APIError' and 'str'
Analysing file [2/11]: dataset/60.sol [oyente]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
Done [2/11, 0:00:16]: dataset/60.sol [oyente] in 0:00:02
Analysing file [3/11]: dataset/60.sol [osiris]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ERROR: Solc experienced a fatal error. Check the results file for more info
Done [3/11, 0:00:12]: dataset/60.sol [osiris] in 0:00:01
Analysing file [4/11]: dataset/60.sol [manticore]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
Done [4/11, 0:52:43]: dataset/60.sol [manticore] in 0:30:03
Analysing file [5/11]: dataset/60.sol [conkas]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
Done [5/11, 0:36:14]: dataset/60.sol [conkas] in 0:00:05
Analysing file [6/11]: dataset/60.sol [solhint]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
Done [6/11, 0:25:12]: dataset/60.sol [solhint] in 0:00:02
Analysing file [7/11]: dataset/60.sol [mythril]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
Done [7/11, 0:17:18]: dataset/60.sol [mythril] in 0:00:02
Analysing file [8/11]: dataset/60.sol [smartcheck]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
Done [8/11, 0:11:23]: dataset/60.sol [smartcheck] in 0:00:04
Analysing file [9/11]: dataset/60.sol [honeybadger]
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
ANTLR runtime and generated code versions disagree: 4.9.3!=4.7.2
Done [9/11, 0:07:47]: dataset/60.sol [honeybadger] in 0:04:43
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/home/wangben/.local/lib/python3.6/site-packages/docker/api/client.py", line 268, in _raise_for_status
response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 935, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.41/containers/5af4f1b5002011ca9610073e737946f0961f40735ac8045ebf24a40c31b4ae1d/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/wangben/smartbugs/src/docker_api/docker_api.py", line 281, in analyse_files
volumes=volume_bindings)
File "/home/wangben/.local/lib/python3.6/site-packages/docker/models/containers.py", line 818, in run
container.start()
File "/home/wangben/.local/lib/python3.6/site-packages/docker/models/containers.py", line 404, in start
return self.client.api.start(self.id, **kwargs)
File "/home/wangben/.local/lib/python3.6/site-packages/docker/utils/decorators.py", line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
File "/home/wangben/.local/lib/python3.6/site-packages/docker/api/container.py", line 1111, in start
self._raise_for_status(res)
File "/home/wangben/.local/lib/python3.6/site-packages/docker/api/client.py", line 270, in _raise_for_status
raise create_api_error_from_http_exception(e)
File "/home/wangben/.local/lib/python3.6/site-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error for http+docker://localhost/v1.41/containers/5af4f1b5002011ca9610073e737946f0961f40735ac8045ebf24a40c31b4ae1d/start: Bad Request ("OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/runMAIANall.sh": stat /runMAIANall.sh: no such file or directory: unknown")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "smartBugs.py", line 61, in analyse
raise e
File "smartBugs.py", line 44, in analyse
analyse_files(tool, file, logs, output_folder, sarif_outputs, output_version, import_path)
File "/home/wangben/smartbugs/src/docker_api/docker_api.py", line 303, in analyse_files
logs.write(err + '\n')
TypeError: unsupported operand type(s) for +: 'APIError' and 'str'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "smartBugs.py", line 191, in
logs = exec_cmd(args)
File "smartBugs.py", line 168, in exec_cmd
pool.map(analyse, tasks)
File "/usr/lib/python3.6/multiprocessing/pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
TypeError: unsupported operand type(s) for +: 'APIError' and 'str'

Apparently the work on the new branch bytecode braught inconsistencies into the main branch, via the docker images. Try the bytecode branch. Under Linux, the following should work.

git clone https://github.com/smartbugs/smartbugs.git
git checkout bytecode
python3 -m venv venv # we suggest to use a virtual environment
source venv/bin/activate # activate it
pip install -r requirements.txt
python smartBugs.py --tool all --file ...