# Gui debugger freezing and windows 10

**URL:** <https://swi-prolog.discourse.group/t/gui-debugger-freezing-and-windows-10/3720>\
**Category:** Help!\
**Created:** [March 15, 2021, 9:57am UTC](https://swi-prolog.discourse.group/t/gui-debugger-freezing-and-windows-10/3720 "2021-03-15T09:57:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Perne](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Perne](https://swi-prolog.discourse.group/u/Perne)\
**Post date:** [March 15, 2021, 9:57am UTC](https://swi-prolog.discourse.group/t/gui-debugger-freezing-and-windows-10/3720/1 "2021-03-15T09:57:28Z")

</div>

Hi, I am trying to adapt some code I wrote maybe 10 years ago using a few xpce dialogs. Operating system Win XP sp3, swi-prolog version 6.6.4. The gui debugger/tracer works as expected in that environment, even with my simple dialogs. Now I want to revive this code for windows 10 and maybe linux with the latest swi-prolog. However there seems to be something fundamental about the debugger that I don’t understand:  
Each time I want to jump over these few dialogs everything freezes and I have to stop swi-prolog using the task manager. I tried in windows 7 with similar result. Any idea what I might be doing wrong?  
Per

---

<div class="post-metadata">

**Author:** ![Perne](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Perne](https://swi-prolog.discourse.group/u/Perne)\
**Post date:** [March 20, 2021, 8:17am UTC](https://swi-prolog.discourse.group/t/gui-debugger-freezing-and-windows-10/3720/3 "2021-03-20T08:17:02Z")

</div>

I made a simple test with the gui-debugger. Loaded the source code for “constraint-demo” in the xpce examples that comes with Swi-prolog, put “gtrace” in the code and executed the predicate. With version 6.6.4 (32-bit, win XP) the gui tracer works as expected. With version 8.2.4 (64-bit, win 10) the gui-tracer hangs. Maybe this is a 32-bit versus 64-bit problem? I searched the forum and did not find any clue. Will test with latest 32-bit version under win 10 and report again.

---

<div class="post-metadata">

**Author:** ![Perne](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Perne](https://swi-prolog.discourse.group/u/Perne)\
**Post date:** [March 20, 2021, 8:38am UTC](https://swi-prolog.discourse.group/t/gui-debugger-freezing-and-windows-10/3720/4 "2021-03-20T08:38:43Z")

</div>

Hangs with 32-bit version too unfortunately. Should I file a bug?

---

<div class="post-metadata">

**Author:** ![Perne](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Perne](https://swi-prolog.discourse.group/u/Perne)\
**Post date:** [March 20, 2021, 9:15am UTC](https://swi-prolog.discourse.group/t/gui-debugger-freezing-and-windows-10/3720/5 "2021-03-20T09:15:11Z")

</div>

One more test: gtrace of “constraint\_test” works for me under linux 64-bit. Swi-prolog version 8…2…2.

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [March 20, 2021, 11:05am UTC](https://swi-prolog.discourse.group/t/gui-debugger-freezing-and-windows-10/3720/6 "2021-03-20T11:05:58Z")

</div>

Seems you are trying to trace xpce programs. Running xpce programs is a bit harder since xpce by default runs in a thread (`pce`). This allows using the development tools while your query is running. For what you seem to be doing it may make sense to call

```
?- set_prolog_flag(xpce_threaded, false).

```

Make sure to set this before making any xpce call or even load the library. You can verify this flag did is work by running

```
?- threads.

```

and verify `pce` is not listed.

As the thread model for Windows and Linux wrt graphics handling is quite different the impact of using xpce with multiple threads varies. As a rule of thumb, do not use xpce from multiple threads. To some extend it works, but it deadlocks easily. There are no plans to fix that.
