Machine.String()
hangs the VM on error when printing large structure
#1981
Milestone
Machine.String()
hangs the VM on error when printing large structure
#1981
Description
If a transaction fails, for example running out of gas, the VM prints the state with
Machine.String()
. If the state has a large recursive structure, like an avl.Tree(), this can hang the VM as it constructs the string. Please see the analysis here.Your environment
Steps to reproduce
Please see PR #1736 which has a txtar to reproduce the bug and has analysis of the root cause.
Expected behaviour
On error, the VM should print a useful error message.
Actual behaviour
The VM attempts to dump the entire machine state, even if there is a large recursive data structure.
Proposed solution
This comment proposes to "switch from doing
Machine.String()
to printing a stacktrace. (This is likely to be more useful and parseable information by the programmer anyway.)"The text was updated successfully, but these errors were encountered: