manticore icon indicating copy to clipboard operation
manticore copied to clipboard

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

Open gsalzer opened this issue 2 years ago • 8 comments

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 avatar Jan 20 '23 17:01 gsalzer

got same error here

jingxuan98 avatar Jul 10 '23 06:07 jingxuan98

same here

theluxaz avatar Sep 20 '23 20:09 theluxaz

same

talfao avatar Oct 06 '23 10:10 talfao

same error, seems Manticore failed to generate its report.

MarkLee131 avatar Dec 25 '23 05:12 MarkLee131

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

cwj893390557 avatar Jun 15 '24 02:06 cwj893390557

@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 avatar Jun 15 '24 10:06 gsalzer

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 avatar Jun 15 '24 10:06 gsalzer

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.

gsalzer avatar Jun 15 '24 10:06 gsalzer