swipl-devel icon indicating copy to clipboard operation
swipl-devel copied to clipboard

Graphical debugger and Console hang if `u` pressed on choice point while Prolog waiting for input

Open EricZinda opened this issue 4 years ago • 3 comments

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. ;):

  1. Go to an open choice point in the debugger and press u to (try to) see the stack for the choice point
  2. 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.

EricZinda avatar Nov 09 '20 18:11 EricZinda

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

JanWielemaker avatar Nov 09 '20 18:11 JanWielemaker

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.

JanWielemaker avatar Nov 10 '20 17:11 JanWielemaker

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?

EricZinda avatar Nov 10 '20 18:11 EricZinda