Odd stack warnings during runtime? (solved, problem was logicmoo)

SOLUTION: (I’m leaving this post here in case it helps someone else. I lost several hours chasing this one.) The whole problem stemmed from the fact that I typed in term_to_string/2 in two places in my code instead of term_string/2. Unfortunately, somehow I installed the logicmoo package, or something else did. Apparently that package causes SWI-Prolog great trouble when your app reaches a certain complexity. My app ran fine with logicmoo:term_to_string/2 until it reached some complexity threshold. Then I started getting the legion of errors I have reported here. Once I replaced the term_to_string/2 calls with term_string/2, all the problems went away. Perhaps a doc note or warning somewhere might help others avoid this pitfall? Either way, what is the most robust way to purge the logicmoo package from my installation?


I’m using: SWI-Prolog version 8.1.9 on Windows 8.1.

As of now (didn’t happen before), when I consult the files to my app and run the main test predicate that runs a complex “unit test”, I always see the following messages:

Warning: c:/users/robert/appdata/roaming/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_util_common.pl:248:
        set_prolog_stack/2: limit(Size) sets the combined limit.
        See http://www.swi-prolog.org/changes/stack-limit.html
Warning: c:/users/robert/appdata/roaming/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_util_common.pl:248:
        set_prolog_stack/2: limit(Size) sets the combined limit.
        See http://www.swi-prolog.org/changes/stack-limit.html
Warning: c:/users/robert/appdata/roaming/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_util_common.pl:248:
        set_prolog_stack/2: limit(Size) sets the combined limit.
        See http://www.swi-prolog.org/changes/stack-limit.html

What should I do about this? The app runs but I can’t use the graphical debugger because I am getting a ton of status messages dumped to the console when I try tracing the app.

After many iterations of completely reloading SWI-Prolog I narrowed down the elements involved that first triggering the verbosity problems. It appears to start happening when term_to_string calls the on_x_fail predicate

Below is a screen shot from the graphical debugger that is paused on the line of the I’m about to step into, which is a term_to_string() call. Up until this point, the console window is competely clean.

As soon as I step into the term_to_string() call, I see a flurry of messages in the console window:

%  ---> 378: send_pce: result = true([])
% real_thread: main --> main
% GUI = @79888085030/prolog_debugger (from thread main)
% real_thread: main --> main
% real_thread: main --> main
%  ---> 379: send_pce: result = true([])
% real_thread: main --> main
% real_thread: main --> main
% real_thread: main --> main
%  ---> 380: send_pce: result = true([])
% real_thread: main --> main
% real_thread: main --> main
% real_thread: main --> main
% real_thread: main --> main
%  ---> 381: send_pce: result = true([])
%  ---> action: wait
% real_thread: main --> main

Then the graphical debugger is paused on the term_string/2 clause whose body contains a call to on_x_fail/1:

I know that this may not mean anything since it could actually be due to some complex interaction somewhere else in the debugger, but hopefully this helps.

Is there a way to turn this verbose mode off? Currently I can’t use the graphical debugger anymore because of this, once it starts occurring.

NOTE: A select all option in the console window would be a big help. Ctrl-A doesn’t work, and for long printouts, I have to manually select all the text by scrolling continually downward with the mouse wheel so I can cut and paste the content to the forum.

1 Like