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

IndexError: list index out of range #1530

Closed
gsalzer opened this issue Oct 23, 2021 · 0 comments · Fixed by #1545
Closed

IndexError: list index out of range #1530

gsalzer opened this issue Oct 23, 2021 · 0 comments · Fixed by #1545

Comments

@gsalzer
Copy link
Contributor

gsalzer commented Oct 23, 2021

Description

Running mythril on certain bytecodes results in the exception IndexError: list index out of range

How to Reproduce

$ cat > contract.hex <<END
7fa9059cbb000000000000000000000000000000000000000000000000000000006000527f000000000000000000000000e5960a2ce4276ce714ce640258983c4c37b3d31d6004527f00000000000000000000000000000000000000000000026b6f3c7c8b1fbf00006024526000600060446000600073f6efbab255bc9744d27c2cc137053dd7cb93d1585af1
END
$ ./myth a -c `cat contract.hex`
Consider installing rusty-rlp to improve pyrlp performance with a rust based backend
mythril.mythril.mythril_analyzer [CRITICAL]: Exception occurred, aborting analysis. Please report this issue to the Mythril GitHub page.
Traceback (most recent call last):
  File "/home/ethereum/tools/mythril/mythril/mythril/mythril_analyzer.py", line 149, in fire_lasers
    sym = SymExecWrapper(
  File "/home/ethereum/tools/mythril/mythril/analysis/symbolic.py", line 169, in __init__
    self.laser.sym_exec(
  File "/home/ethereum/tools/mythril/mythril/laser/ethereum/svm.py", line 160, in sym_exec
    created_account = execute_contract_creation(
  File "/home/ethereum/tools/mythril/mythril/laser/ethereum/transaction/symbolic.py", line 150, in execute_contract_creation
    laser_evm.exec(True)
  File "/home/ethereum/tools/mythril/mythril/laser/ethereum/svm.py", line 254, in exec
    new_states, op_code = self.execute_state(global_state)
  File "/home/ethereum/tools/mythril/mythril/laser/ethereum/svm.py", line 411, in execute_state
    self._execute_post_hook(op_code, new_global_states)
  File "/home/ethereum/tools/mythril/mythril/laser/ethereum/svm.py", line 672, in _execute_post_hook
    hook(global_state)
  File "/home/ethereum/tools/mythril/mythril/analysis/module/base.py", line 69, in execute
    result = self._execute(target)
  File "/home/ethereum/tools/mythril/mythril/analysis/module/modules/ether_thief.py", line 49, in _execute
    if state.get_current_instruction()["address"] in self.cache:
  File "/home/ethereum/tools/mythril/mythril/laser/ethereum/state/global_state.py", line 99, in get_current_instruction
    return instructions[self.mstate.pc]
IndexError: list index out of range

The analysis was completed successfully. No issues were detected.

Environment

  • Mythril version: commit 579480b47740c5b63d6dda63c7e6eae8ede2217d (myth --version does not work, unrecognized arguments: --version)
  • Python version: 3.8.10
  • OS and Version: Ubuntu 20.04.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants