From: skibud2
Subject: Program stack overflow (clisp windows only)
Date: 
Message-ID: <1190736349.282542.99610@k79g2000hse.googlegroups.com>
I have a program that works perfectly fine on my linux box, but gets a
program stack overflow error on my windows machine. Both machines have
comparable specs.

I tried increasing the memory (to 500MB) passed to the windows clisp,
and that did not solve the problem. What is the best way to debug a
issue like this? The program is recursive, although it should not be
running out of space. Also, I am not reading anything from file.

Mike

From: Ken Tilton
Subject: Re: Program stack overflow (clisp windows only)
Date: 
Message-ID: <VmcKi.52$Ac7.18@newsfe12.lga>
skibud2 wrote:
> I have a program that works perfectly fine on my linux box, but gets a
> program stack overflow error on my windows machine. Both machines have
> comparable specs.
> 
> I tried increasing the memory (to 500MB) passed to the windows clisp,
> and that did not solve the problem. What is the best way to debug a
> issue like this? The program is recursive, although it should not be
> running out of space. Also, I am not reading anything from file.

If it is not too complicated, meter your code:

(defparameter *dbg-depth* 0)

Then in any recursive function:

(defun my-recursor (x y z)
    (let ((*dbg-depth* (1+ *dbg-depth*)))
       (when (> *dbg-depth* <insert unreasonable value>)
          (break "too deep"))
       ...normal code here))

No need to decrement, given the wonders of special variables.

At the top of your test code (setf *dbg-depth* 0) tho you should not 
have to if you abort all backtraces so the bindings unwind.

If the metering looks onerous, try your first macro 
WITH-LIMITED-RECURSION-DEPTH.

kenny


-- 
http://www.theoryyalgebra.com/

"We are what we pretend to be." -Kurt Vonnegut
From: skibud2
Subject: Re: Program stack overflow (clisp windows only)
Date: 
Message-ID: <1190745964.745182.195350@w3g2000hsg.googlegroups.com>
Well, it dies after 380 recursive calls. I am assuming that I need to
increase the stack size. The link on the clisp site is broken. Does
anyone have any good information on how to do this?

Mike


On Sep 25, 2:21 pm, Ken Tilton <···········@optonline.net> wrote:
> skibud2 wrote:
> > I have a program that works perfectly fine on my linux box, but gets a
> > program stack overflow error on my windows machine. Both machines have
> > comparable specs.
>
> > I tried increasing the memory (to 500MB) passed to the windows clisp,
> > and that did not solve the problem. What is the best way to debug a
> > issue like this? The program is recursive, although it should not be
> > running out of space. Also, I am not reading anything from file.
>
> If it is not too complicated, meter your code:
>
> (defparameter *dbg-depth* 0)
>
> Then in any recursive function:
>
> (defun my-recursor (x y z)
>     (let ((*dbg-depth* (1+ *dbg-depth*)))
>        (when (> *dbg-depth* <insert unreasonable value>)
>           (break "too deep"))
>        ...normal code here))
>
> No need to decrement, given the wonders of special variables.
>
> At the top of your test code (setf *dbg-depth* 0) tho you should not
> have to if you abort all backtraces so the bindings unwind.
>
> If the metering looks onerous, try your first macro
> WITH-LIMITED-RECURSION-DEPTH.
>
> kenny
>
> --http://www.theoryyalgebra.com/
>
> "We are what we pretend to be." -Kurt Vonnegut
From: skibud2
Subject: Re: Program stack overflow (clisp windows only)
Date: 
Message-ID: <1190752689.985928.257600@y42g2000hsy.googlegroups.com>
So I tried everything in the following e-mail list. I also randomly
called the garbage collector.
http://sourceforge.net/mailarchive/message.php?msg_id=3D2600BB.1CDBE9D0%40freenet.de

Still no luck. Has anyone increased the stack size for clisp on
Windows?


On Sep 25, 2:46 pm, skibud2 <·············@gmail.com> wrote:
> Well, it dies after 380 recursive calls. I am assuming that I need to
> increase the stack size. The link on the clisp site is broken. Does
> anyone have any good information on how to do this?
>
> Mike
>
> On Sep 25, 2:21 pm, Ken Tilton <···········@optonline.net> wrote:
>
> > skibud2 wrote:
> > > I have a program that works perfectly fine on my linux box, but gets a
> > > program stack overflow error on my windows machine. Both machines have
> > > comparable specs.
>
> > > I tried increasing the memory (to 500MB) passed to the windows clisp,
> > > and that did not solve the problem. What is the best way to debug a
> > > issue like this? The program is recursive, although it should not be
> > > running out of space. Also, I am not reading anything from file.
>
> > If it is not too complicated, meter your code:
>
> > (defparameter *dbg-depth* 0)
>
> > Then in any recursive function:
>
> > (defun my-recursor (x y z)
> >     (let ((*dbg-depth* (1+ *dbg-depth*)))
> >        (when (> *dbg-depth* <insert unreasonable value>)
> >           (break "too deep"))
> >        ...normal code here))
>
> > No need to decrement, given the wonders of special variables.
>
> > At the top of your test code (setf *dbg-depth* 0) tho you should not
> > have to if you abort all backtraces so the bindings unwind.
>
> > If the metering looks onerous, try your first macro
> > WITH-LIMITED-RECURSION-DEPTH.
>
> > kenny
>
> > --http://www.theoryyalgebra.com/
>
> > "We are what we pretend to be." -Kurt Vonnegut
From: Eli Bendersky
Subject: Re: Program stack overflow (clisp windows only)
Date: 
Message-ID: <1190795952.468846.90880@22g2000hsm.googlegroups.com>
On Sep 25, 10:38 pm, skibud2 <·············@gmail.com> wrote:
> So I tried everything in the following e-mail list. I also randomly
> called the garbage collector.http://sourceforge.net/mailarchive/message.php?msg_id=3D2600BB.1CDBE9...
>
> Still no luck. Has anyone increased the stack size for clisp on
> Windows?
>
> On Sep 25, 2:46 pm, skibud2 <·············@gmail.com> wrote:
>
> > Well, it dies after 380 recursive calls. I am assuming that I need to
> > increase the stack size. The link on the clisp site is broken. Does
> > anyone have any good information on how to do this?
>
> > Mike
>
> > On Sep 25, 2:21 pm, Ken Tilton <···········@optonline.net> wrote:
>
> > > skibud2 wrote:
> > > > I have a program that works perfectly fine on my linux box, but gets a
> > > > program stack overflow error on my windows machine. Both machines have
> > > > comparable specs.
>
> > > > I tried increasing the memory (to 500MB) passed to the windows clisp,
> > > > and that did not solve the problem. What is the best way to debug a
> > > > issue like this? The program is recursive, although it should not be
> > > > running out of space. Also, I am not reading anything from file.
>

I've had the same problem with CLISP on windows. When you write a tail-
recursive function, it can stack overflow, but only when interpreted.
If you compile it, it works fine. This is because CLISP runs the tail-
call optimization only during compilation. With a general recursive
function, however, there's no wonder solution. CLISP really has an
annoying limitation here.

Eli
From: Leandro Rios
Subject: Re: Program stack overflow (clisp windows only)
Date: 
Message-ID: <46fa4ad4$0$1348$834e42db@reader.greatnowhere.com>
skibud2 escribi�:
> So I tried everything in the following e-mail list. I also randomly
> called the garbage collector.
> http://sourceforge.net/mailarchive/message.php?msg_id=3D2600BB.1CDBE9D0%40freenet.de
> 
> Still no luck. Has anyone increased the stack size for clisp on
> Windows?
> 
> 
> On Sep 25, 2:46 pm, skibud2 <·············@gmail.com> wrote:
>> Well, it dies after 380 recursive calls. I am assuming that I need to
>> increase the stack size. The link on the clisp site is broken. Does
>> anyone have any good information on how to do this?
>>

Perhaps you already have seen this:

http://article.gmane.org/gmane.lisp.clisp.general/5523

It's pretty old, but may give you a hint.

Leandro
From: Rainer Joswig
Subject: Re: Program stack overflow (clisp windows only)
Date: 
Message-ID: <joswig-8068A0.18193725092007@news-europe.giganews.com>
In article <·······················@k79g2000hse.googlegroups.com>,
 skibud2 <·············@gmail.com> wrote:

> I have a program that works perfectly fine on my linux box, but gets a
> program stack overflow error on my windows machine. Both machines have
> comparable specs.
> 
> I tried increasing the memory (to 500MB) passed to the windows clisp,
> and that did not solve the problem. What is the best way to debug a
> issue like this? The program is recursive, although it should not be
> running out of space. Also, I am not reading anything from file.
> 
> Mike

Did you try to increase the stack size?

CLISP specific questions are best ask on the CLISP mailing list.

http://clisp.cons.org/impnotes.html has a section on

"A.4.5.  How do I avoid stack overflow?"
  "...
 Platform Dependent: Win32 platform only.
 modify SYSTEM.INI or change PIF that you use to invoke CLISP or
 set program stack using editbin
"

Unfortunately the references to messages on sourceforge or
wrong...

-- 
http://lispm.dyndns.org