Gerhard Niklasch on Sat, 16 Oct 1999 22:41:19 +0200 (MET DST)

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: infinite recursion?

In response to
> Message-Id: <>
> Date: Sat, 16 Oct 1999 16:16:47 -0400 (EDT)
> From: Michael Somos <>

> gp> f(n)=f(n-1)
> gp> f(0)
> I am sorry if this is a FAQ, but in the case of an obvious infinite
> loop if I "control C" it, I get silently dumped back to the shell.
> I guess this is better than a core dump, but is there any way to get
> control again and not lose the sessions?

Something is strange here.  Yes, you are supposed to get back at
the gp prompt... *if* you hit control-C fast enough.  Note that this
is indeed an infinite recursion, not an infinite loop, and gp is
consuming parts of its memory at a furious rate here.

Just tried this on sparc/Solaris where the process got a segmentation
fault after a few seconds.  Then tried it on my old Linux (1.2.8) box
where I had some difficulty killing the runaway process -- it seemed
to be allocating extra memory.  Both gp's had been built from the same
sources  (just pre-2.0.17), and both were running with default 4E6
stack size.  Neither behaviour is entirely convincing to me.  I'd
prefer the parser to stop with an error message when it runs out of
space, and not (as it appeared to be doing) scribble over other parts
of gp's memory...

Cheers, Gerhard