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: 'NoneType' object cannot be interpreted as an integer" when rendering a graph

See original GitHub issue

Description

Can’t produce a graph when following wiki commands

How to Reproduce

Following this wiki page : https://github.com/ConsenSys/mythril-classic/wiki/Control-Flow-Graph

Option -i don’t exist. If I remove it, i get :

$ python -m mythril -g graph.html -a 0x5c436ff914c458983414019195e0f4ecbef9e6dd
mythril.interfaces.cli [ERROR]: Traceback (most recent call last):
  File "/home/jeremyp/.local/lib/python3.7/site-packages/mythril/interfaces/cli.py", line 527, in parse_args
    disassembler=dissasembler, address=address, parser=parser, args=args
  File "/home/jeremyp/.local/lib/python3.7/site-packages/mythril/interfaces/cli.py", line 435, in execute_command
    phrackify=args.phrack,
  File "/home/jeremyp/.local/lib/python3.7/site-packages/mythril/mythril/mythril_analyzer.py", line 110, in graph_html
    enable_iprof=self.enable_iprof,
  File "/home/jeremyp/.local/lib/python3.7/site-packages/mythril/analysis/symbolic.py", line 114, in __init__
    self.laser.sym_exec(address)
  File "/home/jeremyp/.local/lib/python3.7/site-packages/mythril/laser/ethereum/svm.py", line 135, in sym_exec
    self._execute_transactions(main_address)
  File "/home/jeremyp/.local/lib/python3.7/site-packages/mythril/laser/ethereum/svm.py", line 176, in _execute_transactions
    for i in range(self.transaction_count):
TypeError: 'NoneType' object cannot be interpreted as an integer

I get the same error when running it with Docker :

$ docker run -v $(pwd):/tmp mythril/myth -g /tmp/graph.html -a 0x5c436ff914c458983414019195e0f4ecbef9e6dd --max-depth 8
mythril.interfaces.cli [ERROR]: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.20.4-py3.6.egg/mythril/interfaces/cli.py", line 527, in parse_args
    disassembler=dissasembler, address=address, parser=parser, args=args
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.20.4-py3.6.egg/mythril/interfaces/cli.py", line 435, in execute_command
    phrackify=args.phrack,
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.20.4-py3.6.egg/mythril/mythril/mythril_analyzer.py", line 110, in graph_html
    enable_iprof=self.enable_iprof,
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.20.4-py3.6.egg/mythril/analysis/symbolic.py", line 114, in __init__
    self.laser.sym_exec(address)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.20.4-py3.6.egg/mythril/laser/ethereum/svm.py", line 135, in sym_exec
    self._execute_transactions(main_address)
  File "/usr/local/lib/python3.6/dist-packages/mythril-0.20.4-py3.6.egg/mythril/laser/ethereum/svm.py", line 176, in _execute_transactions
    for i in range(self.transaction_count):
TypeError: 'NoneType' object cannot be interpreted as an integer

Expected behavior

A working graph generation.

Environment

  • Mythril version: 0.20.4
  • Solidity compiler and version: None
  • Python version: 3.7.3
  • OS and Version: Linux Manjaro

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
norhhcommented, May 2, 2019

It takes some time, try it with --transaction-count 1 flag, that may speed it up to a bit, also you can try reducing the max-depth to --max-depth 15 or something like that

0reactions
norhhcommented, May 2, 2019

This maybe due to a large amount of states, can you try it with lesser depth

Read more comments on GitHub >

github_iconTop Results From Across the Web

"TypeError: 'NoneType' object cannot be interpreted as an integer ...
I trying with --rpc infura-mainnet , but it keeps waiting without creating a graph.html file. All ...
Read more >
NoneType object cannot be interpreted as an integer
The Python "TypeError: 'NoneType' object cannot be interpreted as an integer" occurs when we pass a None value to a function that expects...
Read more >
TypeError: 'NoneType' object cannot be interpreted as an integer
jpg.. But when I try to use enumerate(dataset) , this error occurs: My dataset code is: class ...
Read more >
TypeError: 'NoneType' object is not callable while attempting ...
Error is in the detect_fn line. So something within that function is attempting to be called as if a function. Since the “NoneType”...
Read more >
[Example code]-TypeError: 'Namespace' object cannot be ...
I get this error: TypeError: 'Namespace' object cannot be interpreted as an integer. score:1. You are using nb as a numerical value so...
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