On Thu, 17 Jan 2002 13:15:51 -0600, Rob Mayoff <[EMAIL PROTECTED]> wrote:

>+---------- On Jan 17, Daniel P. Stasinski said:
>> My second suggestion was meant as humor.  The reason that your
>> server crashes is because your code is flawed.
>
>Obviously his infinite-recursion example will always fail in some way.
>But his real code might not recurse infinitely.  It might simply need to
>recurse to a greater depth than the default stack size allows.  In that
>case, increase the stack size is the correct solution.

The infinite-recursing code as originally written should work, because catch
is supposed to catch errors.  And if you run tclsh and try the code, it does
the right thing, which is to generate a tcl exception when the recursion
goes too deep (which is 1000 levels by default).

The problem is really a configuration bug in AOLserver, where the default
stacksize is not enough to accomodate the max size of the tcl stack.

Two possible fixes:  set the default tcl recursion limit lower, or patch the
code so that TclpCheckStackSpace() calls NsTclCheckStackSpace(), which is
there for exactly this problem.  This is done in in the tcl7.6 core, but not
8.x as its just the basic tcl distrib unpatched.

-J

Reply via email to