Closed jefft0 closed 1 day ago
I agree with the solution from @thehowl. Since he is working on it already, i'll take this opportunity to improve the String()
method on the Machine
struct because it looks very rugged.
@petar-dambovaliev BTW I haven't taken up on it, I troubleshot the issue because I was pointed at it, but the actual implementation of the stacktraces will take quite some work
You're welcome to take up on this if you want to
In a dev call, it was suggested that https://github.com/gnolang/gno/pull/1994 could fix this issue. It does not. The test still hangs in the txtar of https://github.com/gnolang/gno/pull/1736 .
Closing this tracking issue to focus on the PR with the txtar that demonstrates the bug. https://github.com/gnolang/gno/pull/1736
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.)"