Jump to content

[SOLVED] Error handling with infinite recursion


photo

Recommended Posts

We experience a situation where we accidentally had an infinite recursion in script. Naturally this resulted in a stack overflow, as it would do in C++ as well. However debugging this to find out where it came from turned out to be kinda tricky, as no callstack is created from the script functions during a stack overflow (as it does for most other script runtime errors). Basically the only way to resolve this is to put logspamming in all functions and follow them until you get to the function that is called but never returns. In our case it was luckily only 3 functions deep since the last extern function call we saw in the C++ callstack, but there are situations where the callstack is a lot deeper then that in our code. Would it be possible to somehow get the callstack from the script functions on a stack overflow? The functionality is there (if Interpreter::error is called to report the error), but stack errors are simple asserts in C++ and don't trigger the trace function.

Link to comment
  • 2 months later...
×
×
  • Create New...