Debugging output for "bad application of execConst" should not use show
#2197
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.
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
. Callingshow
on anEnv
can result in a ton of output, even exponentially much, because we lose sharing --- especially if some of the bindings in theEnv
are closures which themselves containEnv
s, 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 callingshow
on anything to generate output that will be shown in error messages.The text was updated successfully, but these errors were encountered: