-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Machine.String()
hangs the VM on error when printing large structure
#1981
Comments
Machine.String()
hangs the VM when printing error Machine.String()
hangs the VM on error when printing large structure
I agree with the solution from @thehowl. Since he is working on it already, i'll take this opportunity to improve the |
Make the `String` method on the `Machine` struct faster by preallocating a string builder. [issue](#1981)
@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 |
Closing this tracking issue to focus on the PR with the txtar that demonstrates the bug. #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.)"The text was updated successfully, but these errors were encountered: