Open ggrieco-tob opened 5 years ago
The problem occurs only if extcodesize
is executed in a constructor.
The code to reproduce the issue can be boiled down to:
contract C {
constructor(address x) public {
uint size;
assembly {
size := extcodesize(x)
}
}
}
If we change constructor
to function aa
manticore runs as expected.
For the example above we end up having 4 states. Each of them executed the same instructions and ended up with RETURN:
The code I used to debug it:
from manticore.ethereum import ManticoreEVM
from manticore.core.plugin import Tracer
m = ManticoreEVM()
m.verbosity(4)
m.register_plugin(Tracer())
m.multi_tx_analysis('issue1315.sol')
m.finalize()
I am not sure what can we do here. It seems to be a great candidate for path merging as there are no branches or side effects here?
OS / Environment
Distributor ID: ArchLinux Description: ArchLinux Release: rolling-release
Manticore version
Last revision (4cb7e3b33e601ce30da508b603dcd4bcc24af18e)
Python version
Python 3.6.6
Summary of the problem
Manticore crashes when with a contract using
extcodesize
.Step to reproduce the behavior
This is a solidity contract to reproduce this issue:
Expected behavior
It shouldn't fail.
Actual behavior