Skip to content

Python integer conversion error when decompiling some contracts: "OverflowError: Python int too large to convert to C ssize_t" #52

@0xl3x1

Description

@0xl3x1

One example contract which produces this error (several different contracts do):

0x1a9559716cafded0b9573768ea52ee29e922b687_2271995_runtime.txt

Traceback (most recent call last):
  File "../../bin/decompile", line 206, in <module>
    cfg = tac_cfg.TACGraph.from_bytecode(args.infile)
  File "/home/lexi/repos/vandal/bin/../src/tac_cfg.py", line 123, in from_bytecode
    return cls(blockparse.EVMBytecodeParser(bytecode).parse())
  File "/home/lexi/repos/vandal/bin/../src/tac_cfg.py", line 99, in __init__
    self.apply_operations()
  File "/home/lexi/repos/vandal/bin/../src/tac_cfg.py", line 260, in apply_operations
    block.apply_operations(use_sets)
  File "/home/lexi/repos/vandal/bin/../src/tac_cfg.py", line 1189, in apply_operations
    op.lhs.values = mem.Variable.arith_op(op.opcode.name, rhs).values
  File "/home/lexi/repos/vandal/bin/../src/memtypes.py", line 270, in arith_op
    result = ssle.cartesian_map(getattr(cls, opname), args)
  File "/home/lexi/repos/vandal/bin/../src/lattice.py", line 316, in cartesian_map
    return cls([f(*args) for args in prod])
  File "/home/lexi/repos/vandal/bin/../src/lattice.py", line 316, in <listcomp>
    return cls([f(*args) for args in prod])
  File "/home/lexi/repos/vandal/bin/../src/memtypes.py", line 392, in BYTE
    return (v >> ((cls.SIZE - b) * 8)) & 0xFF
OverflowError: Python int too large to convert to C ssize_t
➜ python --version
Python 3.6.1 :: Continuum Analytics, Inc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions