Page 1 of 1

B A T C H R E C U R S I O N exceeds STACK limits

Posted: 01 Aug 2019 16:24
by SirJosh3917
Hi, I recently got this message printed to me - is this documented anywhere? is this known?

Image

This message I did not write:

Code: Select all

******  B A T C H   R E C U R S I O N  exceeds STACK limits ******
Recursion Count=593, Stack Usage=90 percent
******       B A T C H   PROCESSING IS   A B O R T E D      ******

Re: B A T C H R E C U R S I O N exceeds STACK limits

Posted: 01 Aug 2019 20:44
by ShadowThief
This happens when you've got setlocal in a loop somewehere. According to that error message, your script ran setlocal without endlocal 593 times.

Re: B A T C H R E C U R S I O N exceeds STACK limits

Posted: 02 Aug 2019 01:01
by jeb
Hi,

the error is not related to setlocal, but to the call stack.
Probably you have a recursion in your code, like

Code: Select all

:recursion
call :recursion

Re: B A T C H R E C U R S I O N exceeds STACK limits

Posted: 06 Aug 2019 08:10
by Looge
Batch recursion can be caused by various means, but essentially you ...

... well, have a batch recursion. Somewhere.

I occasionally hit that problem, and in my case it always is this:
I have a big collection of scripts, and a very limited set of them are scripts that called by others, but do not do many calls on themselves.
These are sort of small but essential basic scripts, that are often called in the start of a lot of other "normal" scripts.
If then I make a change in such a special script, calling another script, I end up calling a regular script, that starts with calling the script that was the caller in the first place.
And yes, if the call is unconditional ... that's how I create batch recursions.