Ann: SWI-Prolog 8.1.27

Dear SWI-Prolog user,

SWI-Prolog 8.1.27 is ready for download. This is mostly a bug fixing,
portability and build/installation release. Highlights:

  • Allow (and by default do) linking to Google tcmalloc as an
    alternative to the system malloc() routines. Tcmalloc seems to
    provide much better memory reuse, notably on programs that create
    many threads and a lot of garbage atoms and clauses. It works
    poorly for stack allocation and temporary allocation of large
    chunks. These are now handled using mmap() directly. Currently
    Unix only.

  • There is a new predicate thread_idle/2 that can be wrapped
    around a goal that will make the calling thread idle for some
    time, e.g., waiting for a new message or activity on a stream.
    This predicate releases resources to the system before waiting.

  • A lot of new statistics and size properties have been added
    to various object types to get better insight in memory use.

  • With help from Lev Lamberov and Keri Haris atomic data management
    has been switched to the newer GCC __atomic* built-ins. This
    notably facilitates 32-bit platforms that lack 64 bit atomic
    instructions (e.g. 32-bit MIPS)

  • Matt Lilley fixed OpenSSL issues: failing test using OpenSSL
    1.1.1e (timeout handling) and too short test certificates
    causing most tests to fail on Debian 10.3 (Buster) and probably
    many other systems.

  • Several new build and test options.

    Enjoy — Jan

SWI-Prolog Changelog since version 8.1.26

  • FIXED: Possible wrong NaN from the nexttoward/1 function.

  • PORT: 1.0**NaN is not always 1.0 in all C versions.

  • MODIFIED: float_fractional_part/1 and float_integer_part/1 functions
    to return standard NaN (fix) or raise an exception if float_undefined
    is set to error.

  • INSTALL: When installing tests, add them to the optional component
    “Tests”

  • TEST: Fixed test thread/thr_local_1.pl.

  • FIXED: Ensure we have a universal NaN that is 1.5NaN. This test
    failed on mipsel.

  • TEST: Fixed test_clause_gc.pl test as this can run out of stack since
    we combine the stacks.

  • TEST: Provide test_tmp_dir search path when running installed tests
    such that they can run without writing in the test directory.

  • TEST: remove protocol(x) from thread_agc test.

  • DOC: Provide pldoc_to_tex flag when generating LaTeX, so code can
    decide to avoid loading dependencies that may not be present.

  • PORT: Replace GCC _sync* functions by more recent _atomic*
    primitives to improve portability.

  • DOC: PL_initialise() referred to old libpl.dll. Gerhard Groehner.

  • ENHANCED: Use temporary allocation for buffers and discard large
    buffers when making them empty.

  • ENHANCED: Use new tmp_malloc() for segstacks (used as temporary store
    for many operations that iterate over complex terms).

  • CLEANUP: No longer allocate array for built-in atoms. This array is
    no longer used (saves 85Kbytes memory).

  • INSTALL: Added CMake option SWIPL_INSTALL_IN_SHARE=ON to install
    architecture indepedent files in <prefix>/share/swipl/. Currently
    only used for the documentation and examples. Future versions may
    also place the library here. Lev Lamberov, Debian maintainer.

  • ADDED: statistics/2 threads_peak to get an indication of the highest
    level of concurrency reached.

  • CLEANUP: Move notion of highest thread id to global data structure.

  • ADDED: thread_property/2: size(Bytes) property

  • ADDED: statistics/2: atom_space and functor_space to get the used
    memory.

  • ADDED: module_property/2: size(-Bytes)

  • ADDED: predicate_property/2: size(-Bytes)

  • FIXED: Added meta-predicate declaration for thread_idle/2.

  • FIXED: Stack alloc statistics

  • ENHANCED: Use new mmap() based allocation more generally for large
    temporary allocations. Currently used by findall/3 and friends.
    There are more candidates where this can help, such as buffers and
    stacks for cycle detection, enumerating large terms, etc.

  • BUILD: Install the manual index as part of the documentation
    installation. Lev Lamberov.

  • ENHANCED: Use mmap() based allocation for the stacks such that we
    can release these to the OS if we use an allocator that is not well
    suited for huge temporary stack allocations.

  • ADDED: trie_property/2, statistics properties to access the IDG size.

  • ADDED: check_installation/0: check for tcmalloc.

  • PORT: Make tcmalloc setup work on MacOS. Signalled by Paulo Moura.

  • PORT: Use our internal PL_dlsym() and work without tcmalloc

  • ADDED: thread_idle/2 and, when linked to tcmalloc, malloc_property/1
    and set_malloc/1.

  • ADDED: Detect tcmalloc() and link swipl using this if provided.

  • PORT: Added CMake script to find tcmalloc

Package archive

  • BUILD: Doc build depends on package itself.

Package bdb

  • TEST: use test_tmp_dir to find a writeable place for the test output.

  • FIXED: If a database cannot be opened it is still around as a current
    database and closing it (explicitly or at the end of the process)
    crashes.

Package clib

  • PORT: Another use of extern environ that blocks MacOS 10.6.

Package http

  • DOC: Avoid building docs to load SSL

  • ENHANCED: Use new thread_idle/2 to wait for a new HTTP message.

  • ENHANCED: library(http/http_unix_daemon): use thread_idle/2 while
    waiting for a maintenance event to reduce resource usage.

Package pcre

  • DOC: Clarify re_matchsub/4.

Package semweb

  • TEST: Avoid creating g1.rec for a normal test run.

  • PORT: Use GCC __atomic instructions.

Package ssl

  • TEST: Recreate the test certificates with 2048 bit keys since later
    versions of Debian (at least) will no longer accept 1024-bit keys

  • FIXED: Timeout handling with OpenSSL 1.1.1e and later. Resolved by
    Matt Lilley.

  • TEST: Document failing server test when using OpenSSL 1.1.1e

  • FIXED: ssl_context/3: declare new cacerts option

  • ENHANCED: avoid blocking if the SSL server tests fails.

  • TEST: Cleanup test module (unneeded path handling, redundant newlines
    in debug/3 messages).

Package zlib

  • TEST: Search for a writable directory for test_tmp_dirthe test files
    based on the (new) test_tmp_dir path alias.
5 Likes