swipl-devel
swipl-devel copied to clipboard
Graphical debugger and Console hang if `u` pressed on choice point while Prolog waiting for input
SWI-Prolog version (threaded, 64 bits, version 8.2.1) on a Mac.
In the graphical debugger while the engine is waiting for a user response after the first answer to a query (i.e. ;
):
- Go to an open choice point in the debugger and press
u
to (try to) see the stack for the choice point - Notice that the graphical debugger and Prolog hang. The only way I've found to exit is to force the system to kill the processes.
Program:
foo(bar).
foo(baz).
At this point, switch to graphical debugger and press u
on the foo/1
choice point:
?- gtrace, foo(X).
X = bar
Happens with several different queries I've tried, this is just the simplest one.
This issue has been mentioned on SWI-Prolog. There might be relevant details there:
https://swi-prolog.discourse.group/t/graphical-debugger-call-stack-pane-significance-of-arrow-sides-and-gaps-in-the-stack/3232/8
Thanks. This does reproduce. Not yet sure there is a reasonable solution. It gets into a deadlock on the global xpce lock :cry: Unlike SWI-Prolog itself, the graphics subsystem is basically single-threaded.
I've noticed that this doesn't seem to happen if I try pressing the toolbar buttons in the same state because they seem to be disabled. Could something similar be done with text commands?