muellerberndt / laser-ethereum

Symbolic virtual machine for Ethereum
MIT License
68 stars 20 forks source link

List index out of range with program counter #1

Closed GNSPS closed 6 years ago

GNSPS commented 6 years ago
Traceback (most recent call last):
  File "/usr/local/bin/myth", line 4, in <module>
    __import__('pkg_resources').run_script('mythril==0.8.17', 'myth')
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 748, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1517, in run_script
    exec(code, namespace, namespace)
  File "/usr/local/lib/python3.6/site-packages/mythril-0.8.17-py3.6.egg/EGG-INFO/scripts/myth", line 236, in <module>
    states = StateSpace(contracts, simplified=False)
  File "/usr/local/lib/python3.6/site-packages/mythril-0.8.17-py3.6.egg/mythril/analysis/symbolic.py", line 25, in __init__
    self.svm.sym_exec(contracts[0].address)
  File "/usr/local/lib/python3.6/site-packages/laser/ethereum/svm.py", line 183, in sym_exec
    node = self._sym_exec(context, State())
  File "/usr/local/lib/python3.6/site-packages/laser/ethereum/svm.py", line 196, in _sym_exec
    start_addr = disassembly.instruction_list[state.pc]['address']
IndexError: list index out of range

The program counter is pointing to an inexistent instruction index.

The contract being analyzed was compiled with an old version of the compiler which probably used a jump to an invalid location (inexistent code) to stop execution instead of using an invalid opcode.

muellerberndt commented 6 years ago

Hi Gonçalo, not sure if this is still relevant. Do you have a mainnet address to reproduce it?

muellerberndt commented 6 years ago

This is most likely fixed.