Re: SWI-Prolog : Out Of Local Stack



On 2006-09-17, roschler <robert.oschler@xxxxxxxxx> wrote:
I have a DCG predicate that gets a "out of local stack" error when I
try to trace it in the graphical debugger, but works properly when I'm
not in debugging. I read in the manual that can happen because last
call optimization is turned off in the graphical debugger.

It appears to happen due to a dynamically built predicate call. If I
surround that dynamically built predicate call with call/1, then the
graphical debugger works fine. I have no problem using call/1, but if
there are any issues I need to be concerned with by using call/1, then
please let me know. If there's a good page that discusses the issues
between using call/1 and not using it, just point me to it.

There's something about the naked PredCall that causes the DCG
predicate 'C' to have problems when running in the graphical debugger.

x(WordlistFunctor) -->
% Try taking a three words and testing them as a single atom against
the desired predicate.
[W1, W2, W3],
{ concat_all([W1, W2, W3], Matched) ,
PredCall =.. [WordlistFunctor, Matched],
% PredCall, - this will cause an "out of local stack" error with the
graphical debugger.
call(PredCall) % this is OK
},
!.

call(PredCall) is certainly not better than simply PredCall. Looks like
a bug in the debugger. Please report, preferably to the SWI-Prolog
bugzilla system. Include a *complete* program, not just a snippet. Also
include the version, as there have been some recent changes to the
debugger.

--- Jan
.