You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I'm not proposing this as a solution, but more as an illustration of a simple approach to bounding the recursion. Other options include making more use of the heap, trying to see if tail recursion makes a difference, etc...)
In general, it's probably acceptable to have the default behaviour of the parser to be "unbounded" (i.e.: use whatever the environment provides). It's also often acceptable (if not ideal) to have the parser fail with a stack overflow, because it's not part of a long running service and users can handle such failure manually.
For certain resource constrained scenarios, this is unacceptable, because service failure is very serious.
My proposal would be to consider introducing a bounded execution mode for the parser (or make bounded execution the single behaviour if desired). I'm not sure what the API for this would look like, so it would certainly require some discussion and I'm happy to participate in figuring out the best way to address this.
Summary:
Parser assumes infinite resources
Parser should not make this assumption either in bounded execution mode or for all invocations
Main use case is embedding the parser in long running services that cannot fail
The text was updated successfully, but these errors were encountered:
Description
It's relatively easy to cause the parser to execute into a stack overflow. For example, something like:
Once you start getting up to the tens of thousands, you will hit a stack overflow. This particular query triggers a recursion in
A simple remediation looks like:
(I'm not proposing this as a solution, but more as an illustration of a simple approach to bounding the recursion. Other options include making more use of the heap, trying to see if tail recursion makes a difference, etc...)
In general, it's probably acceptable to have the default behaviour of the parser to be "unbounded" (i.e.: use whatever the environment provides). It's also often acceptable (if not ideal) to have the parser fail with a stack overflow, because it's not part of a long running service and users can handle such failure manually.
For certain resource constrained scenarios, this is unacceptable, because service failure is very serious.
My proposal would be to consider introducing a bounded execution mode for the parser (or make bounded execution the single behaviour if desired). I'm not sure what the API for this would look like, so it would certainly require some discussion and I'm happy to participate in figuring out the best way to address this.
Summary:
The text was updated successfully, but these errors were encountered: