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

finalizer: 'NoneType' object has no attribute 'result' #2617

Open
gsalzer opened this issue Jan 20, 2023 · 8 comments
Open

finalizer: 'NoneType' object has no attribute 'result' #2617

gsalzer opened this issue Jan 20, 2023 · 8 comments
Labels

Comments

@gsalzer
Copy link

gsalzer commented Jan 20, 2023

Summary of the problem

Running Manticore on even the most basic contracts results invariably in an AttributeError: 'NoneType' object has no attribute 'result'.

Manticore version

Latest docker image:

$ docker images --digests trailofbits/manticore
REPOSITORY              TAG       DIGEST                                                                    IMAGE ID       CREATED      SIZE
trailofbits/manticore   latest    sha256:58c2bf71237a0b44e4c2600a0f951a11a53db54863048dbd469b266a05da5d7b   8e84d9fb9105   6 days ago   892MB

Steps to reproduce the behavior

[ The file t.sol is copied into the container, after starting it.]

$ docker run -it --entrypoint /bin/bash trailofbits/manticore

root@dac57690929e:/# cat t.sol
pragma solidity ^0.4.0;
contract test {}

root@dac57690929e:/# manticore t.sol
2023-01-20 17:46:50,679: [116] m.main:INFO: Registered plugins: IntrospectionAPIPlugin, <class 'manticore.ethereum.plugins.SkipRevertBasicBlocks'>, <class 'manticore.ethereum.plugins.FilterFunctions'>
2023-01-20 17:46:50,680: [116] m.main:INFO: Beginning analysis
2023-01-20 17:46:50,682: [116] m.e.manticore:INFO: Starting symbolic create contract
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/dist-packages/manticore/ethereum/manticore.py", line 1767, in worker_finalize
    finalizer(q.get_nowait())
  File "/usr/local/lib/python3.8/dist-packages/manticore/ethereum/manticore.py", line 1758, in finalizer
    if only_alive_states and last_tx.result in {"REVERT", "THROW", "TXERROR"}:
AttributeError: 'NoneType' object has no attribute 'result'
2023-01-20 17:46:50,753: [116] m.c.manticore:INFO: Results in /mcore_5lmji0vy
2023-01-20 17:46:50,753: [116] m.c.manticore:WARNING: Manticore failed to run
@gsalzer gsalzer added the bug label Jan 20, 2023
@jingxuan98
Copy link

got same error here

@theluxaz
Copy link

same here

@talfao
Copy link

talfao commented Oct 6, 2023

same

@MarkLee131
Copy link

same error, seems Manticore failed to generate its report.

@cwj893390557
Copy link

@gsalzer may I ask if any solution for this error yet?

@gsalzer
Copy link
Author

gsalzer commented Jun 15, 2024

@cwj893390557 Nothing has changed. This moment, I did:

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 24.04 LTS
Release:	24.04
Codename:	noble

$ docker --version
Docker version 24.0.7, build 24.0.7-0ubuntu4

$ docker pull trailofbits/manticore:latest
[ ... ]
Digest: sha256:d489a7bd7bcaafb1d38f09ab4f58ca80a80f6c1fd7ad33c8d0f407e0184eece9
Status: Downloaded newer image for trailofbits/manticore:latest

$ docker run -it --entrypoint /bin/bash trailofbits/manticore
root@ecc5145368d7:/#
[ ... from some other terminal, do: docker cp t.sol ecc5145368d7:/ ... ]

root@ecc5145368d7:/# cat t.sol
pragma solidity ^0.4.0;
contract test {}

root@ecc5145368d7:/# manticore t.sol
2024-06-15 09:57:25,725: [14] m.main:INFO: Registered plugins: IntrospectionAPIPlugin, <class 'manticore.ethereum.plugins.SkipRevertBasicBlocks'>, <class 'manticore.ethereum.plugins.FilterFunctions'>
2024-06-15 09:57:25,725: [14] m.main:INFO: Beginning analysis
2024-06-15 09:57:25,726: [14] m.e.manticore:INFO: Starting symbolic create contract
2024-06-15 09:57:25,774: [14] m.e.manticore:INFO: Failed to build contract None Errors : 
Solidity version not found:
STDOUT:

STDERR:
Traceback (most recent call last):
  File "/usr/local/bin/solc", line 8, in <module>
    sys.exit(solc())
  File "/usr/local/lib/python3.8/dist-packages/solc_select/__main__.py", line 87, in solc
    res = current_version()
  File "/usr/local/lib/python3.8/dist-packages/solc_select/solc_select.py", line 67, in current_version
    raise argparse.ArgumentTypeError(
argparse.ArgumentTypeError: No solc version set. Run `solc-select use VERSION` or set SOLC_VERSION environment variable.

. Solidity failed to generate bytecode for your contract. Check if all the abstract functions are implemented. 
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/dist-packages/manticore/ethereum/manticore.py", line 1767, in worker_finalize
    finalizer(q.get_nowait())
  File "/usr/local/lib/python3.8/dist-packages/manticore/ethereum/manticore.py", line 1758, in finalizer
    if only_alive_states and last_tx.result in {"REVERT", "THROW", "TXERROR"}:
AttributeError: 'NoneType' object has no attribute 'result'
2024-06-15 09:57:25,804: [14] m.c.manticore:INFO: Results in /mcore_ob9yzbcq
2024-06-15 09:57:25,805: [14] m.c.manticore:WARNING: Manticore failed to run

@gsalzer
Copy link
Author

gsalzer commented Jun 15, 2024

BTW, this error does not seem related to the fact that the test contract specifies pragma solidity ^0.4.0. The same error message occurs when requiring 0.8.25, selecting this compiler version manually and then running Manticore.

$ docker run -it --entrypoint /bin/bash trailofbits/manticore

root@35a510e62cab:/#  cat > t.sol <<ENDCAT
> pragma solidity ^0.8.25;
> contract test {}
> ENDCAT

root@35a510e62cab:/# cat t.sol
pragma solidity ^0.8.25;
contract test {}

root@35a510e62cab:/# solc-select install 0.8.25
Installing solc '0.8.25'...
Version '0.8.25' installed.
root@35a510e62cab:/# solc-select use 0.8.25
Switched global version to 0.8.25
root@35a510e62cab:/# solc --version
solc, the solidity compiler commandline interface
Version: 0.8.25+commit.b61c2a91.Linux.g++

root@35a510e62cab:/# manticore t.sol
2024-06-15 10:14:04,318: [83] m.main:INFO: Registered plugins: IntrospectionAPIPlugin, <class 'manticore.ethereum.plugins.SkipRevertBasicBlocks'>, <class 'manticore.ethereum.plugins.FilterFunctions'>
2024-06-15 10:14:04,318: [83] m.main:INFO: Beginning analysis
2024-06-15 10:14:04,319: [83] m.e.manticore:INFO: Starting symbolic create contract
Process Process-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.8/dist-packages/manticore/ethereum/manticore.py", line 1767, in worker_finalize
    finalizer(q.get_nowait())
  File "/usr/local/lib/python3.8/dist-packages/manticore/ethereum/manticore.py", line 1758, in finalizer
    if only_alive_states and last_tx.result in {"REVERT", "THROW", "TXERROR"}:
AttributeError: 'NoneType' object has no attribute 'result'
2024-06-15 10:14:04,450: [83] m.c.manticore:INFO: Results in /mcore_rllwwaj9
2024-06-15 10:14:04,450: [83] m.c.manticore:WARNING: Manticore failed to run

@gsalzer
Copy link
Author

gsalzer commented Jun 15, 2024

According to the README on the main page, Manticore is no longer actively maintained by the developers, and they will not look into old and new issues. Instead, they expect that the issues are handled 'by the community'. So, even though this seems to be just a basic issue (maybe just a usage error), I do not expect that it becomes resolved any time soon, given that the 'community' hasn't done so in the past 18 months.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants