Ann: SWI-Prolog 8.0.3 (stable)

Dear SWI-Prolog user,

SWI-Prolog 8.0.3 is available for download.

Keri Harris backported the important fixes from 8.1.x into 8.0.3. The
policy is not to include any patch that might affect compatibilty.

  • Several fixes to clause garbage collection, avoiding crashes.
    We also included a couple of patches for performance reasons

  • Make pack_install/1 and friends talk to the new HTTPS website.

  • Sync the Mac app (had several flows due to Qt update and CPack

  • Various issues with swipl-ld and teh pkg-config file left after
    the migration to CMake/CPack.

  • Several security fixes.

    Enjoy — Jan

SWI-Prolog Changelog since version 8.0.2

  • ENHANCED: improve performance of asserta/1 when there are lots of
    erased clauses

  • ENHANCED: do not consider dynamic predicates as dirty until clauses
    have been retracted

  • ENHANCED: incrementally track dirty clause count to avoid O(N) cost
    when considering clause GC

  • FIXED: Use https to contact the pack server.

  • FIXED: do not delete lingering clauses indexes unless they are known
    to have been lingering at the time clause GC started

  • FIXED: Issue#478: is_lambda/1 failed on valid yall lambda
    expressions. Fix by Paulo Moura.

  • FIXED: abolish_table_subgoals/1 failed if no tabling has been done
    in the calling thread.

  • FIXED: Offload unregistration of dirty foreign/thread-local predicates
    to the thread performing clause GC. This ensures that access to
    DirtyDefInfo structures is no longer racy

  • FIXED: Predicates do not need to be activated when setting a frame’s
    generation as the frame generation is guaranteed to be greater than
    the current CGC starting generation

  • FIXED: Issue#475: xinteger//1: missing cut and inconsistent handling
    of negative integers over the two modes.

  • FIXED: Issue#474 (Windows) several issues due to sizeof(wint_t) == 2

  • FIXED: possible unneeded fatal stack overflow after an earlier caught

  • TEST: Broken test after fix to assert to a static predicate.

  • PORT: Use --enable-fat for building gmp for the Mac Bundle as
    suggested by Torbjörn Granlund.

  • PORT: Use the self-compiled MacOS dependencies for creating the
    MacOS bundle.

  • PORT: Added scripts/ to build the MacOS dependencies
    from source.

  • PORT: Allow MACOSX_DEPENDENCIES_FROM to specify a directory with
    the dependencies

  • PORT: Provide correct LDSOFLAGS for compiling extensions from the
    MacOS bundle.

  • PORT: Set MacOS deployment target to 10.12.

  • PORT: MacOS: When running as bundle, report the Frameworks directory
    of the bundle as the location for the dylibs.

  • PORT: On MacOS use cc and c++ as compilers in swipl-ld.
    The CMake compiler is a specific version from XCode while we should
    rely on the general Xcode cli tools.

  • PORT: Fixup Info.plist for MacOS version. See

  • FIX: fixes a suplus dot in a test

  • PORT: various checks and ifdefs for FreeBSD

  • FIXED: verify_safe_declaration/1 leaves a choicepoint

  • FIXED: clause_info/2: possible too native unification can lead to
    incorrect results. Alan Baljeu.

  • FIXED: Cleanup of thread-local procedures in temporary modules
    failed if the localization was only effectuated in a high thread id.
    This patch refines 81b1c29e0b98c05fd0ca6db6dffbe246e8546408.

  • SECURITY: utf8_strlen() on non-null terminated input may read beyond
    the buffer.

  • FIXED: Using a thread_local predicate inside a temporary module could
    crash the system.

  • FIXED: library(ansi_term): loading should not set the color_term
    flag to true if it is already defined.

  • FIXED: Make loaded C++ foreign libraries visible through
    current_foreign_library/2. Arthur Wang.

  • FIXED: print_term/2 to print zero-argument compounds. Peter Ludemann.

  • FIXED: re-enable file consult messages when a file is consulted from
    the Windows menu.

  • INSTALL: Added declaration for JNIDIR (requires updating jpl module)

  • FIXED: :- table/1: undefined predicate check should ignore implicitly
    imported predicates.

  • FIXED: reloading a file with tabled predicates sometimes failed to
    rename the implementation. Backport of commit 95af97086

  • FIXED: Avoid excessive GC because the system incorrectly believes it
    is nearly reaching the stack limit. This is only part of the solution
    to avoid excessive GC.

  • PORT: Conditionally deal with -fprofile-dir= and
    -Wno-maybe-uninitialized as these are not supported in the default
    MacOS toolchain. Paulo Moura.

  • DOC: Updated demo/README and renamed to

  • PORT: swipl-ld.exe to configure for native MinGW tools.

  • FIXED: swipl.exe --dump-runtime-variables to provide the right
    value for PLLIBDIR on Windows. Abramo Bagnara.

Package archive

  • FIXED: error return and avoid compiler warning.

  • FIXED: Error handling when hitting end-of-file while skipping an
    archive entry. Also made error reporting more robust.

  • ENHANCED: Print more human friendly messages from archive errors.

Package clib

  • DOC: intro for UDP sockets updated.

  • ENHANCED: Make UDP inbound thread restart automatically if it dies

  • ADDED: udp_term_string_hook/3 may throw udp(invalid_message) to make
    the UDP library ignore some message. This can be used together with
    encryption to create a safe UDP cluster.

  • FIXED: timer thread should not be created as detached as it is joined.
    Matt Lilley.

  • DOC: Typo and link for ptmalloc() details.

  • FIXED: library(udp_broadcast): keep the inbound thread running on
    exceptions during broadcast.

Package http

  • DOC: Fixed a minor typo.

  • FIXED: Issue#91: mime_pack/3: lacking cut causes bad behaviour on

  • SECURITY: Add SameSite attribute to session cookies using the
    default setting lax. This protects against Cross Site Resource

Package jpl

  • INSTALL: Allow installing in $JNIDIR to support Debian
    install. After discusion with Lev Lamberov.

Package ltx2htm

  • SECURITY: Possibly reading beyond stack buffer. Note that the ltx2htm
    package is typically only used to build the documentation.

  • FIXED: read outside automatic variable.

Package paxos

  • ADDED: paxos_admin_key/2 to get supported access to changes to the
    quorum and nodes considered dead. Also fixes some mistakes in the

  • ADDED: paxos_property/1 to query the status of the cluster.

  • ADDED: paxos_quorum_ask/4 to ask questions to the forum outside the
    paxos protocol.

  • ADDED: hook paxos:paxos_ledger_hook/5, allowing (some keys of) the
    ledger to be stored elsewhere.

  • FIXED: Avoid deadlock assembling the dead node admin when starting
    with an explicit node id.

  • FIXED: Avoid deadlock for last node disappearing.

Package pcre

  • FIXED: Issue#91: re_match/3: anchored(true) was not processed.

Package pengines

  • MODIFIED: Pengines handling of /abort through HTTP. The abort handler
    (still) sends a signal to the Pengine. The Pengine will reply through
    the handler that is waiting for it (create, ask, next, pull_respons)
    with an abort message. This waiting request is no longer aborted
    in JavaScript
    , which didn’t work anyway. The /abort handler itself
    answers a 404 if the Pengine doesn’t exist or a JSON true if the
    signal was sent, without waiting for its reply.

  • ADDED: /pengine/detach method that allows for detaching from a
    connected Pengine, keeping it running in the background. This is
    backed up by changes to SWISH that can be activated to allow long
    running jobs.

  • FIXED: Avoid emitting a no-cache header in the middle of CSV output.

Package pldoc

  • FIXED: Avoid exception looking for non-existing file in wiki text.

  • FIXED: PlDoc.sty macro definition.

  • ENHANCED: PlDoc issue#11: restrict \tag to the \tags environment to
    avoid conflicts with LaTeX amsmath package.

Package readline


  • PORT: FreeBSD: fixes warnings about implicit declarations of readline
    funcs The readline/history.h was neither found nor included on FreeBSD,
    but the readline library was, so the comiler generated warnings about
    the read_history and write_history being implicitly defined.

    Adding Readline_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES fixes the
    discovery process.

Package sgml

  • FIXED: SGML/HTML/XML parser: possible memory leak and reading an
    out-of-scope automatic variable.

  • SECURITY: Possible buffer overrun when handling parser errors and
    warnings if the file name is very long. This patch also puts a
    separate length constraint on the location such that not all space is
    used by the location part of the message. With help from Keri Harris.

Package swipl-win

  • FIXED: ANSI escape sequences translation and help_pager flag.

  • FIXED: autocompletion crash

Package table

  • FIXED: new_order_table/2: accept strings for character sets for
    compatibility with SWI7.

Package xpce

  • FIXED: Issue#464: gxref/0: ignore files that do not exist.
    Paulo Moura.

  • CLANG: Add unneeded initialization to avoid a warning.

  • CLEANUP: Avoid some (benign, I think) errors trapped by Address

Package zlib

  • TEST: Issue#473: zlib tests failing on Windows due to CR/LF encoding.

  • FIX: fixes zlib test, gzip_utf8 The test failed, because of missing
    encoding(utf8) term.


I get issues with 8.0.3-1 on Ubuntu 18.04. What may be wrong? Missing dependencies?

$ uname -a
Linux lupo-xps 4.18.0-24-generic #25~18.04.1-Ubuntu SMP Thu Jun 20 11:13:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ sudo apt show swi-prolog-nox
Package: swi-prolog-nox
Version: 8.0.3-1-gcbd8b3b92-bionicppa2

$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.0.3)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit
For built-in help, use ?- help(Topic). or ?- apropos(Word).

ERROR: /usr/lib/swi-prolog/library/
	catch/3: Undefined procedure: editline:use_foreign_library/1
Warning: /usr/lib/swi-prolog/library/
	Goal (directive) failed: editline:use_foreign_library(foreign(libedit4pl))
ERROR: Exported procedure editline:el_wrap/4 is not defined
ERROR: Exported procedure editline:el_cursor/2 is not defined
ERROR: Exported procedure editline:el_bind/2 is not defined
ERROR: Exported procedure editline:el_source/2 is not defined
ERROR: Exported procedure editline:el_wrapped/1 is not defined
ERROR: Exported procedure editline:el_addfn/4 is not defined
ERROR: Exported procedure editline:el_unwrap/1 is not defined
ERROR: Exported procedure editline:el_read_history/2 is not defined
ERROR: Exported procedure editline:el_write_history/2 is not defined
ERROR: Exported procedure editline:el_add_history/2 is not defined
ERROR: Exported procedure editline:el_history_events/2 is not defined
ERROR: Exported procedure editline:el_history/2 is not defined
ERROR: Exported procedure editline:el_deletestr/2 is not defined
ERROR: Exported procedure editline:el_insertstr/2 is not defined
ERROR: Exported procedure editline:el_line/2 is not defined
ERROR: /usr/lib/swi-prolog/library/ Initialization goal raised exception:
ERROR: Undefined procedure: editline:el_wrapped/1
ERROR:   [27] editline:el_wrapped(user_input)
ERROR:   [26] editline:el_wrap at /usr/lib/swi-prolog/library/
ERROR:   [25] '$run_init_goal'(editline:el_wrap) at /usr/lib/swi-prolog/boot/
ERROR:   [24] catch(system:'$run_init_goal'(...),error(existence_error(procedure,...),context(...,_4696)),system:'$initialization_error'(...,...,...)) at /usr/lib/swi-prolog/boot/
ERROR:   [23] catch_with_backtrace(system:'$run_init_goal'(...),error(existence_error(procedure,...),context(...,_4766)),system:'$initialization_error'(...,...,...)) at /usr/lib/swi-prolog/boot/

I only have 8.1.9 installed from the PPA, but that version is fine. Most likely the post-installation step that builds the library index has not been executed. That should have created


You can try to reconfigure the package to see whether that helps and what happens (some apt command; do not recall). You can also start Prolog, possibly using swipl --no-tty to avoid trying to load editline and
run (as root)

?- make_library_index(swi(library)).

Would be nice to know whether this is a bug in the package or some weird local issue.

It appeared to be caused by a generic issue within the Ubuntu package manager, so not specfic to swipl, after cleanup it works again!