Ann: SWI-Prolog 8.2.2 (stable)

Dear SWI-Prolog user,

I’m happy to announce SWI-Prolog 8.2.2 (stable). This backports a large
number of smaller and bigger issues from the development version, aiming
at very close to 100% compatibility with 8.2.1. There are not many clear
highlights as most concerns small patches.

Note that JPL has been synced with the development tree. This includes
several important bugfixes and serious restructuring of part of the
code. This version notably runs again on Windows, where both the 32 and
64 bit ports were broken for different reasons.

Enjoy --- Jan

SWI-Prolog Changelog since version 8.2.1

  • PPA: Support Ubuntu 20.10 (groovy) and reduce the places where the
    known distros are listed to one.

  • PPA: Removed eoan from PPA list

  • CLEANUP: Cleanly exit when running out of memory on pushSegStack().

  • FIXED: Issue#698: format/3 using “~1r”. David Tonhofer.

  • PORT: Windows: Install libswipl.dll.a as libswipl.lib. The MinGW.dll.a
    is supposed to be accepted by MSVC.

  • ENHANCED: Go more to the limit extending the stacks when we are
    printing a message, avoiding loosing messages due to resource
    exceptions.

  • FIXED: Exception term for running out of stack could be huge if the
    large term is a list ending in a huge compound term.

  • FIXED: library(prolog_deps): file_autoload_directives/3: fix minimizing
    updates to use_module/2 and autoload/2.

  • PORT: Issue#690: WASM: Remove outdated -s BINARYEN_TRAP_MODE=clamp
    Jacob Friendman.

  • DOC: Use imperative in man page

  • DOC: Add missing options to man page

  • DOC: Fix typo in CMAKE.md

  • FIXED: sort/2 and related predicates: possible crash.

  • FIXED: Restore tries when re-evaluation is abandoned due to an
    exception. Cory Cohen.

  • ENHANCED: Issue#685: must_be/2: verify existence of the type before
    raising an error. David Tonhofer.

  • FIXED: format_predicate/2: prints alarming messages when the letter
    is already defined. Matt Lilley.

  • FIXED: library(prolog_xref): handle included data if data is coming
    from a stream for which the encoding is fixed.

  • FIXED: When overruling an implicit import to define a predicate locally
    (e.g., dynamic), we should not use the thread-localised definition.

  • FIXED: race condition between thread_local/1 and accessing the
    predicate structure. Vincent Koeman.

  • FIXED: write/1 portraying attributes for freeze/2 . Rick Workman.

  • FIXED: make library(ansi_term) load in --traditional mode. Falco
    Notgatz.

  • FIXED: Declarations such as dynamic/1 to enforce the argument to
    be predicate indicators. Before that, a head was accepted which
    causes these predicates to succeed silently when the arity is omitted,
    working on name/0.

  • PORT: Only use __declspec for MSVC and MinGW. Also Cygwin now uses
    traditional extern.

  • PORT: Issue#668: compilation on Cygwin for thread_affinity/3.

  • FIXED: function roundtoward/2 with variable direction was miscompiled,
    causing a crash. Rick Workman.

  • DEBUG: invalid internal debug message, crashing in full trace mode.

  • FIXED: meta-calling a wrapped thread-local predicate ignored the
    wrapper.

  • MODIFIED: qsave_program/2: preserve the autoload flag in the calling
    process and preserve autoloading if it is enabled and the save class is
    development

  • FIXED: Possible crash in tabling, notably occurring on MacOS due
    to wrong assumptions wrt representing pointers in Prolog integers.
    With a lot of help from Matt Lilley.

  • FIXED: Handle failure inside ‘fast’ opcodes which D_BREAK replaces
    with ‘slow’ opcodes that do not trigger FASTCOND_FAILED. To do this,
    if we hit D_BREAK and there is a fast condition pending, convert it
    into a real choicepoint

  • FIXED: Issue#657: Debug flags such as print_write_options in a
    saved state were overruled by the initialization. Robert van Engelen.

  • DOC: Issue#658: read_history/6 wrong info for substituting the
    event. Robert van Engelen.

  • FIXED: Issue#652: expand_file_name/2 for Windows: double UTF-8
    encoding.

  • FIXED: Possibly crash in wrap_predicate/4. With help from Peter
    Ludemann.

  • FIXED: re-enable inline unification after switching off debug mode.
    Rick Workmann.

  • ADDED: library(sandbox): support load_files/2 with safe options.

  • FIXED: SICStus emulation: avoid mapping use_module/1,2 unconditionally.

  • FIXED: is/2 using optimised arithmetic with a float value while the
    left side is instantiated to a float can exit Prolog (unintended
    return).

  • FIXED: load_file/2: if(changed) option for loading a non-module file
    was ignored, always loading the file.

  • BUILD: Use Docker for building the stable release

  • FIXED: supporting wide file names in qlf files

  • ENHANCED: ignore tty stream errors when there is no active terminal

  • ADDED: set_system_IO/3 to bind stdin/stdout/stderr to Prolog streams

  • FIXED: compile_predicates/1: wrong handling of module qualification
    causes compile_predicates(Module:List) to fail.

  • COMPAT: Export memberchk/2 from library(lists).

  • FIXED: Make sure the xpce boot files are handled as library files
    and not as user files to avoid xpce failing to load when the user
    defines global conflicting operators.

  • FIXED: Encoding for command line options passed through
    ‘$cmd_option_val’/2. Reported by UweR on Discourse.

  • PORT: Support Unicode wmain() for Windows. This adds PL_winitialise().

  • FIXED: copy_stream_data/2: ensure exceptions are passed.

  • DOC: consistency of docs for forall/2 and concurrent_forall/2.

  • DOC: Clarifications, fix section levels.

  • DOC: Fix typos in manual

  • FIXED: Issue#646: using {} as postfix operator can cause the output
    to be confused with a dict. Jan Burse.

  • FIXED: Handle Unicode file names in QLF files and saved states
    on Windows.

  • FIXED: Do not save the Prolog flag file_name_case_handling.

  • FIXED: listing/1: when used with a partly instantiated head to list
    a subset of the clauses, do not unify the clause head but only test
    it is unifyable.

  • DOC: Fix typos in manual

  • FIXED: HTML text renderer to add a blank line between the first and
    second par of a list element.

  • DOC: functor/3: avoid confusing example.

  • BUILD: Fixed installation. Nicos Angelopoulos

  • FIXED: make_library_index/1 tested whether . was changed rather
    than the target directory.

  • BUILD: Always the library index commands. Prolog checks the
    dependencies anyway.

  • FIXED: Allow importing a predicate using autoload/2 while it is defined
    in user and make sure the imported predicate actually gets used.

  • FIXED: Autoloading picked predicates from the module user. Test case
    by Eric Tauber.

  • DOC: get_dict_ex/3 does not exist. Removed the docs. David Tonhofer.

  • ENHANCED: list_debug_topics/0: use quoted print and numbervars to
    list the topic more precisely. David Tonhofer.

  • FIXED: Possibly crash while enumerating table answers (missing stack
    space check and expansion).

  • FIXED: Added option/2 dependency for library(thread).

  • FIXED: Added missing predicate_options/3 declarations for
    concurrent_forall/3 and concurrent_and/3.

  • DOC: Mostly changes to atom_codes/2 et al.

  • FIXED: propagate I/O exceptions or signalled exceptions
    from discarding an unbuffered stream temporary buffer.
    Report

  • ENHANCED: concurrent_and/2,3: limit size of answer queue. Jan Burse.

  • DOC: Reviewed chapter on “exceptions”

  • ADDED: concurrent_and/2,3 based on Jan Burse’s balance/1.

  • TEST: Added SKIP_SSL_TESTS option to CMake config.

  • ADDED: concurrent_forall/2,3: as forall, running tests in parallel.

Package bench

  • PORT: Allow running on SICStus.

  • LEGAL: Clarified legal status of benchmarks contributed by David H
    Warren with permission from the author.

  • PORT: Allow running the benchmark using YAP again.

  • LEGAL: Re-licensed chat80-derived benchmark after re-licencing
    of CHAT-80. See GitHub - JanWielemaker/chat80: Classical CHAT80 NLP system for Prolog, commit
    f0e120e7f99a5c1314370e6805655f75073415c0

Package clib

  • FIXED: library(udp_roadcast): possible race condition. Jacob Friedman.

  • FIXED: cut redundant choice point

  • FIXED: A destroyed engine under a time limited goal destroys the main
    thread’s timers.

Package cpp

  • PORT: Avoid including malloc.h for FreeBSD. Didier31 through
    Discourse.

  • FIXED: PlTerm::PlTerm(double val): deal with failing PL_new_term_ref()

Package http

  • FIXED: Issue#142: http_reply_from_files/3: Return 301 Moved Permanently
    on directories without trailing /

  • FIXED: Issue#141: Keep-alive with zero content length replies.
    Esad Hajdarevic.

Package jpl

  • FIXED: Missing unlock trying to find a pool engine if no new engines
    can be created. David Tonhofer.

  • CLEANUP: Some renaming mainly; once/1 calls around phrase/2 removed

  • CLEANUP: Exported old predicates with new names. Rearranged. Fixed
    comments.

  • CLEANUP: Presumably final cleanup of DCG rules & their callers

  • CLEANUP: Changing DCG names

  • FIX: Minor fix in failed test

  • CLEANUP: Filing off some rough edges around jpl_type_to_classname/2

  • CLEANUP: Updates after remarks by Jan

  • CLEANUP: Added code to identify java identifier chars (not called yet)

  • CLEANUP: throwme/2 replaced with latest (and better comments)

  • PORT: Add -Wl,kill-at option when compiling jpl.dll for Windows.
    This seems necessary on 32-bit. On 64-bit it seems to work with
    as well as without this option. Withouth this option we get an
    unsatisfiedlinkerror exception when trying to find the first JNI
    method from jpl.dll.

  • TEST: Fixed detection of REPORT=true environment detection.
    David Tonhofer.

  • FIXED: Windows: pointers get truncated to 32-bits.

  • FIXED: Sync all SWI-Prolog.h constants.

  • PORT: one-to-one threading for Windows. pthread key cleanup is also
    called if the associated value is NULL on Windows.

  • FIXED: calling throw/2 rather than throwme/2.

  • ADDED: thread example illustrating new Prolog.engine_create()

  • ADDED: Prolog.create_thread() and Prolog.destroy_thread() to have a
    Prolog thread uniquely attached to a Java thread.

  • FIXED: put_term() to handle error cases

  • CLEANUP: New code to generate JPL exceptions.

  • TEST: Install jpltest-${JPL_VERSION}.jar as jpltest.jar. If we
    install jpltest.jar itself, it is just a link. We do not want to
    install links if we can avoid it for portability.

  • CLEANUP: Exptn-generating code & msgs streamlined

  • TEST: Guess /usr/share/java/junit.jar is junit4 if we can’t find a
    clear version 4. Not sure how safe this this.

  • PORT: We do not need javah

Package ltx2htm

  • ADDED: Deal with \curltermitem()

Package odbc

  • FIXED: Error propagation from SQL_SUCCESS_WITH_INFO and PL_put_term().

Package pengines

  • ADDED: term//2 from library(http/term_html): format/1 option to
    specify formatting all atomic values.

  • FIXED: SWISH Issue#670: wrong space computation for prefix operators.

Package pldoc

  • FIXED: help/1: avoid ERROR: http_handler_id `pldoc_man' does not exist on certain pages.

  • ENHANCED: Map items with {…} onto \curltermitem{}

  • ENHANCED: Render {…} terms properly.

  • FIXED: Markdown exception when processing a block like a code block
    followed by a possibly header underline (— or ===).

Package plunit

  • ADDED: current_test/5 to reason about known tests.

Package semweb

  • FIXED: Lexical representation of xsd:decimal numbers

  • MODIFIED: sparql_query/3: drop option to accept any SSL certificate.
    Code that insists loading silently from insecure systems should
    provide their own certificate checking. See ssl_context/3, option
    cert_verify_hook(:Goal).

  • DOC: New option handling

  • FIXED: Issue#91: allow specifying the accept header.

  • FIXED: Issue#99: preserve white space in SPARQL XML results.

  • FIXED: rdf11: compare untyped literals equal to xsd:string typed
    literals. Joost Geurts.

  • DOC: fixed rdf_has second argument mode to match wrapped
    rdf_db:rdf_has4

Package sgml

  • ADDED: XML space mode strict that never changes white space.
    Required for signature generation and checking. By Matt Lilley.

  • TEST: Syntax error. David Tonhofer.

Package ssl

  • FIXED: SSL BIO gets binding to Prolog streams. Did not include
    the \n, did not 0-terminate the string and got EOF handling wrong.
    Affects loading private keys (and possibly more). Joined debugging
    with Matt Lilley.

  • TEST: Added demo_body.pl location for running the installed test suite.

  • TEST: Also the order in which the verification hook is called seems
    changed in 1.1.1h

  • TEST: OpenSSL 1.1.1h seems to avoid duplicate calls to the
    cacert_verify hook. We now only test for unique results passed to
    this hook and no longer for duplicates. Unfortunately we do not
    really know the root of this change.

  • FIXED: ssl_context/4: Failure to report an error if the the certificate
    file does not exists.

  • FIXED: Two more 365 timeouts on certificates. Lev Lamberov.

  • TEST: Increase both certificate expiry time and CRL
    refresh time to 3 years so that tests will pass 3 years
    after builds with no further actions required. See
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=968013

  • TEST: Allow disabling the SSL tests. Creating the certificates seems
    really hard inside a docker container using wine as it refuses to
    seed the openssl.exe random generator. Why remains unclear to me.

Package swipl-win

  • CLEANUP: Avoid C++ compiler warning about undefined timeout_ms.

Package xpce

  • FIXED: PceEmacs: M-x git-grep: disable color output.

  • PORT: class process: make pseudo terminal handling work again on linux.

3 Likes