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

manticore.exceptions.EthereumError: Error deserializing type (uint256,string,uint8,string) #1382

Open
YannickXiong opened this issue Mar 6, 2019 · 3 comments
Assignees
Labels

Comments

@YannickXiong
Copy link

OS / Environment

macOS mojave 10.14.1

Manticore version

Version: 0.2.4

Python version

python 3.6

Dependencies

Summary of the problem

myContract.sol has multiple contracts.
using manticore --contract myContractName ./myContract.sol leads to error as fellow.

manticore.exceptions.EthereumError: Error  deserializing type (uint256,string,uint8,string)

Step to reproduce the behavior

  • myContractName exists in myContract.sol
  • exec manticore --contract myContractName ./myContract.sol

Expected behavior

Actual behavior

Any relevant logs

manticore --contract myContractName ./myContract.sol
2019-03-06 09:06:23,455: [2658] m.c.manticore:INFO: Verbosity set to 1.
2019-03-06 09:06:23,515: [2658] m.main:INFO: Registered plugins: DetectIntegerOverflow, DetectDelegatecall, DetectReentrancySimple, DetectExternalCallAndLeak, DetectUninitializedMemory, DetectUninitializedStorage, DetectReentrancyAdvanced, DetectUnusedRetVal, DetectSuicidal, DetectEnvInstruction, DetectInvalid
2019-03-06 09:06:23,515: [2658] m.main:INFO: Beginning analysis
2019-03-06 09:06:23,517: [2658] m.e.manticore:INFO: Starting symbolic create contract
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/ethereum/abi.py", line 209, in deserialize
    result = ABI._deserialize(abitypes.parse(ty), data)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/ethereum/abi.py", line 236, in _deserialize
    result += (ABI._deserialize(ty_i, buf, offset), )
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/ethereum/abi.py", line 231, in _deserialize
    result = buf[dyn_offset + 32:dyn_offset + 32 + size]
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/core/smtlib/expression.py", line 927, in __getitem__
    size = self._get_size(index)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/core/smtlib/expression.py", line 582, in _get_size
    assert isinstance(size, BitVecConstant)
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/manticore", line 11, in <module>
    load_entry_point('manticore==0.2.4', 'console_scripts', 'manticore')()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/__main__.py", line 41, in main
    ethereum_main(args, logger)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/ethereum/cli.py", line 68, in ethereum_main
    tx_account=args.txaccount, tx_preconstrain=args.txpreconstrain)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/ethereum/manticore.py", line 978, in multi_tx_analysis
    args=args, working_dir=working_dir)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/ethereum/manticore.py", line 615, in solidity_create_contract
    args = self.make_symbolic_arguments(constructor_types)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/ethereum/manticore.py", line 570, in make_symbolic_arguments
    return ABI.deserialize(types, self.make_symbolic_buffer(32, name='INITARGS', avoid_collisions=True))
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/manticore/ethereum/abi.py", line 212, in deserialize
    raise EthereumError("Error {} deserializing type {:s}".format(str(e), type_spec))
manticore.exceptions.EthereumError: Error  deserializing type (uint256,string,uint8,string)

@disconnect3d
Copy link
Member

@feliam can you look at this?

@feliam feliam self-assigned this Mar 12, 2019
@feliam
Copy link
Contributor

feliam commented Mar 13, 2019

I can confirm this is an issue. make_symbolic_arguments() should make a better effort to produce reasonable symblic variabes for the given types. ref.

def make_symbolic_arguments(self, types):
"""
Make a reasonable serialization of the symbolic argument types
"""
# FIXME this is more naive than reasonable.
return ABI.deserialize(types, self.make_symbolic_buffer(32, name='INITARGS', avoid_collisions=True))

@YannickXiong
Copy link
Author

@feliam Thanks, bro. By the way, what's the temporary trouble shooting?

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

4 participants