Skip to content
Tcl Source Code View Ticket
Login

View Ticket

MAX_NESTING_DEPTH is not useful

Closed / Fixed232564ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2001-02-15 18:06:12
The MAX_NESTING_DEPTH is set in tclInt.C, however in tclBasic.c, the iPtr->maxNestingDepth is set 1000 directly.
in Tcl_SetRecursionLimit, there is no checking for the parameter which could be huge, would cause problems
msofer Ticket [232564ffff]: 3 changes [History diff]2001-03-23 23:50:25
msofer Ticket [232564ffff]: 1 change [History diff]2001-04-07 10:52:30
msoferplain2001-08-14 21:03:29
Logged In: YES 
user_id=148712

Fixed: tclCreateInterp now uses MAX_NESTING_DEPTH.

The problems generated by a huge recursion limit are not
trivial:

  - C-stack overflows are catched by TclpCheckStackSpace(),
which is currently not implemented in unix but should work
in Mac and Win. The man page for Tcl_SetRecursionLimit
specifically warns about this possibility. I am filing a
Feature Request for implementation in unix [#450795]

  - if there is insufficient memory for the tcl stack, there
is a memory allocation error
Log in (anonymous is fine) to add a comment.