# Ann: SWI-Prolog 9.0.4 (stable)

**URL:** <https://swi-prolog.discourse.group/t/ann-swi-prolog-9-0-4-stable/6135>\
**Category:** Releases\
**Created:** [January 27, 2023, 9:53am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-0-4-stable/6135 "2023-01-27T09:53:31Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [January 27, 2023, 9:53am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-0-4-stable/6135/1 "2023-01-27T09:53:31Z")

</div>

Dear SWI-Prolog user,

SWI-Prolog 9.0.4 (stable) is ready for download. In the stable release  
we only deal with fixes, documentation and portability issues. An  
exception is the Emacs _sweep_ mode, which we simply keep update for the  
time being. This release also includes the Redis extensions to connect  
to TLS enabled servers and talk to Redis “Sentinel” servers.

This release includes a number of urgent fixes, incorrect results,  
crashes and deadlocks. Please scan the ChangeLog below for details.

```
Enjoy --- Jan

```

# SWI-Prolog Changelog since version 9.0.3

- TEST: Run unsafe thread\_wait tests only if `SWIPL_TEST_FAIL_ON_UNLIKELY` is set to `y`.

- FIXED: `1Inf` should be invalid syntax.

- DOC: Foreign language details. Notable PL\_raise\_exception().

- FIXED: With `float_undefined` set to `nan`, `0/0` must return NaN.

- FIXED: with\_output\_to/3 to flush the streams before finishing the  
capture.

- ADDED: Sdprintf() and friends to accept the `t` integer size specified  
for `ptrdiff_t`.

- FIXED: Allow signal handling and e.g. call\_with\_time\_limit/2 on raw  
terminal input.

- FIXED: ansi\_hyperlink/3. Also unify ansi\_hyperlink/3 and  
ansi\_hyperlink/2.

- FIXED: trace/2 using -all to stop considering the predicate traced.

- FIXED: prolog\_stack\_frame\_property/2 for the predicate property.

- FIXED: Windows: string\_length/2 did not handle UTF16 surrogate pairs  
correctly.

- DOC: Document PL\_write\_term()

- FIXED: Possible deadlock in a transaction commit due to different  
ordering in locking L\_GENERATION and L\_PREDICATE locks.

- DOC: fix minor typo

- FIXED: Issue#195: cmpFloatNumbers() for NaN.

- FIXED: Implement A\_MPZ and A\_MPQ instructions when using LibBF  
binding. This fixes using such numbers in expressions compiled with  
optimization enabled. Reported by Rick Workman.

- FIXED: Issue#1091: optimised compilation of clauses containing big  
integers or rational numbers in expressions.

- FIXED: Issue#1092: term\_hash/2,4 crashes on Unicode strings.

- ADDED: list\_debug\_topics/1 to search, only print active topics,  
etc. This predicate now uses print\_message/2. debugging/0 is hooked  
to show the active topics.

- ADDED: debugging/0: allow extensions using  
`prolog_debug_tools:debugging_hook/0`

- DOC: Fixed PL\_Q\_CATCH\_EXCEPTION interaction with the debugger.

- DOC: Reviewed and updated foreign language sections on exception  
handling. Thanks to Peter Ludemann for pointing the many parts of  
the docs that were unclear or outdated.

- DOC: Added some details for PL\_exception()

- FIXED: Issue#1087: crash on inlined unification against a rational  
number.

- DOC: rational/1 and rationalize/1 use current notation.

- PORT: msys2, add `%MINGW_PREFIX%/bin` to dll path

- PORT: msys2, do not copy system dlls into home

- ADDED: Prolog flag `msys2` to detect the MSYS2 installation.

## Package archive

- PORT: Simply use int64\_t as older 3.x libarchive versions do not  
define la\_int64\_t. Simply using `int64_t` seems the easiest way out.

## Package clib

- FIXED: uri\_iri/2 to not decode encoding `&=;` in the query string.

- FIXED: detach\_IO/1: Protect I/O stream against garbage collection.

## Package http

- FIXED: `1Inf` → `1.0Inf` syntax.

- ENHANCED: More robust restoring of current output after redirection  
to the CGI stream.

- ADDED: library(http/http\_error): dynamic predicate  
http\_error:suppress\_code/1 to make the library silent on specific  
reply codes.

- ENHANCED: Avoid confusing “Unknown message” from library  
http/http\_error.

- FIXED: Avoid recursion when garbage collecting HTTP sessions under  
Redis session management.

- ENHANCED: Do not try to send websocket broadcast messages after  
shutdown progressed too far.

- ADDED: library(http\_unix\_daemon) to broadcast `http(shutdown)` before  
calling `halt(0)`.

- ENHANCED: http\_absolute\_uri/2 to use the setting `http:public_scheme`  
or the port to find the scheme (`http` or `https`)

- ENHANCED: Redis http session plugin to use caching to speedup checking  
whether a session is alive.

- FIXED: Issue#120: term//2 (term to HTML) rendering of infix terms if  
these contain “member” terms with arity 2.

## Package odbc

- PORT: More odbc type work around. As we do not use long [long] int  
sizes or availability, just leave them undefined and let unixODBC do  
its magic.

- PORT: Include patch from Debian for some 32-bit systems. Some versions  
of sql.h depend on `HAVE_LONG_LONG`. Our code does not use any of  
the properties for `long int`.

## Package pldoc

- FIXED: Possible race condition when pldoc is loaded concurrently from  
multiple threads. Hook is installed before the predicates it needs  
are defined.

## Package redis

- ENHANCED: Avoid hanging connection on invalid authentication.

- ADDED: Split authentication for the redis instances from the sentinel  
network.

- FIXED: Also connecting to the sentinels require authentication.

- ADDED: Connect to a master through a sentinel network.

- ADDED: Support Redis TLS connections.

## Package sgml

- FIXED: Back skip over UTF-16. @UweR.

- ENHANCED: Partial support for full Unicode handling ion Windows  
(UTF-16).

- ADDED: Add ignore\_doctype(+Bool) option to explicitly ignore DOCTYPEs  
embedded in XML

## Package ssl

- FIXED: Allow HTTPS server to be started as Interface:Port.

## Package sweep

- DOC: improve documentation for holes

- ADDED: command to pipe output of Prolog goals to Emacs buffers \*  
sweep.c (sweep\_open\_channel(), sweep\_fd\_open()): new helper functions  
for obtaining Prolog streams from Emacs pipe buffers. \* sweep.pl  
(sweep\_async\_goal/2, sweep\_interrupt\_async\_goal/2): new predicates.

- FIXED: possible race condition when signaling new top-level threads

- ENHANCED: consult with library index for finding predicate defs \*  
sweep.pl (sweep\_predicate\_location\_/4): also check library\_index/3.

- FIXED: stale xref data when jumping across files with M-.

- ADDED: right-click context menus in sweeprolog-mode \*  
sweeprolog.el (sweeprolog-context-menu-find-module)  
(sweeprolog-context-menu-find-module-other-window)  
(sweeprolog-context-menu-describe-module)  
(sweeprolog-context-menu-find-file)  
(sweeprolog-context-menu-find-file-other-window)  
(sweeprolog-context-menu-describe-predicate): new commands, add to  
context menus by… (sweeprolog-context-menu-for-predicate)  
(sweeprolog-context-menu-for-module)  
(sweeprolog-context-menu-for-file): new functions, used in…  
(sweeprolog-context-menu-functions): new abnormal hook, used by…  
(sweeprolog-context-menu-function): new function. (sweeprolog-mode):  
add it to context-menu-functions.

- ADDED: short description for tokens on mouse hover (help-echo)

- ENHANCED: improve semantic highlighting for several constructs

- DOC: improve listings in the “Editing Prolog Code” section

- ADDED: command for sending a goal to top-level from any buffer

- DOC: explain how to follow source locations in top-level messages

- MODIFIED: do not force set next-error buffer to Prolog buffer

- ENHANCED: use terms at point as “future history” for term-search \*  
sweep.pl (sweep\_terms\_at\_point/2): new predicate. \* sweeprolog.el  
(sweeprolog-terms-at-point): new function. (sweeprolog-read-term):  
use it for setting the future history. (sweeprolog-read-goal):  
new function. (sweeprolog-term-search): use it for reading a goal  
when called with prefix argument.

- ENHANCED: Support refining term searches with arbitrary goals \*  
sweep.pl (sweep\_term\_search/2): extend with an extra goal argument.

- ENHANCED: restore original point when a term search is quit

- ADDED: command for finding terms subsumed by a given  
term \* sweep.pl (sweep\_term\_search/2): new predicate. \*  
sweeprolog.el (sweeprolog-term-search-in-buffer): new function.  
(sweeprolog-term-search): new command. \* [README.org](http://README.org) (“Term Search”):  
new manual section.

- FIXED: find next predicate definition more reliably

- ADDED: user option to control predicate documentation composition \*  
sweeprolog.el (sweeprolog-insert-pldoc-for-predicate): remove in  
favor of… (sweeprolog-insert-predicate-documentation): new function.  
(sweeprolog-format-term-with-holes): new utility function,  
used by… (sweeprolog-read-predicate-documentation-with-holes)  
(sweeprolog-read-predicate-documentation-default-function):  
new functions, used for…  
(sweeprolog-read-predicate-documentation-function): new user option,  
used by… (sweeprolog-read-predicate-documentation): new function,  
used by… (sweeprolog-document-predicate-at-point): refactor.

- ADDED: New command sweeprolog-insert-term-with-holes \*  
sweep.pl (sweep\_format\_term/2, sweep\_current\_functors/2): new  
predicates. \* sweeprolog.el (sweeprolog-read-functor-history):  
new variable, history list for… (sweeprolog-read-functor):  
new function. (sweeprolog-forward-hole-repeat-mode): rename  
to… (sweeprolog-forward-hole-repeat-map): corrected name  
for keymap. (sweeprolog-analyze-end-font-lock): don’t rely  
on sweeprolog–next-hole to move point. (sweeprolog-at-hole-p,  
sweeprolog-beginning-of-hole) (sweeprolog-end-of-hole): new functions,  
used by… (sweeprolog–previous-hole, sweeprolog–next-hole):  
revise. (sweeprolog–precedence-at-point): new function,  
used by… (sweeprolog-insert-term-with-holes): new command.  
(sweeprolog-mode-map): bind it to C-c C-m \* sweeprolog-tests: test  
it. \* [README.org](http://README.org) (“Filling Holes”): move to top and rename to…  
(“Holes”): document sweeprolog-insert-term-with-holes.

- ENHANCED: use variable names from docs when inserting next clause

- ENHANCED: highlight holes in incomplete terms \* sweeprolog.el  
(sweeprolog-predicate-completion-at-point): fontify holes when  
inserting them. (sweeprolog-analyze-start-font-lock):  
reset font-lock-face in analyzed region.  
(sweeprolog-analyze-fragment-to-faces): fix syntax  
error handling, don’t highlight holes as it is done by…  
(sweeprolog-analyze-end-font-lock): new function, highlights holes  
in analyzed region when sweeprolog-highlight-holes is non-nil.  
(sweeprolog-analyze-region-end-hook): add it. (sweeprolog–hole):  
fix text property used for setting stickiness.

- FIXED: possible crash after calling sweeprolog-restart

## Package swipl-win

- PORT: qmake.pro and includes to compile in QtCreator (up to Qt 6.4)

## Package xpce

- TEST: Skip test if xpce cannot be found.

---

<div class="post-metadata">

**Author:** ![jal-frezie](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jal-frezie/32/405_2.png) [@jal-frezie](https://swi-prolog.discourse.group/u/jal-frezie)\
**Post date:** [May 2, 2023, 2:39pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-0-4-stable/6135/2 "2023-05-02T14:39:52Z")

</div>

Hi, I just installed this as part of Ubuntu-MATE 23.04. All looks good except all the text in the graphical trace panel is double spaced and therefore hard to read. I suspect this is something to do with the switch to UTF-16.

---

<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:** [May 3, 2023, 10:00am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-0-4-stable/6135/3 "2023-05-03T10:00:49Z")

</div>

> [@jal-frezie](#):
>
> double spaced and therefore hard to read. I suspect this is something to do with the switch to UTF-16.

It is, AFAIK, not an UTF-16 issue. It has to do something with the X11 font management. It happened with various configurations, but the last time the issue was raised is quite long (years) ago. So long ago that I forgot the work-around ☹ Should be somewhere on this forum or possibly even older mailing list.

**edit** Found [X-Window XPCE debugger - #10 by jan](https://swi-prolog.discourse.group/t/x-window-xpce-debugger/3805/10)
