lispstack-overflowcommon-lispmcl

Increase Minimum Stack Overflow Size in Mac Common Lisp 5.0


I'm relatively new to Lisp (I just know the very basics) and I'm currently trying to run an algorithmic composition program created by David Cope. It runs in MCL 5.0, and I keep getting the following error:

Error in process play: Stack overflow on value stack. To globally increase stack space, increase *minimum-stack-overflow-size*

Does anyone know what function I would use to increase the stack overflow size and how I would calculate the best stack overflow size for my computer? I'm running MCL on an old Powerbook with 512 MB of RAM.

Thanks for your time,

Eddie


Solution

  • It seems to say that you simply need to modify the special variable *minimum-stack-overflow-size*. When you are at the REPL (CL-USER> prompt or similar), inspect this variable by evaluating its name:

    CL-USER> *minimum-stack-overflow-size*
    

    Then, set it to a bigger value (the 1234567 is just a placeholder) with setf:

    CL-USER> (setf *minimum-stack-overflow-size* 1234567)
    

    However, this might not be the real issue. I do not know MCL well, but it might be necessary to (declaim (optimize (speed 3) (safety 0))) or similar to enable tail call elimination, if the program you want to run uses a tail recursive function which depends on such optimization.