Subject: [clisp-list] Lisp stack overflow. What to do?

From: Pascal Bourguignon <[email-masked]>
Date: Mon Sep 30 03:54:01 2002

*** - Lisp stack overflow. RESET

How can one increase the stack size?

Is the limits-stack function related to this?

How should it be used?

Where is  there anymore documentation about  clisp implementation than
the meager file:///usr/share/doc/packages/clisp/impnotes.html ?

-- 
__Pascal_Bourguignon__                   http://www.informatimago.com/
----------------------------------------------------------------------
 The name is Baud,...... James Baud.

---

From: Sam Steingold <[email-masked]>
Date: Mon Sep 30 06:38:01 2002

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Lisp stack overflow. What to do?"
> * Sent on Mon, 30 Sep 2002 12:51:57 +0200 (CEST)
> * Honorable Pascal Bourguignon <[email-masked]> writes:
>

read the manual for your stack (e.g., 'ulimit -s unlimited')
do not use infinite recursion.

> Where is there anymore documentation about clisp implementation than

<http://clisp.cons.org>
CLISP sources doc/*
CLISP sources unix/*
etc

> the meager file:///usr/share/doc/packages/clisp/impnotes.html ?

you gotta be kidding. 1 MB of docs is "meager"?

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
usually: can't pay ==> don't buy. software: can't buy ==> don't pay

---

From: Pascal Bourguignon <[email-masked]>
Date: Mon Sep 30 08:32:01 2002

> From: Sam Steingold <[email-masked]>
> Date: 30 Sep 2002 09:36:49 -0400
> 

I already have it unlimited:

[pascal@thalassa tmp]$ ulimit -s
unlimited

and  I don't  use infinite  recursion. If  I can  count the  number of
recursions on my hand (in binary), it's definitely not infinite.

In addition, it says:
[20]> (posix:resource-usage-limits)
#S(USAGE :USER-TIME 0.09d0 :SYSTEM-TIME 0.01d0 :MAX-RSS 0 :INT-RSS 0 :MINOR-PAGE-FAULTS 538 :MAJOR-PAGE-FAULTS 506 :NUM-SWAPS 0
   :BLOCKS-INPUT 0 :BLOCKS-OUTPUT 0 :MESSAGES-SENT 0 :MESSAGES-RECEIVED 0 :SIGNALS 0 :CONTEXT-SWITCHES-VOLUNTARY 0
   :CONTEXT-SWITCHES-INVOLUNTARY 0) ;
#S(USAGE :USER-TIME 0.0d0 :SYSTEM-TIME 0.0d0 :MAX-RSS 0 :INT-RSS 0 :MINOR-PAGE-FAULTS 0 :MAJOR-PAGE-FAULTS 0 :NUM-SWAPS 0 :BLOCKS-INPUT 0
   :BLOCKS-OUTPUT 0 :MESSAGES-SENT 0 :MESSAGES-RECEIVED 0 :SIGNALS 0 :CONTEXT-SWITCHES-VOLUNTARY 0 :CONTEXT-SWITCHES-INVOLUNTARY 0) ;
#S(LIMITS :CORE 0:NIL :CPU NIL:NIL :HEAP NIL:NIL :FILE-SIZE NIL:NIL :NUM-FILES 1024:1024 :STACK NIL:NIL :VIRT-MEM NIL :RSS NIL:NIL
   :MEMLOCK NIL:NIL)

Clearly, it's a problem with clisp, not with unix.

With emacs, I set
        (let ((max-lisp-eval-depth 10000)
              (max-specpdl-size 10000))
              ...)
and it's working.

> > Where is there anymore documentation about clisp implementation than

Ok, "Use  the source,  Luke!". But the  problem with sources,  is that
they can change.   The documentation can specify an  inmutable API and
its contract, the sources can't.

> you gotta be kidding. 1 MB of docs is "meager"?

No  kidding.  Where is  the doc  of LIMITS-STACK,  and of  hundreds of
other functions not specified in CLHS?

No kidding.   Even for the  functions that are documented,  it's quite
imprecise.   For   example  you  can't  know  from   the  doc  whether
ext:run-program runs it  asynchronously or not. You only  know that it
"runs an  external program", and you  have to spend time  to write and
test a small program to know  it. It doesn't even specify the defaults
for :input and  :output when they're not given.   Compare with the doc
of emacs  shell-command which gives 10% more  information, and precise
the  asynchronous  or  synchronous  processing, and  the  input/output
coding systems in addition to the equivalent arguments.

---

From: Sam Steingold <[email-masked]>
Date: Mon Sep 30 09:06:03 2002

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] Lisp stack overflow. What to do?"
> * Sent on Mon, 30 Sep 2002 17:30:29 +0200 (CEST)

do you print circular objects?
if yes, you should set *print-circle* to T.

you can also explore `-m' option.

>  Where is  the doc  of LIMITS-STACK,  and of  hundreds of

what is LIMITS-STACK?

> No kidding.

we always welcome patches and specific bug reports.  please pitch in.

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat7.3 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Bus error -- please leave by the rear door.