Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

The process aleth-vm throws an OutofMemoryError when it detect an "infinite loop" #5908

@BattleBird

Description

@BattleBird

aleth version: 1.8.0
Operating system: Linux
Installation: built from source

when I use the binary aleth-vm to run the following code, the following bytecode contains an "infinite loop", it will not print trace information and terminate the operation correctly until the gas limit is used up.
./aleth-vm_1.8.0 stats --code 608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063f8a8fd6d146044575b600080fd5b348015604f57600080fd5b506056606c565b6040518082815260200191505060405180910390f35b600080600190505b600581101560745760005481600054020160008190555080806001019150506074565b600054915050905600a165627a7a7230582010c05846ebb8bfc4e2e4c1d67c00000000000000008ae603dce419deaac37d13cb56c3c43a1bc2950029 --mnemonics --input f8a8fd6d
The corresponding control flow graph is as follow, we can observe an infinite loop in block 0x74
abnormal_memory_TestLoop
The corresponding set of opcode sequences is as follow,
opcode_sequences

However, when I use the binary aleth-vm to run the following code, the following bytecode also contains an "infinite loop", it will continue to occupy CPU resources until the system kills the whole process. In addition, aleth throws OutOfMemoryError when it crashes.

./aleth-vm_1.8.0 stats --code 608060405260043610603f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063f8a8fd6d146044575b600080fd5b348015604f57600080fd5b506056606c565b6040518082815260200191505060405180910390f35b600080600190505b6005811015604f5760005481600054020160008190555080806001019150506074575b600054915050905600a165627a7a7230582010c05846ebb8bfc4e2e4c1d67c00000000000000008ae603dce419deaac37d13cb56c3c43a1bc2950029 --mnemonics --input f8a8fd6d
The corresponding control flow graph is as follow, we can observe an infinite loop in blocks 0x4f, 0x6c, 0x74.
abnormal_storage_TestLoop
The corresponding opcode sequences is as follow,
storage_opcode_sequences

We provide enough gas limit when run two piece of bytecode both contain an infinite loop, but aleth run normally for one and throws OutOfMemoryErrors for another one. This corner cases may expose a bug in aleth's EVM implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions