Skip to content
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

Debugging output for "bad application of execConst" should not use show #2197

Open
byorgey opened this issue Oct 21, 2024 · 0 comments
Open
Labels
C-Low Hanging Fruit Ideal issue for new contributors. L-Pretty-printing Pretty-printing ASTs or values into a string representation. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-Feature A new feature to be added to the game.

Comments

@byorgey
Copy link
Member

byorgey commented Oct 21, 2024

Is your feature request related to a problem? Please describe.
Occasionally we encounter a bug that triggers the dreaded "bad application of execConst" error (e.g. #2186, #2068, #977, #211, probably others). Although this always signals a bug in Swarm (typically in the typechecker or CESK machine), and users would ideally never see it, it does occasionally happen.

Recently in #2186 @xsebek reported causing the game to freeze due to what turned out to be a type error in a recursive function (see fix in #2187). After some investigation, my current hypothesis is that it actually encountered a "bad application of execConst" exception, and then froze while trying to print out a massive Env. Calling show on an Env can result in a ton of output, even exponentially much, because we lose sharing --- especially if some of the bindings in the Env are closures which themselves contain Envs, and so on.

Describe the solution you'd like
Ideally, we should put effort into displaying Env values in a better way for debugging purposes, but that can be a different issue. What I am concerned with here is that we simply should not be calling show on anything to generate output that will be shown in error messages.

@byorgey byorgey added Z-Feature A new feature to be added to the game. C-Low Hanging Fruit Ideal issue for new contributors. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. L-Pretty-printing Pretty-printing ASTs or values into a string representation. labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. L-Pretty-printing Pretty-printing ASTs or values into a string representation. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-Feature A new feature to be added to the game.
Projects
None yet
Development

No branches or pull requests

1 participant