Dear SWI-Prolog user,
I have uploaded SWI-Prolog 8.4.1 in the stable series. This backports
bug fixes and enhancements without compatibility consequences from the
development series. It does include some new features of the development
series such as the new argv_options/3 commandline argument parser.
Enjoy --- Jan
FIXED: Saved state handling of a dict whose first key value (in the
internal order) and tag are both avoid variables. This patch is less
invasive than 4de9114a76cd44659591296627e999cf1072d744.
FIXED: Be more relaxed about existence of the current predicate
when pushing and popping the compilation context.
ENHANCED: Get version info into the Prolog flag. Now uses CMake rather
than a shell script and provides a new Prolog flag
DOC: meta_predicate/1: updated mode declarations.
EHNACED: pack_rebuild/1,2 for CMake based packages to use
cmake --installfor the build and install steps rather
ninja, etc. directly. Suggested by Wouter Beek.
MAINTENANCE: Possible segv in retract/1 when compiled using O_DEBUG.
FIXED: Possible race conditions between the various ways a thread
can be joined.
FIXED: Do not start a new thread to join garbage collected threads
while shutting down the system.
MAINTENANCE: On a system error we only go into interactive mode if
both stdin and stderr are connected to a terminal. Otherwise we
print the message, C and Prolog stack and abort.
MAINTENANCE: Use of guarded C-stack using sigaltstack() doesn’t go
with ASAN. Results in the error below. Disabled guarding the C
stack when compiling using address sanitizer.
==101190==ERROR: AddressSanitizer failed to deallocate 0x2000 (8192) bytes at address 0x6250000b1900 ==101190==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_posix.cc:60 "(("unable to unmap" && 0)) != (0)" (0x0, 0x0)
FIXED: CMake packs must use environment variables.
ninjabuilds when using CMake
FIXED: pack_install/1,2: If we use CMake for configuration, we should
also build in the CMake directory.
TEST: Signalled thread may already be dead.
ADDED: pack_install/1,2: provide pack_install(.) to add the local
directory to the pack registry and build it. Also add option
rebuild(When)to provide more fine control over the build.
FIXED: pack_install/1,2: do not remove contents if the package
registered as a symbolic link.
FIXED: memberchk/2 for partial lists where the unbound part is
constrained. Reported on Discourse by Abramo Bagnara.
BUILD: Avoid GCC-11 warning
ENHANCED: Protect assertz/1 and friends (compiler) against C-stack
ENHANCED: Use setjmp() instead of sigsetjmp() to reduce the overhead
of the C-stack guarding.
MAINTENANCE: Updated C calltree analysis for CMake build and new
coding style and conventions.
FIXED: Fallback to find a place for packages to install executables.
FIXED: Hash consistency on pointer sided integers for 64-bit bigendian
machines. Only affects consistency of term_hash/2 over platforms.
FIXED: Checking that an uncaught exception is caught in an outer
environment, i.e., nested C<->Prolog callback.
FIXED: Make C-stack guarding work in threads.
ENHANCED: Use C-stack guarding for read/1 and friends.
FIXED: format/2,3: Term printing using ~[kpqw] did not propagate
ENHANCED: Handle C-stack overflows gracefully on POSIX targets with
ADDED: argv_options/3: allow including longer descriptions as header,
usage and footer in the usage message.
ADDED: argv_options/3: Allow the user to redefine the bindings for
help. Suggested by @swi.
PORT: Alignment on ppc64el. Better version than
PORT: Alignment on ppc64el (Debian). See
ppc64le compilation failure in Alpine for swi-prolog 8.5.0 · Issue #104 · SWI-Prolog/issues · GitHub
FIXED: pl_get_uint64() for GMP numbers on 32-bit systems.
ADDED: argv_options/3,4: allow for disjunctive types.
ADDED: library(prolog_versions) to simplify demanding minimal version
and features of the hosting Prolog system.
stop processing options after the first positional argument.
ADDED: win_get_user_preferred_ui_languages/2 to get access to the
user’s preferred UI languages on Windows.
INSTALL: Windows: avoid confusing uninstall version message.
ENHANCED: Allow loading library(prolog_debug) if
are defined as operators.
FIXED: Do not reclaim memory on termination when we failed to terminate
ENHANCED: Provide a non-polling process termination procedure for
systems that do not have sem_timedwait() such as MacOS.
ENHANCED: Improve performance for process shutdown on POSIX
systems that support sem_timedwait() by avoiding a polling loop.
This typically saves 0.1 second on the elapsed time for short lived
-c(compile) to produce
a state that does not include xpce.
FIXED: Retract for
retract((a:-true)). Reported by Fernando
ADDED: argv_options/3: type
ADDED: argv_options/3 to provide a full featured and lightweight
alternative to library(optparse).
FIXED: format/2 and friends: verify error when emitting rubber.
ADDED: format/2 and friends: support
~:|, the colon modifier for
tab stops to insert a newline if the current column already passed
the tab stop.
FIXED: Issue#896: Claim that memory streams as used by
e.g. open_string/2 are reported as repositionable. Reported by
Matthijs van Otterdijk.
ENHANCED: Allow 64-bit seek function to work on memory streams.
ADDED: Allow stream contol functions to return whether the stream
FIXED: det/1: avoid false non-determinism claim if all relevant
choicepoints are debug choicepoints.
FIXED: Predicate access in nested transactions for clauses that are
removed in the parent (or a previous nested) transaction. We must
inspect the affected clauses of all parent transactions. Reported by
FIXED: Answer subsumption tabling case provided by Annie Liu.
ADDED: Predicate property
sig_atomic. Currently only for the
FIXED: Delay signals in prolog_exception_hook/4.
ADDED: sig_atomic/1 to run goals protected from signals. This
predicate used to be available as the undocumented ‘$sig_atomic’/1.
‘$sig_atomic’/1 is now available from
ENHANCED: thread_signal/2: reduce the locked section
FIXED: thread_wait/2: return when condition is true before this
predicate is called.
wait_predsoption accepted non-predicate
ADDED: sandbox: call_delays/2 as safe meta predicate
ENHANCED: trace/2 to delete that we are tracing this predicate if
the port list is empty.
DOC: Document key
FIXED: 91d73fb8a859c6e0f0d97ff553f96903816bc18c triggers another case
where the falsecount of a node can underflow during re-evaluation.
DOC: LaTeX formatting error
CLEANUP: SWI-cpp.h: more consistent type handling and silence several
COMPATIBILITY: SWI-cpp.h to use
to avoid warnings on modern C++ compilers.
ADDED: JSON writer for dicts now have a hook json_dict_pairs/2 that
allows the user to select keys from the dict and particularly define
the order of keys in the resulting JSON.
ADDED: http_read_data/4: handle the input_encoding/1 option when
FIXED: range streams: be careful about race conditions when
asynchronously finding all streams that refer to OS file handles.
- BUILD: Silence GCC-11 warning (ugly)
UPDATE: Missing file from last commit
FIXED: File Handle Leak reported by
@andrzej-at-mazurkiewicz-org Original bug report is:
OSError: [Errno 24] Too many open files after 508 iterations of with PrologMQI() as mqi: with mqi.create_thread() as pth: · Issue #13 · SWI-Prolog/packages-mqi · GitHub
Need to call:
self._process.exit(None, None, None)
result = self._process.wait()
as it will close the stderr/out handles too. Otherwise they will leak
since they are used and thus opened (but not closed) by the Popen object.
TEST: Handle all failures from test_server_options_and_shutdown as
warnings unless “SWIPL_TEST_FAIL_ON_UNLIKELY=y” This test has lots
of threading and potential race conditions so it can fail when the
system is heavily loaded.
Handle by catching all exceptions and only actually failing if
SWIPL_TEST_FAIL_ON_UNLIKELY - y
DOC: Update URLs from EricZinda/swiplserver to packages-mqi
ADDED: All files needed to actually build the Python ‘swiplserver’
model and post to pypi.org so that ‘pip install swiplserver’
works Includes instructions on how to the build the model in
ENHANCED: Use new controlled options and automatic help.
ENHANCED: Include dependencies to make mqi run with disabled
os_argv. Breaks on new argv_options/3.
CMAKE: Requires minimally cmake 3.9
TEST: Include ODBC tests based on the environment variable
SWIPL_TEST_ODBC_DRIVER. Also fixes cleanup of the ODBC tests.
FIXED: Ensure statement is closed in two scenarios.
FIXED: Properly translate non-ASCII ODBC messages to Unicode.
FIXED: Cleanup the remains of old work-arounds or broken MS SQLServer
SQLColumns() and add a new one. odbc_table_column/3 stops with the
Invalid Descriptor Indextrying to fetch the column name
using SQLGetData(). The work-around sets the column with for this
query to 8K, avoiding SQLGetData(). Thanks to Fernando Sáenz-Pérez
for reporting and providing access to a server.
ENHANCED: Provide CSS style wfs_undefined for undefined answers.
ADDED: term_html:portray//2 hook that plays a role similar to portray/1
for HTML rendering of terms.
FIXED: Issue #15 (long directory name) Shorten directory
protoc_gen_prolog_pb to gen_pb for R build (R build outputs a warning
if a the path is more than 100 bytes)
FIXED: uint32_codes/2 in mode (-,+) on may return a negative value
on 32-bit systems.
TEST: Prevent occasional early termination in test(primes).
TEST: Make sure the Redis test group consumers are properly discarded.
- BUILD: Trick GCC-11 we are not really freeing a non-heap address.
- FIXED: xml_quote_cdata/3: possible race condition if two threads use
this for the first time.
- BUILD: Silence (incorrect) GCC-11 uninitialized warning.
PORT: remove Cygwin from targets requiring dllexport Cygwin ld uses
auto-export by default. Mixing that with dllexport in some cases
leaves other symbols unexported.
Signed-off-by: Corinna Vinschen email@example.com
BUILD: Avoid GCC-11 warning.
FIXED: Do not setup search path for library(pce) if