Branch: development (switch to
stable),
SWI-Prolog Changelog from version 10.1.20 to 10.1.21
[Nov 16 2026]
- BUILD: make-ppa: do not check build dependencies for the source
package The source package is built locally, but the binaries are
built on Launchpad, which installs the build dependencies itself.
Checking them locally required installing e.g. the graphviz and ffmpeg
development packages on the machine that creates the source package.
- FIXED: \term{F}{Args} failed in LaTeX if Args contains a nested
\term The emptiness test used \ifthenelse{\equal{}{#2}}, which
fully expands #2 and breaks on a nested \ifthenelse, e.g. for
\term{error}{\term{syntax_error}{\term{encoding}{Message}}, Context}.
Compare an unexpanded \def using \ifx instead.
- TEST: stop the gc thread in test_cgc_last garbage_collect_clauses/0
returns immediately if the gc thread is running clause GC that started
before the clause was erased, which made the test fail sporadically.
As with garbage_collect_atoms/0, this is acceptable outside tests.
- FIXED: assert/2 could crash if another thread retracted the new clause
If another thread retracted a clause right after assert/1 or assert/2
added it, clause garbage collection could reclaim it while assert
was still using it. This could crash assert/2 and, less likely,
assert/1 or an assert that triggers a predicate event.
[Nov 13 2026]
- FIXED: generational GC leaked its remembered set for each thread The
remembered set of
gen_remember() was never freed, so each thread that
used it leaked it when it ended. Free it with the stacks.
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return is a truth value (literal, comparison, logical expression,
call to a bool function, or an int variable that only holds truth
values), whose address is never taken and that use no macro returning
other values. Return values are unchanged.
- CLEANUP: use false instead of FALSE, remove trailing white space
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session:
https://claude.ai/code/session_01Y7pJ6r44CrdPMcpJvHR8Eb
- ADDED: PL_utf8_code_point() to decode UTF-8 as Prolog does Foreign
code had no access to Prolog's UTF-8 decoder and packages carried
their own copies, which disagreed with Prolog on invalid input.
ASCII is decoded inline; other sequences call _PL_utf8_code_point().
- MODIFIED: help/1: use epilog:tty_link_hook/5 for manual links The
Epilog report bar now says "Help on format/2" or "More matches for
apropos(Query)" while the pointer is on such a link.
[Nov 12 2026]
- SECURITY: prolog_file_directives/3 ran the :- if conditions of
the file Cross-referencing a file that imports another read the
directives of the imported file and called the condition of every :-
if or :- elif in it. Opening an untrusted project in an editor that
cross-references (PceEmacs, an LSP server) thus ran code from it.
Conditions are now only evaluated if they are built from side-effect
free predicates such as current_prolog_flag/2, current_predicate/1
and exists_source/1; anything else is false, as was already the case
for a predicate of the file itself.
- FIXED: edit/1: file names could end the quotes of the editor command
An external editor is started using shell/1 on a command built from an
edit_command/2 template such as
'%e +%d '%f''. A file name holding a
quote, $ or a backquote ended the quoted text or was expanded by the
shell. Such file names now raise domain_error(shell_safe_file_name,
File).
- MODIFIED: sandbox: setting/2 only reads settings of the calling module
setting/2 was declared a safe meta-predicate, so sandboxed code could
read the settings of any module, e.g.,
setting(_:_, Value), which may
hold passwords or keys. It is now only safe for an unqualified name,
which refers to the calling module.
- MODIFIED:
format(Fmt, Args) inside an exception is not formatted if Fmt
calls goals Exceptions may be data that was received from elsewhere.
When printing error(format(Fmt, Args), _), or a format(Fmt, Args) ball
inside a message that holds an exception (unhandled_exception/1, thread
and initialization errors), Fmt is no longer used if it contains ~@
or ~W, which call goals. The term is printed instead. A format(Fmt,
Args) message issued by the program itself is unchanged.
- FIXED: libraries became system predicates after the boot compilation
Loading a file whose .qlf file is out of date recompiles the .qlf file.
In system mode (flag access_level), as during the boot compilation, the
predicates are compiled as system predicates and the .qlf file records
this, so they remain system predicates when later loaded in user mode.
The boot compilation loads library(debug) (autoload/2 in tabling.pl),
which loads more libraries. After a change that makes the .qlf files
incompatible, e.g., lists:append/3 became a built-in. In system mode
we now load the source and leave the .qlf file for a later load.
- TEST: profile_default: disable the GUI profile hook instead of skipping
The unit was skipped whenever xpce defines show_profile_hook/1,
which is always the case on macOS. Wrap the hook to fail while the
unit runs, so profile/2 gives its text report on every platform.
- FIXED: profile/2 showed a profile if another thread was profiling
If another thread is profiling, profile/2 raises a permission error
without running the goal. It still showed the (empty) profile,
which opens the profiler GUI if xpce is loaded. On macOS without a
display this made test_profile fail.
- FIXED: races between atom-GC of thread handles and their use Thread
handles are blobs that atom-GC reclaims when unreferenced. Their
release hook clears PL_thread_info_t->symbol, but several places
used that symbol without holding the mutex that serialises this,
crashing with "invalid atom_t" or joining a thread twice.
- FIXED: use-after-free accessing the local data of a completed thread
acquire_ldata() published the hazard pointer and then read the magic of
the thread's local data, which another thread could have freed before
the hazard was visible. It now verifies that info->thread_data still
holds the pointer before using it, as freePrologThread() clears it
before scanning the hazards. Seen in atom-GC under load with asan.
- FIXED: crash validating atom_t in threads without a Prolog engine
The validate_api flag is a thread-local Prolog flag. Checking it in
a thread without engine, e.g., the thread that joins threads whose
handle was garbage collected, dereferenced a NULL LD in PL_blob_data().
Atoms and functors are now always checked in such threads.
- ENHANCED: debug builds check that GC handles all VM variable arguments
At startup, debug builds walk each VM instruction that has a variable
argument through
walk_and_mark() and verify the variable is marked
or cleared. A missing case makes GC reset a variable the clause
still uses, as happened for I_RATIONAL and A_ROUNDTOWARDS_V. A new
instruction that walk_and_mark() does not handle now stops the debug
build when it creates boot.prc.
- FIXED: crash on roundtoward/2 with an invalid variable rounding
mode The compiled A_ROUNDTOWARDS_V raised no error and left the
arithmetic context open. It now raises the same errors as the
interpreted version.
- FIXED: GC reset variables still used by rational/1 and roundtoward/2
When GC runs inside a call, it walks the remainder of the clause
to find the environment variables that are still used and resets
the others. The walk did not know I_RATIONAL (rational/1)
and A_ROUNDTOWARDS_V (roundtoward/2 with a variable mode), so
their variable was reset to an atom, e.g., making
A is 1 rdiv 3,
garbage_collect, rational(A) fail. Generational GC made this show
in the WASM tests.
- FIXED: Windows (MinGW): crash in engine_yield/1 With VMI functions,
engine_yield/1 returns from the VM using
longjmp(). The MinGW-w64
longjmp() unwinds the stack using SEH, which crashed (seen under
Wine) while unwinding from a VMI function. We now use the non-SEH
setjmp()/longjmp(), as we only jump over C frames.
- FIXED: Windows: tmp_file_stream/3 ignored the
extension(Ext) option
The name from _wtempnam() was used without adding the extension, so,
e.g., PceEmacs chose the wrong mode for a temporary file.
- FIXED: size_t conversion of a big integer on 32-bit systems
PL_get_size_ex() raised
type_error(integer, Value) rather than
representation_error(size_t(Value)) for an integer that needs a bignum
when size_t is 32 bits (e.g., WASM), because the bignum case was not
reached. Negative bignums now raise domain_error(not_less_than_zero,
Value).
- TEST: trace_gc: the user_error test needs threads Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com> Claude-Session:
https://claude.ai/code/session_01Y7pJ6r44CrdPMcpJvHR8Eb
- TEST: local_blobs:empty_chunks_returned: bound by the live blobs,
not a constant The number of chunks that remain depends on how many
blobs survive and how they are spread over chunks, which depends
on the earlier tests and the stacks. Under load the test found 58
chunks against a bound of 50. Check what the sweep promises instead:
only chunks holding a live blob and the empty ones that make room
for
max(2*Live, 1024) blobs remain.
- TEST: test.pl: do not warn about the type tests on constants
type_test(type-2) tests atom/1 on constants on purpose. The compiler
warned that these are always true or false while loading test.pl,
outside any test, which made a run with --on-error=status exit with
status 1 after all tests passed.
- FIXED: library(persistency): spurious encoding warning on a truncated
database A database truncated inside a multibyte character printed an
"Illegal UTF-8 continuation" warning besides the truncated_db warning.
The file is now read with
encoding_errors(error), so the decoding
problem is handled as the syntax error at the end of the file that
triggers the recovery.
- ADDED: stream property
encoding_errors(Mode) to raise on undecodable
input With encoding_errors(error), input that cannot be decoded raises
error(syntax_error(encoding(Message)), Context) rather than printing a
warning and returning U+FFFD. The default is warning. The option is
accepted by open/4 and set_stream/2 and reported by stream_property/2.
- FIXED: xref_defined_class/3 only enumerated the first local class
A cut in the clause for local classes stopped enumeration after the
first class of a file. As a result, the xpce class index listed only
one class per library file.
- FIXED: prolog_canonical_source/2: relative name of a loaded file If the
file was loaded, a relative name or alias such as library('lists.pl')
was returned as its own identifier rather than the absolute file
name, because source_file/1 resolves such names. The identifier thus
depended on whether the file was loaded. This made xref_source/2
store its data under a different identifier than later queries use
if cross-referencing autoloaded the file itself, e.g., the xpce class
index lost all classes of
library(pce_colour_item).
[Nov 11 2026]
- ADDED: garbage collection of functors Functors created from data,
e.g., by =../2, functor/3 or read/1, are now collected by atom garbage
collection if no term, clause or record uses them, together with their
name atoms. Before, every functor and its name were kept forever, so
a program that builds compounds from external data grew without bound.
- FIXED: clause GC did not reclaim the last clause erased before it
started A clause erased at the generation at which clause garbage
collection started was considered visible, so it was kept until some
other database update advanced the generation. A clause erased at
generation G is not visible for a frame at generation G.
- FIXED: race between garbage collecting a thread handle and reclaiming
the thread
free_thread_info() read the thread handle without holding
the handle lock, so atom garbage collection could reclaim the handle
while it was used. This could crash the gc thread.
- FIXED: sizes of thread-local predicates could access freed clause
indexes Completes the previous fix: '$thread_local_predicate_size'/3
and the thread_property/2
size also walk the clause indexes
of another thread's thread-local predicate, which clause garbage
collection could free concurrently.
- FIXED: memory ordering between creating atoms and rehashing the atom
table Creating an atom checked whether the table was being rehashed
without a full barrier between publishing the new atom and reading
the flag. On hardware that reorders a store with a later load the
rehash could miss the new atom, and another thread could create a
duplicate atom.
- FIXED: concurrently creating functors could create duplicates A
functor created while another thread rehashed the functor table could
be missing from the new table, after which another thread created
a second functor with the same name and arity. Functors are now
created under a lock; lookup remains lock-free.
- FIXED: clause garbage collection could miss a frame that is being
created A new frame gets its generation before the top of the local
stack is moved over it. If clause garbage collection scanned the
thread at that moment, it could reclaim a clause erased after the
frame started, so the call did not see this clause.
- FIXED: sizes of thread-local predicates of other threads
could access freed clauses thread_property/2
size and
'$thread_local_predicate_size'/3 walked the clauses of another thread
while that thread reclaimed them. The local clause garbage collector
now waits for such walks. Also, the thread-local definitions of a
thread are no longer accessed after the thread stopped running.
- FIXED: message_queue_property/2 enumerating anonymous queues during
atom-GC Enumerating queues could access an anonymous queue reclaimed
concurrently by atom garbage collection. A queue being enumerated
is no longer reclaimed, and the enumeration holds a reference to
its handle.
- FIXED: thread_create/3
inherit_from(T) while T terminates The new
thread copied data from T while T could free it. A terminating thread
now waits until such copies are completed. Also release T on the
error paths of thread_create/3.
- FIXED: thread_detach/1 was sometimes lost The thread flags were bit
fields that share a word. Updating one flag, e.g., by the thread
itself while it starts, could undo a concurrent thread_detach/1,
leaving a completed thread that is never reclaimed.
- FIXED: joining a thread by id while its handle is garbage collected
If the handle of a completed thread was garbage collected while the
thread was joined using its integer id, both the garbage collector and
thread_join/2 could reclaim the thread. The handle now keeps a link
with the thread that is protected by a dedicated lock, as handles are
released by atom garbage collection, which cannot use the thread lock.
- MODIFIED: release mutexes held by a terminating thread A mutex
locked by a thread that terminates without unlocking it, e.g., using
thread_exit/1 or mutex_lock/1 without mutex_unlock/1, remained locked.
A new thread that reuses the thread id was considered its owner.
Such mutexes are now unlocked when the thread terminates.
- FIXED: halting accessed exiting threads unsafely and did not join
At halt, the data of running threads was accessed without protecting
it against the thread exiting concurrently. Completed threads were
only joined if another thread was joining them as well, due to an
inverted test. Completed threads that are not detached are now joined
and the status
true is handled as well.
- FIXED: garbage collecting a thread handle while the thread is joined If
the handle of a completed thread was garbage collected while another
thread was joining it by its integer id, both reclaimed the thread.
Discarding a handle whose thread was already reclaimed crashed.
- FIXED: race reusing thread slots could give two threads the same slot
The free list of thread slots was a lock-free stack that suffers from
the ABA problem. Slots are now added to and taken from the free list
while holding the thread lock.
- FIXED: thread_detach/1 did not reclaim completed threads Detaching
a thread that completed, or was completing, marked it as detached,
but its resources were never reclaimed. The completing thread now
decides whether it is detached while holding the thread lock and
thread_detach/1 reclaims threads that completed before.
- FIXED: crashes using threads and engines that are exiting or destroyed
- engine_destroy/1 deleted the engine mutex while another thread could
be waiting for it in engine_next/2 or engine_post/2,3. The mutex is
now deleted when the engine handle is garbage collected and waiting
threads raise an existence error. - thread_create/3 using
inherit_from(T) crashed if T completed but was
not joined. It now raises an existence error if T is not alive.
- set_thread/2 using debug_mode or class could access the data of a
thread that exited concurrently.
- FIXED: goals woken when receiving a message ran holding the queue lock
Receiving a message whose unification wakes goals, e.g., from freeze/2,
ran these goals while holding the lock of the queue. If such a goal
used the queue, e.g., sending a message to it, the thread deadlocked.
The message is now claimed while the woken goals run without the lock.
If they fail the message remains at its position in the queue.
- FIXED: use of mutexes after another thread destroyed them A thread
that found a mutex could lock it after another thread destroyed it.
Mutexes now count their users and mutex_destroy/1 defers destroying
a mutex in use to its last user.
- FIXED: use of named message queues after another thread destroyed
them A thread that found a named queue could lock it after another
thread destroyed and freed it. message_queue_property/2 and
is_message_queue/1 read queues after releasing them or without locking.
Queues are now destroyed under the same lock used to find them and
queues are pinned while their properties are enumerated.
- FIXED: hazard pointer races on the atom and functor tables Threads
announce the atom table, atom bucket, functor table or the local data
of another thread they use in a hazard slot, which is scanned before
the object is freed. The announcement was not ordered before reading
the object and the table was not checked to be still current after
the announcement, so a resized table could be freed while a thread
started using it.
- FIXED: thread_wait/2 deadlocked if the goal changed a watched
predicate If another thread was waiting, a goal of thread_wait/2
that modified a predicate it waits on, e.g., two threads running
thread_wait(retract(job(X)), [wait_preds([job/1])]), deadlocked on
the first call. Waiting threads were also removed from the list of
waiters without holding the lock used to walk this list.
- FIXED: thread_signal/2, set_thread/2 and thread_property/2 bugs -
thread_signal/2 with an integer signal used an uninitialised thread
if the thread does not exist and succeeded after raising an error.
set_thread(T, alias(A)) gave the alias to the calling thread. -
thread_property(T, size(S)) crashed if a temporary module with a
thread local predicate was destroyed. - Clause garbage collection
could scan an exiting thread's predicate
references after they were freed.
- FIXED: message_queue_set/2: changing max_size could hang writers
Setting max_size of a queue to 0 (unlimited) left writers that waited
for space blocked. Setting max_size on a queue created without one
waited on an uninitialised condition variable. Raising max_size only
woke a single waiting writer.
- FIXED: '$vm_assert' accepted only rationals for big integer operands
Also initialise a global stack cell in updating delay lists that
could be seen uninitialised by the garbage collector after an error.
- FIXED: tabling used variable pointers after compiling an answer trie
Calling a completed table whose answer trie was not yet compiled,
and claiming a shared table, could shift the stacks between finding
the variables of the call and building the answer skeleton from them.
The lookup is now redone if the stacks moved.
- FIXED: debugger and frame events used frame pointers after a shift
The tracer and the frame_finished event kept pointers to local stack
frames across calls that may shift the stacks: the / and S commands
of the tracer, finding a goal using the / command, printing a C-level
backtrace and creating the arguments for the frame_finished event.
- FIXED: PL_error() read pointer arguments after a possible stack shift
Errors whose culprit is passed as a pointer (occurs check, standard
order of cyclic terms, and type and domain errors from arithmetic)
read the culprit after creating a foreign frame and term references,
which may shift the stacks.
- FIXED: \=/2, nb_setarg/3 and
can_unify() used pointers after a shift
These took pointers to their arguments and then created a foreign
frame or term reference, which may shift the stacks, before using
the pointers.
- FIXED: stale stack pointers in nb_current/2, continuations and others
These used a pointer or value on the stacks after a call that may
shift the stacks or run garbage collection.
- FIXED: get_dict/3 enumeration could use the dict after it moved
get_dict/3 with an unbound key kept pointers into the dict while
unifying the values, which may shift the stacks or run garbage
collection. '$get_dict_kv'/6,8 had a similar problem.
- FIXED: stale stack data in arithmetic, reading a variable and writing
rationals Several built-ins used data on the stacks after a call that
may shift the stacks or run garbage collection.
- FIXED: retract/1 and retractall/1 could use stale argument pointers
retract/1 kept a pointer to the arguments of the head while decompiling
clauses, which may shift the stacks or run GC, and used it to find the
next clause. retractall/1 obtained it before opening a foreign frame.
The pointer is now recomputed after these calls.
- ENHANCED: pack_install/2 verifies downloaded archives against
their hash If the pack server knows the SHA1 hash of an archive, the
downloaded archive must have this hash. On a mismatch pack_install/2
asks for confirmation or, if not interactive, fails with an error.
Archives generated by GitHub are not verified because GitHub may
regenerate them.
- FIXED: pack_install/2: do not let git read URLs and refs as options
The URL passed to git clone and the commit, tag or branch passed
to git checkout can come from the pack server or the repository.
The clone URL is now preceded by "--" and refs that start with a "-"
raise a domain error.
- MODIFIED: library(git): reject arguments that git would read as
options Commits, branches, remotes, revision ranges and URLs passed
to the library are positional arguments of git. If such an argument
starts with a "-", git processes it as an option, e.g., --upload-pack
or --output. These now raise a
domain_error(git_argument, Arg).
- FIXED: www_open_url/1: pass the URL to the browser without the
shell The browser was started using shell/1 with the URL between
double quotes, where the shell still expands $(...) and backquotes.
The browser is now started using process_create/3. URLs that start
with a "-" are rejected.
- MODIFIED: writeq/1 writes a 0-code in quoted text as \0\ Quoted
atoms and strings with a 0-code were written with the raw 0 byte.
They are now written using the octal escape \0\, which reads back as
the same text.
- ADDED: PL_recorded_external_len() to decode untrusted external
records PL_recorded_external_len() validates a record of the
given length before copying it to the Prolog stack and fails if
it is invalid. Use it for records read from files or databases.
PL_recorded_external() still trusts its input.
- MODIFIED: errors for text with a 0-code and integers that do not fit
C Converting text with an embedded 0-code to a 0-terminated C string,
as done by PL_get_chars() and the other functions that do not return
the length, raises
representation_error(nul_terminated_string(Text))
instead of silently using the text before the 0-code.
- MODIFIED: read_pending_codes/3 on invalid UTF-8 returns U+FFFD
read_pending_codes/3 and read_pending_chars/3 failed on an illegal
UTF-8 start byte and judged sequences only by their first byte.
They now decode as get_code/2 does, returning U+FFFD for invalid
sequences and for an incomplete sequence at the end of the input.
- FIXED: converting text ending in an incomplete multibyte sequence
Converting multibyte (locale) text, e.g. environment values and
file names, did not handle an incomplete sequence at the end of
the text and read before the start of the text. This now raises an
incomplete_multibyte_sequence error.
- MODIFIED: reject overlong and out-of-range UTF-8 sequences Decoding
UTF-8 from streams and from text now only accepts the shortest encoding
of a code point up to 0x10FFFF. Streams return U+FFFD with a warning
for other sequences, decoding text maps the first byte to its code
as for other invalid UTF-8.
[Nov 10 2026]
- ENHANCED: faster compilation of deeply nested disjunctions Balancing
the variables of the alternatives of a disjunction scanned both
alternatives, which made compiling nested disjunctions quadratic in
the size of the clause. The variable analysis now computes the set of
frame slots used by each alternative bottom-up, so the cost is limited
to the number of slots times the nesting depth. The generated code
is unchanged.
- FIXED: loading clauses with more than 65535 variables from .qlf files
The variable counts of a clause were truncated to 16 bits when loading
a .qlf file.
- ENHANCED: share frame slots between alternatives of disjunctions
Variables that only appear in one alternative of a disjunction,
if-then-else or soft-cut now share their frame slot with variables
local to the other alternatives. This reduces the frame size and
removes most of the C_VAR instructions needed to balance the variables
of the branches.
- FIXED: unbounded
alloca() when loading QLF terms and in setenv/2
Loading a QLF term allocated its variable table on the C stack using
a size from the file and did not check variable indexes. Large tables
now use the heap and invalid counts and indexes are QLF format errors.
On systems without setenv(), setenv/2 allocated its argument on the
C stack.
- ENHANCED: reduce C-stack usage of the VM and arithmetic GMP_STACK_ALLOC
is reduced from 1024 to 256 units. This buffer for GMP temporaries
is part of the frame of PL_next_solution() and arithmetic functions
such as is/2 and comparison. The smaller buffer has no measurable
impact on bignum performance and allows threads with a 64Kb C stack
to run code that needs to call Prolog from C, such as autoloading.
- FIXED: crashes compiling and decompiling deeply nested clause bodies
Compiling clauses with deeply nested disjunctions, if-then-else or
negation and decompiling such clauses (clause/2, retract/1, listing/1)
could exhaust the C stack. Clauses with many variables could do so
in threads with a small C stack.
- FIXED: term_hash/4 crashed on deeply nested terms term_hash/4 recursed
in C for each argument, overflowing the C stack for terms nested
about a million deep, including long lists. The term is now walked
using an explicit stack. Hash values are unchanged.
- MODIFIED: PL_atom_normalize_hook(): pass an output buffer and its size
The normalisation hook used to normalise in place, assuming NFC is
never longer than its input. NFC may be longer, e.g., for U+0958.
The hook now takes an input and output buffer, where the output
buffer may be the input buffer. On entry *size is the capacity
of the output buffer; on return it holds the length of the result.
If the buffer is too small, nothing is written and the caller may
call again with a buffer of at least *size bytes.
- FIXED: library(semweb/rdf_sandbox) declared nothing when loaded from
.qlf The library only adds declarations for modules that are loaded
when it is loaded. The .qlf file was created when none of these were
loaded, so it declared nothing. The library is no longer QLF compiled.
- FIXED: library(sandbox): declare is_address/1 safe must_be/2 calls
is_address/1 for the type
address, which made must_be/2 and all
predicates using it unsafe.
- MODIFIED: library(sandbox): deny throwing and printing format messages
throw/1 now rejects exception terms whose message translation uses
a user-provided format string:
format(Fmt,Args), debug(Fmt,Args)
and error(format(Fmt,Args),_). Exceptions are often printed outside
the sandbox. print_message/2, message_to_string/2 and throw/1 now
require the message to be sufficiently instantiated.
- FIXED: library(sandbox): check write options, format messages and
file paths - write_term/2, term_string/3 and the format/2,3 ~W
directive check
the portray_goal option, which calls its argument with two extra
arguments. - print_message/2 and message_to_string/2 check messages
of the form
format(Fmt,Args), debug(Fmt,Args) and error(format(Fmt,Args),_).
- FIXED: term_string/3: resolve the portray_goal option in the
caller's module term_string/3 is now module transparent. Before,
the portray_goal option was resolved in the system module
$syspreds.
[Nov 9 2026]
- FIXED: reading big integers took time quadratic in the number
of digits Reading an integer with 1,000,000 digits took about
8 seconds. Big integers are now converted using
mpz_set_str(),
which is subquadratic. The above now takes 0.03 seconds.
[Nov 8 2026]
- FIXED: format/2: limit numeric arguments and fix overflows and a leak
Precision arguments (~Nd, ~Ne, ~Nf, ~Ng) are limited to 1,000,000
digits and column, repeat count and pad arguments (~Nc, ~Nn, ~Ns,
~N| and ~N+) to 1,000,000. Larger values raise a format error.
~NI requires 0 =< N =< 126. Huge values could make format/2 allocate
unbounded C memory or overflow. Errors after ~t leaked memory.
- FIXED: arithmetic: crashes and wrong results on extreme integers
X is 3^ -9223372036854775808 and
length(L, 6148914691236517206)
crashed, integer/1 and round/1 of 2^63 returned 9223372036854775807,
shifting a negative integer right by a huge amount gave 0 and growing
a GMP/LibBF temporary could overflow the C stack.
- ENHANCED: fast_read/2 and fast_term_serialized/2 validate their input
Records read using fast_read/2 or decoded using fast_term_serialized/2
are now verified before being turned into a term, making it safe
to use these predicates on untrusted data. Invalid data makes
fast_term_serialized/2 fail and fast_read/2 raise a syntax error.
Decoding is about 10% slower for small and 45% for large records.
Also fixes a crash on cyclic terms with dicts, copy_term/2 looping
on invalid attributes and PL_recorded_external() reporting out of
memory as success.
- FIXED: read_term/2: invalid terms and stack corruption on malformed
input A dict key that is an unpaired Unicode bracket or stray
Unicode closing quote (e.g.,
_{⟩:a}) created an invalid term and
`{|Syntax||}` corrupted the Prolog stacks.
[Nov 6 2026]
- ENHANCED: check_installation/0: use graphviz_engine/1 Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com>
- DOC: list the graphviz package in the package documentation index
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FIXED: dark theme lacked the predicate info and exception header
colours Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Nov 5 2026]
- ENHANCED: license/0: add category copyleft, EPL and Sleepycat licenses
Licenses such as the EPL, whose copyleft is limited to the component,
were reported as proprietary. They are now listed in a separate
section, and license/0 warns if EPL-1.0 is combined with the GNU GPL.
Added the Sleepycat license of Berkeley DB up to 5.3. The macOS
package documentation mentions the EPL-1.0 license of Graphviz.
- BUILD: include package graphviz in the source tape and changelog
mkchangelog skipped submodules that did not exist at the start version.
It now lists the full history of such new packages.
- ENHANCED: check_installation/0 checks
library(graphviz) and lists
its engines Warns if the dot layout engine is missing.
- BUILD: Add package graphviz to the GUI package set Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com>
- ADDED: jiti_index_columns/2 to present an index as jiti_list/1 does
Allows tools such as the predicate info sheet of the IDE to show
the indexes of a predicate using the same notation as jiti_list/1,
which now uses this predicate.
[Nov 4 2026]
- ADDED: generational stack garbage collection (flag gc_generational)
If the new Prolog flag gc_generational is true (default), data that
survived a garbage collection is old and most collections are minor:
they only mark and compact the global stack data created since the
previous collection. This makes garbage collection much cheaper
for programs that keep large amounts of data on the stacks, notably
if the stacks are frozen by nb_setval/2, nb_setarg/3 or exceptions.
Major collections run when the old data has grown considerably, and
for garbage_collect/0.
statistics(minor_collections, N) counts the
minor collections and trace_gc reports them as gc(minor(...)).
[Nov 5 2026]
- DOC: VM comparison: results of B, C and F; A not done Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com> Claude-Session:
https://claude.ai/code/session_01Y7pJ6o4Mj6GXpj5qhJ2NS2
- ENHANCED: Compile comparing variables and small integers to one
instruction With optimise, Var1 <cmp> Var2 and Var <cmp> SmallInt
compile to A_CMP_VV and A_CMP_VI, which compare small integers inline
instead of going through the arithmetic stack (A_ENTER, A_VARn,
A_LT, ...). Other values are evaluated as for the predicates.
Saves 3% of the instructions on the benchmark suite, 16% on tak and
32% on sendmore.
- ENHANCED: B_UNIFY_VV calls
do_unify() directly Var1 = Var2 in a
body now uses the same fast path as H_VAR: call do_unify() directly
and only use unify_ptrs() after a stack overflow. Saves 4% of the
instructions on tak.
- ENHANCED: Fast cut if the only choicepoint is the frame's own If I_CUT
finds that the youngest choicepoint belongs to the current frame and
its parent is older than this frame, there are no frames to discard
and the cut only needs to drop the choicepoint, avoiding the generic
discardChoicesAfter(). Saves about 2% of the instructions on the
benchmark suite and up to 8% on derive, log10, times10 and divide10.
- ENHANCED: No H_POP for a compound in the last head argument A compound
in the last head argument is now compiled as H_RFUNCTOR or H_RLIST,
as is already done for the last argument of a nested compound,
avoiding pushing and popping the argument pointer. This saves 8%
of the machine instructions for naive reverse.
- DOC: Compare the VM with YAP, SICStus, XSB and Ciao
doc/vm/comparison.md: benchmark suite results, machine instructions and
cycles per logical inference for nrev and tak, the exact instruction
cost of each VM instruction in app/3 and tak/4 against the WAM code
for the same clauses, and candidate changes ordered by gain per effort.
- FIXED: abolish_all_tables/0 on a few tables was slow Sorting the tables
of a private variant table in creation order uses a radix sort that
clears and scans 64K counters per pass, regardless of the number
of tables. This made the moded_path benchmark, which abolishes
its few tables in each iteration, 3.5 times slower. Use
qsort()
for fewer than 16K tables.
- FIXED: collecting profile data was quadratic in the size of the
call tree $prof_procedure_data/9 walked the whole call tree for every
predicate, so collecting the data took (#predicates x #nodes). For the
sCASP test suite (3.9M nodes) this took longer than the profiled run
and could not be interrupted, as signals were only handled at matching
nodes. We now build an index from each handle to its nodes in one
non-recursive walk, valid while the tree keeps its shape. The new
'$prof_procedures'/1 returns the profiled procedures from the index,
replacing an enumeration of all nodes in Prolog.
[Nov 4 2026]
- FIXED: PL_get_list_slice() created a local reference for a variable
list If the list argument was an unbound variable in the term reference
itself,
linkValI() created a reference into the local stack. Debug
builds failed an assertion (packages/cpp test_ffi.pl, list_slice).
- FIXED: '$seek_list'/4 (nth0/3, nth1/3) kept a raw pointer across
signal handling A signal handler that runs Prolog may garbage collect
or shift the stacks, after which the walk continued on a stale pointer.
- FIXED: removing a choicepoint without restoring LD->mark_bar
Deterministic exit or failure of a non-deterministic foreign predicate
(I_FEXITNDET), an SSU commit and skipping debug choicepoints removed
the choicepoint without DiscardMark(). LD->mark_bar then stayed
above the global stack top after backtracking. This caused needless
trailing and CHK_SECURE assertion failures in debug builds.
- FIXED: a pending signal made foreign code fail if an exception was
pending
handleSignals() returned -1 ("a handler raised an exception")
if an exception was already pending, without handling anything. Code
that checks for signals while the caller holds a pending exception,
e.g., PL_get_nchars() writing the exception term, then failed.
Signals are now deferred while an exception is pending. Seen with
SIG_TUNE_GC, raised after a slow GC. Test in packages/cpp test_ffi.pl.
- FIXED:
trim_stack() could move the stack limit below the top If there
was no room at all (top == max), trim_stack() reserved the full spare
area, leaving top above max. Surfaced by generational GC through
tests/GC/test_tracer_callback.pl.
[Nov 5 2026]
- DOC: Survey of low-hanging VM performance improvements
doc/vm/survey.md: profiles of bench/,
s(CASP) and Alpino, ranked
candidates for clause selection of small static predicates, call/N,
compiling arithmetic by default, call and exit, last-call optimisation
and head code, and the measured results of the experiments, including
those that were shelved.
[Nov 4 2026]
- ENHANCED: Unifying simple terms needs no stack frame
do_unify()
reserved its compound-term agenda on every call. The compound case is
now a separate function, so unifying a variable or an atomic value,
e.g., from H_VAR, is frameless and inlines the simple case. bench/:
1.2% faster; boyer, chat_parser and zebra 4-5% fewer cycles.
- ENHANCED: JIT indexing: allow a few clauses with a variable in small
tables An argument was not indexed if the clauses with a variable
there exceed max_var_fraction of the distinct keys, so a single
catch-all clause in a table of fewer than 10 entries prevented
indexing. Now this only applies if the variable clauses, which are
added to every bucket, take more space than the clauses themselves.
Looking up the 7th entry of an 8 clause table with a catch-all on
the second argument drops from 59 ns to 27 ns.
- FIXED: JIT indexing could use a poor index if a much better one
exists The candidate indexes of a static predicate were not sorted
by speedup, while the first index whose arguments are bound is used.
A deep index on a poorly discriminating argument could thus shadow a
good one. For Alpino's z_f2/3 (130K clauses), calls with the first
two arguments bound took 8-30 us instead of 0.1-0.5 us; Alpino's
g_suite runs 6% faster.
- FIXED: Compiling arithmetic with optimise=true raised an error on [X]
with unbound X With optimise=true, a "char" list [X] in arithmetic
was evaluated at compile time, raising an instantiation error if X is
unbound, as in
[H] =\= Sep. Such goals are now compiled as normal
calls, evaluating [X] at runtime. Found by loading Alpino with -O.
- FIXED: Resolve autoload/1,2 declarations of system and library modules
in the swi dialect If expects_dialect/1 is called at runtime, e.g.,
by the splfr app, lazily resolving an autoload/2 declaration of a
library such as library(option) found library(dialect/sicstus/lists)
rather than library(lists), causing warnings such as "library(lists)
does not export selectchk/3".
- FIXED: Crash after redefining the '$wrap$P' predicate of a wrapped
predicate The wrapper supervisor of P referenced the clause reference
of the wrapper clause in '$wrap$P'. As this supervisor is attached
to P, changes to '$wrap$P' do not reset it. If user code redefined
'$wrap$P', e.g., by copying all dynamic predicates of a module to a
file as done by Alpino's Hdrug, clause garbage collection freed the
clause reference and S_CALLWRAPPER used freed memory.
[Nov 3 2026]
- ADDED: Profile global stack memory The profiler charges the global
stack allocated since the last change of the current node to the
node it leaves, like the exact time modes. Memory reclaimed by GC is
added back. Memory discarded by backtracking is charged to the node
that created the choicepoint, e.g., for p :- \+ \+ q, q allocates
and p discards. profile_data/1 provides alloc_self, alloc_siblings,
discarded_self and discarded_siblings for each predicate and allocated,
discarded, gc_reclaimed and gc_count in the summary. show_profile/1
and profile/2 accept
measure(memory).
- MODIFIED: the callers and callees of a predicate in profile_data/1 are
now node/8 terms. The added argument is
mem(Alloc, AllocSiblings,
Discarded, DiscardedSiblings). Code that matches the old node/7
terms must be updated.
- FIXED: trace_gc reports go to user_error of the thread Stack GC and
stack shifts printed their trace_gc report using Sdprintf(), i.e.,
on the process stderr rather than on the console of the thread, e.g.,
in swipl-win. They now queue the report and raise the new signal
SIG_TRACE_GC that prints it at a safe point using print_message/2 as
gc(done(...)) or shift(done(...)). An exception from printing the
message propagates.
- FIXED: Word-align the clause_ref below a restarted continuation
On 32-bit platforms SIZEOF_CREF_CLAUSE is 20 bytes, so the local
frame that
push_continuation() creates above the clause_ref was not
word-aligned, corrupting the local stack. Round SIZEOF_CREF_CLAUSE
to a word, and do the same for the clause_ref behind compiled trie
clauses.
- FIXED: Tabling handles on 32-bit platforms The check of a worklist
or component handle was shifted in a size_t, which is 32 bits on
e.g. WASM. This lost the serial, so handles looked stale and tabling
raised errors or crashed.
- FIXED: Local blob hash shifted a 32-bit pointer by 35 bits On 32-bit
platforms such as WASM, uintptr_t is 32 bits, making h>>35 undefined.
Compute the hash on a 64-bit copy of the address.
[Nov 2 2026]
- DOC: Design notes on the cell layout doc/tagging: the kind byte,
the rejected top tags with their measurements, pointer integers and
the tabling handles.
- MODIFIED: C pointers handed to Prolog are pointer integers
PL_put_pointer() and PL_unify_pointer() create a pointer integer: an
integer for Prolog that is not identical to the plain integer with
the same value. PL_get_pointer() only accepts pointer integers,
so an integer typed by the user or computed using arithmetic is no
longer taken for a C pointer. Foreign code that creates a pointer
using PL_unify_int64() or similar and reads it using PL_get_pointer()
must use PL_unify_pointer() or PL_put_pointer(). Added is_address/1
and the type
address for must_be/2.
- ENHANCED: Cells reserve 8 low bits for their kind, rationals get
their own The kind of a cell (
tagex()) now has 6 bits: the tag,
the storage and a variant bit that distinguishes kinds sharing tag
and storage. The GC bits move to bits 6 and 7 and values start at
bit 8. Small integers have 56 bits (max_tagged_integer is 2^55-1).
On 32-bit systems atom_t and functor_t keep 24 bits of value, i.e.,
at most 16M atoms and 512K functors. Rationals (MPQ) use the integer
tag with the variant bit, so isMPQNum(), isMPZNum() and isInteger()
test the cell rather than the MP_RAT_MASK flag in the indirect data,
which is removed.
- ENHANCED: term_hash/2 and variant_sha1/2 hash numbers by value,
the same on all platforms An integer that fits in 64 bits is hashed
as int64_t, a larger integer as its sign and big-endian magnitude, a
rational as numerator and denominator, and numbered variables by their
number. Other integers that are hashed (atom hashes, intermediate
hashes, lengths, arities) are hashed as fixed-width little-endian
values and wide text as little-endian 32-bit code points. Hashes thus
no longer depend on the cell layout, the big integer backend (GMP or
LibBF), the byte order or the size of wchar_t. Hashes of big integers,
of terms with variables and of strings and wide atoms by variant_sha1/2
change. term_hash/2 returns its hash as unsigned on 32-bit systems.
- CLEANUP: Hide the raw tag bits of cells behind pl-data.h macros
Type tests use
hasTag(), indirect headers, atom and functor values
use consTagged()/valTagged(), and GC scans the global stack downward
with isMarkedOrIndHdr() and reads the trail tag with tag() rather than
bit 0. The XR table of QLF files and trie values test what they mean
rather than relying on the tag bits of atom_t. The generated code
is unchanged; this allows changing the cell layout in pl-data.h alone.
- ENHANCED: Tabling worklists and components use integer handles Prolog
refers to a worklist or component using a small integer that combines
an index in a per-thread slot array with a serial and the kind of
object. Decoding it is cheaper than decoding a blob and creating it
does not create an atom. A stale handle raises an existence error,
also if its slot was reused, and a worklist handle is not accepted
as a component.
[Nov 1 2026]
- ENHANCED: Idle threads and engines release their thread-local blobs
thread_idle/2 and detaching an engine that has no open queries using
PL_set_engine() sweep the thread-local blobs the thread or engine
created since its last sweep. Only the owner releases them, so a
thread waiting for a message or an idle engine of JPL's pool kept
dead blobs, and the resources they refer to, until it ran again.
- DOC: Design note on local blobs: JPL Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com> Claude-Session:
https://claude.ai/code/session_01Y7pJ6qWn1wT3Z1hCrDKgdd
- ENHANCED: Thread-local predicates keep their atoms and clauses local
As only the owning thread can access the clauses of its thread-local
predicates, the compiler registers their atoms without promoting
them, and the owner frees retracted clauses itself at a safe point
after marking the generations of its own frames, instead of leaving
them to the global clause GC, which marks the stacks of all threads.
One million assertz/1 and retract/1 pairs on a thread-local predicate
take 0.81 s process CPU instead of 1.62-1.70 s, without global
clause GC.
- MODIFIED: Clauses of thread-local predicates are only accessible by
their thread Using a clause reference to a clause of a thread-local
predicate of another thread, e.g., with clause/3, clause_property/2,
nth_clause/3 or erase/1, raises
permission_error(access,
thread_local_clause, Ref). Calling a continuation that refers
to such a clause in another thread raises permission_error(call,
thread_local_clause, Cont). Such access used to work, but is dubious:
the clauses are private to the thread.
[Oct 31 2026]
- ENHANCED: New atoms of PL_unify_chars() and read_term/2 are
thread-local New atoms that PL_unify_text() and thus PL_unify_chars(),
atom_concat/3, atom_codes/2 and similar builtins create only to unify
a term, as well as new atoms read by read_term/2, start as local
atoms of the thread. The thread reclaims them in its own sweep,
without global atom garbage collection. They remain unique: another
thread that looks up the same text finds the atom and promotes it, as
does storing it in a clause, a functor, a flag, a record or a table.
Atoms created by PL_new_atom() and friends remain ordinary atoms.
- CLEANUP: Use bool for truth values in atom, blob and stream code
bump_atom_references(), invalidateAtom(), rehashAtoms() and friends,
the new flag of lookupBlob(), the dbref helpers, Srelease() and
the close helpers answered int.
- ENHANCED: undo/1 goals are thread-local blobs The blob that holds
the goal of undo/1 no longer copies a key and is not in the atom
table, as every call records its own goal. It is a local blob of
the thread, which reclaims it in its own sweep, without global atom
garbage collection.
- ENHANCED: Stream handles are thread-local blobs A stream handle is now
a PL_BLOB_NOCOPY blob on the stream itself, so creating or finding
the handle of a stream needs no copy of a key and no allocation.
The thread that creates a stream handle reclaims it in its own
sweep as soon as it is no longer referenced, without global atom
garbage collection. Another thread that finds the stream, e.g.,
using an alias or stream_property/2, gets the same handle, which is
then promoted, as is a handle sent to another thread.
- ADDED: PL_BLOB_LOCAL blob type flag for foreign blob types Blobs of
a PL_BLOB_LOCAL type start as local atoms of the creating thread,
which reclaims them in a sweep of its own, without global atom
garbage collection. They become ordinary atoms as soon as they may
be reachable from another thread. current_blob/2 enumerates the
local blobs of the calling thread, which stay local.
[Oct 30 2026]
- ENHANCED: Clause and record references are thread-local blobs
Clause and record references are PL_BLOB_UNIQUE|PL_BLOB_NOCOPY blobs
whose data is the clause or record reference itself, so finding the
reference of a clause needs no copy and no allocation. They start
as thread-local blobs that the creating thread reclaims in its local
sweep, without global atom-GC. A lookup of the same reference from
another thread finds the local atom in the atom table and promotes it,
so references remain unique.
- ENHANCED: Private answer tries have thread-local handles The handle
(blob) of a private answer trie is a thread-local blob that the
owner's local sweep reclaims, instead of a global atom that only
atom-GC reclaims after the table is abolished. After abolish, the
handle owns the emptied trie, so stale handles behave as before.
- ADDED: Promote thread-local blobs that escape their thread A local blob
becomes an ordinary blob, with the same atom_t, when it escapes its
thread: PL_register_atom() and lookups that add a reference promote
it, and so do the copies that atom-GC marks rather than registers,
the keys of chunked trie nodes and the messages of message queues.
This is step 3 of doc/tagging/local-blobs.md.
- ENHANCED: Do not initialise new blocks of the atom array The atom
array doubles in blocks. A new block was initialised slot by slot,
so a block of 8M slots (400 MB) became resident as soon as the first
atom used it. Blocks of at least 32 Kb are now mapped zeroed memory
(
alloc_lazy_zeroed()) that is left untouched, so their pages only
use physical memory once atoms are created in them.
- ENHANCED: Tabling worklists and components are thread-local blobs
Prolog now refers to tabling worklists and SCC components using
thread-local blobs instead of raw pointers passed as integers.
A handle to a worklist or component that was freed raises an existence
error rather than reaching freed or recycled memory. For a thread
other than the one completing it, a shared table under completion has
status
incomplete instead of exposing the other thread's worklist.
- ADDED: Infrastructure for thread-local blobs Blobs of a type with
the internal flag PL_BLOB_LOCAL start owned by the creating thread
or engine. The owner reclaims them using a local sweep of its own
roots at a safe point, without global atom-GC. Global AGC neither
marks nor collects them. This is step 1 of doc/tagging/local-blobs.md;
promotion of escaping blobs is not yet implemented.
- DOC: Design note on garbage collecting functors Functors are never
collected and pin their name atom. Compares collecting them in AGC,
hanging functors off their atom and a single symbol table; recommends
the first.
- DOC: Design note on moving type tags to the top of the cell Assesses
replacing the low-bit tag/storage layout with a top-byte type tag,
explicit tags per cell kind and a pointer-integer type.
[Nov 1 2026]
- FIXED: #1560 environment frame after retrying a query in its own frame
When PL_next_solution() retries a query whose remaining choicepoint
is in the query frame itself (e.g. a disjunction in the body of the
predicate passed to PL_open_query()), shallow backtracking resumed
the clause without restoring the environment frame. A deterministic
foreign predicate called as last call then received arguments that fail
the validate_api check, and GC, exceptions, etc. saw the wrong frame.
- ENHANCED: pack_publish/2: create the build directory using
tmp_directory/2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7pJ6qWn1wT3Z1hCrDKgdd
- TEST: Use tmp_directory/2 for temporary test directories Using a
tmp_file/2 name as a directory is not safe if tests run in parallel.
- ADDED: tmp_directory/2 to create a temporary directory
tmp_directory(+Base, -Dir) creates a new directory that is only
accessible to the current user in the directory of the Prolog flag
tmp_dir. If the generated name exists, it tries a new name, so
it is safe if processes create temporary directories concurrently.
When Prolog halts, it removes the temporary files and then the
temporary directories that are empty.
- FIXED: Lookup of a dynamic clause could miss it while another thread
asserts
first_clause_guarded() read the key of a hash bucket twice.
If the bucket only held clauses with our key, the first read returned
that key, a concurrent assert of a clause with another key into the
same bucket reset it to 0, and the second read made the lookup return
no clause. retract/1 or a call could thus fail for an existing clause.
Read the key once.
- TEST: trie_node_chunks:registered could check before clause and atom
GC completed garbage_collect_clauses/0 and garbage_collect_atoms/0
return at once if a collection is in progress, as documented,
and that collection may have started before the compiled clause or
its atoms became garbage. Stop the gc thread during the test, as
test_answer_discard.pl does. The race depends on the timing of the
gc thread; it failed in 2 of 6 ctest runs on a branch with different
clause GC timing.
[Oct 31 2026]
- FIXED: undo/1 goals were never reclaimed The blob that holds the
goal of undo/1 kept the reference that creating it returned, so atom
garbage collection never reclaimed it nor the record of the goal.
Every call to undo/1 leaked. The reference is now dropped once the
blob is on the undo list.
- ENHANCED: creating and closing a stream does not lock L_LOCALE Each
stream holds a reference to the locale of the thread that created it.
The reference count was updated under the global L_LOCALE lock, so
threads that create streams concurrently contended for it. The count
is now updated atomically and only freeing the locale takes the lock.
- ENHANCED: read_term/2,3 does not lock L_FILE for the file name Reading
a term recorded the file name of the stream while holding the global
L_FILE lock, which made threads that read concurrently contend for it.
The reader holds the lock of the stream, so the stream cannot be
closed and its context is not freed: we do not need L_FILE.
- FIXED: race between closing a stream and releasing its handle
S
close() tested the reference count and then either freed the stream
or marked it erased, while atom garbage collection could drop the
last reference of the handle and test whether the stream was erased.
Interleaved, the stream was leaked or freed while still in use.
Now Sclose() atomically adds a closed bit to the reference count
and whoever leaves the count at only this bit frees the stream.
Releasing a handle keeps its reference while it may close the stream.
- FIXED: lock-free hash table access could use a map that was just freed
acquire_kvs() read ht->kvs and then announced the map as in use. If a
resize advanced ht->kvs and freed the map in between, the access used
freed memory. Now acquire_kvs() reads ht->kvs again after announcing
and retries if it changed.
- FIXED: concurrent lock-free hash tables could lose a delete during
a resize A resize published the new map in ht->kvs when it finished
copying, also if another resize was still copying entries from an older
map into it. Operations start at ht->kvs and only look forward, so a
delete could miss an entry that was still in the older map, which was
copied forward afterwards. The map pointer could also move backwards.
Now ht->kvs only advances past maps that are completely copied.
[Oct 30 2026]
- DOC: add mssing values to file_type for absolute_file_name/3
- BUILD: swipl --dump_runtime_variables can run without modules index
[Oct 31 2026]
- FIXED: Races between freeing a clause or record and releasing
its reference
freeClause() tested DBREF_CLAUSE and then set
DBREF_ERASED_CLAUSE, while the release hook of the clause reference
cleared the first and then tested the second. Interleaved, the clause
was either leaked or freed by both. Both sides now use a single CAS on
the flags. For records, the release hook of the reference now holds
L_RECORD, as freeRecordRef() does. It may run with L_REHASH_ATOMS
held, so it only tries the lock and refuses the release if the lock
is busy.
- FIXED: Race between a blob lookup and atom-GC releasing the same blob
If a lookup found a unique blob just as atom-GC started releasing it,
it created a new blob for the same data at once. The acquire hook of
the new blob could then run before the release hook of the old one.
For clause references, the release hook cleared DBREF_CLAUSE after
the new reference set it, which allowed clause GC to free a clause
that still had a reference. The lookup now retries until the old
blob is unlinked.
[Oct 30 2026]
- FIXED: trie_gen_compiled/2,3: crash on a type error The type error
for an argument that is neither a trie nor a clause reference was
raised without setting the top of the local stack, which crashed with
a local stack overflow.
Package PDT
[Nov 13 2026]
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
Package archive
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 9 2026]
- FIXED: archive_next_header/2 crashed on member names not valid in
the locale If a member name cannot be converted to wide characters
using the current locale, the name is now returned as bytes.
- FIXED: archive_extract/3 could write files outside the target directory
Archive members with an absolute path or a path containing
.. were
extracted relative to the target directory using directory_file_path/3,
writing outside it. Such members now raise a permission error.
Package bdb
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 11 2026]
- FIXED: do not trust data read from the database Values are validated
before decoding. Invalid data raises
syntax_error(bdb_illegal_data).
[Nov 5 2026]
- FIXED: register Berkeley DB up to 5.3 under the Sleepycat license
Only Berkeley DB 6.0 and later are AGPL.
Package chr
[Nov 13 2026]
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 12 2026]
- FIXED: sandbox: CHR debugger commands were declared safe
handle_debug_command/3 and ask_continue/1 were declared
safe primitives, so sandboxed code could call the
break command,
which runs break/0 and gives a toplevel that is not sandboxed.
Only the debugger entry 'chr debug_event'/1 is now declared safe; it
does nothing unless chr_trace/0, which is not allowed in the sandbox,
was called.
Package clib
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
- FIXED: open_hash_stream/3 leaked its stream if the output argument
was bound The new stream was never closed and the parent was left
in octet encoding. Close it without closing the parent and raise an
uninstantiation error.
- CLEANUP: memory files: use PL_utf8_code_point() Character offsets
now use Prolog's own UTF-8 decoder, so they agree with decoding
by construction. Requires PL_utf8_code_point().
- FIXED: memory files counted invalid UTF-8 differently from decoding
it Character offsets in a UTF-8 memory file took a lead byte with all
following continuation bytes as one character, while its size and its
content decode only valid, shortest sequences. E.g., with an overlong
C0 AF, the size counted one character more than insert_memory_file/3
accepted as offset.
- FIXED: uri decoding raised an error on %-encoded surrogates %-encoded
UTF-8 for a surrogate or a code point above U+10FFFF, e.g., %ED%A0%80,
raised a representation error. Such sequences now decode as their
bytes, as overlong sequences already did.
[Nov 12 2026]
- MODIFIED: Windows: process_create/3 quoting of arguments The Windows
command line was built by wrapping arguments in '...' or "..." without
escaping. Programs split it using the rules of the C runtime,
so arguments with quotes or a trailing backslash arrived changed,
were merged with the next argument or split into several, and empty
arguments were dropped. Arguments are now quoted using these rules.
- FIXED: race closing the input and output stream of a socket
concurrently
nbio_close_input() and nbio_close_output() cleared their
stream flag with a non-atomic update and closed the socket if both
flags were cleared. If two threads closed the two streams, one update
could be lost: the socket leaked or atom-GC of its blob found a stream
flag without a stream and aborted (assertion in nbio_closesocket()).
Both could also close the socket, and the socket was used after
closeSocket() may have freed it.
- FIXED: tcp_connect/2,3 could connect a socket to itself If a client
connects to a local port nobody listens on and the system picks that
port as the client's own port, TCP connects the socket to itself.
This happens when
localhost resolves to ::1 and 127.0.0.1, the
server listens on 127.0.0.1 only, and the client first tries ::1.
The client then reads back what it wrote while the server never
sees the connection. Such a connection now fails with ECONNREFUSED,
so tcp_connect/3 tries the next address.
[Nov 11 2026]
[Nov 9 2026]
- ENHANCED: process_create/3: use
posix_spawn() again where possible
The HAVE_POSIX_SPAWN configuration was lost when moving to CMake.
posix_spawn() is used unless the child needs code that only runs
after fork(): a working directory, priority, adopting the terminal
or, on Linux, the parent death signal. The spawn path now creates a
new session for detached processes, passes redirected user streams,
closes stream(S) descriptors and reports the spawn error.
- FIXED: socket close on EINTR, openlog/3 leak and stream allocation
checks Closing a socket retried
close() after EINTR, which may close
a descriptor that was reused by another thread. openlog/3 leaked
the identifier on each call and tcp_open_socket/3 did not check the
stream allocation.
- FIXED: fork_exec/1: halt the child if exec/1 fails Previously the
child continued running the Prolog program of the parent.
- FIXED: '$malloc_info'/1 leaked its buffer Co-Authored-By: Claude Opus
5.5 <noreply@anthropic.com>
- FIXED: library(uid): supplementary groups and user/group lookup errors
set_user_and_group/1,2 passed a numeric user id to
initgroups(), which
expects a user name, and set_user_and_group/2 initialised the group
list from the user's primary group rather than the requested group,
as documented. If initgroups() is not available, the supplementary
groups are reset using setgroups() rather than kept.
- MODIFIED: copy_file/2 preserves permissions; copy_directory/2 copies
symbolic links copy_file/2 creates a new destination file with the
permissions of the source rather than the default permissions and
raises a permission error when copying a file onto itself, which
truncated the file. copy_directory/2 copies symbolic links as links
rather than following them, which could recurse forever or copy data
from outside the directory.
- FIXED: library(unix): wait/2 after a signal, environ/1 and detach_IO
wait/2 for a specific process waited for any child after being
interrupted by a signal. environ/1 read beyond an environment entry
without
=. detach_IO/1 redirects the closed terminal descriptors
to /dev/null such that they are not reused by files opened later and
correctly clears the tty flag.
- TEST: use process_which/2 to check for executables Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com>
- FIXED: process_create/3: file descriptor handling and process
bookkeeping Using
stream(S) for stdin, stdout or stderr permanently
set the close-on-exec flag on the descriptor of S, so later child
processes lost, e.g., their stderr. Both ends of pipes are now created
with close-on-exec, such that they do not leak into processes created
concurrently by other threads. pipe2() is used if available.
- FIXED: install_alarm/2 on an installed alarm corrupted the alarm list
install_alarm/2 changed the time of an alarm before verifying that it
is not already scheduled, after which it could be linked twice. It now
raises a permission error without modifying the alarm. Alarm times
are clipped to the representable range and NaN raises a domain error.
- FIXED: uuid/2: Prolog fallback created corrupt integer UUIDs Without
the OSSP UUID library,
uuid(U, [format(integer)]) shifted the third
field to the wrong position, losing the version. Random fields now
cover their full range. Documented that UUIDs should not be used
as secrets.
- FIXED: uri library: memory leaks, normalization of reserved characters
and paths uri_normalized/2 and friends no longer decode %-encoded
reserved characters such as `%2F`, `%40
and %3A` and a `%25`,
which changed the meaning of the URI. A normalized or resolved path
without authority that starts with // is prefixed with /. such
that it is not parsed as an authority. Fixed several memory leaks
in uri_resolve/3 and uri_normalized/3.
- FIXED: sha_new_ctx/2 and sha_hash_ctx/4: validate the context
sha_new_ctx/2 included uninitialised memory in the context string
and sha_hash_ctx/4 trusted the algorithm and digest size stored in
the context. An inconsistent context now raises a domain error.
- FIXED: stream_hash/2 and Prolog streams: lost digest and truncated
input stream_hash/2 could succeed without binding the digest if the
parent stream has no control function (e.g., a null stream) and it
destroyed the hash state, so the digest could only be retrieved once.
A Prolog input stream (open_prolog_stream/4) lost data if the read
callback returned exactly the size of the buffer.
- FIXED: memory files: substrings after the gap, line positions, seek
from eof memory_file_substring/5 and memory_file_to_atom/2 and friends
returned data from the wrong location when the requested range is
after the insertion gap. memory_file_line_position/4 was off by one
for octet, ISO Latin 1 and wide memory files and seek/4 relative to
eof used the wrong sign.
- FIXED: cgi_get_form/1: decoding of invalid escapes, multipart data
and short POST bodies An invalid %-escape in a form value raises a
syntax error instead of returning garbage, empty multipart values
are handled correctly and a POST body shorter than its Content-Length
raises an I/O error rather than looping.
- FIXED: crypt/2: thread-safety of MD5 verification, random salts
and hash formats Verifying a `$1$` (MD5) hash used static data
without locking, such that concurrent calls could compare against
the wrong result. Verification now passes the entire stored hash to
crypt(), so all formats supported by the system crypt() (e.g., `$5$`,
`$6$`) work. Random salt characters are taken from getentropy()
or /dev/urandom rather than an unseeded rand(). Documented the DES
and MD5 limitations.
- FIXED: read_line_to_codes/2,3: buffer overflow on long runs of \r A
sequence of carriage returns at the end of the internal buffer was
never flushed, writing beyond the buffer.
- MODIFIED: udp_broadcast: do not forward
udp(...) requests received from
the network Messages received through the UDP proxy whose content is
itself a udp/2, udp/3 or udp_subnet/1,2 term (or unbound) are ignored,
such that a node does not relay messages on behalf of other hosts.
- MODIFIED: prolog_server/2 binds to localhost unless
allow(IP)
is given Without an allow(IP) option, the server now only listens
on the loopback interface. The allow/1 check is performed before
creating a client thread or doing a reverse DNS lookup, and errors
while accepting a connection no longer terminate the server.
- FIXED: socket library: IPv6 peers, port ranges, error handling
and SOCKS5 tcp_accept/3 and the UDP receive predicates return IPv6
peer addresses instead of asserting, port numbers must be in the
range 0..65535 and unknown address families raise a domain error.
SOCKS5 negotiation handles IPv6 and malformed replies, rejects
authentication methods that were not offered, sends host names as
UTF-8 and validates the request.
Package cpp
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 11 2026]
- TEST: PL_new_functor(), PL_register_functor() and
PL_unregister_functor() Requires functor garbage collection
(swipl-devel branch functor-gc).
- ADDED: PlRepresentationError(resource, culprit) and PLX wrappers
PlRepresentationError(resource, culprit) creates the exception
representation_error(resource(culprit)). Also adds the PLX wrappers
for PL_representation_error_culprit() and PL_recorded_external_len().
- TEST: representation errors from C integer conversions include
the value Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y7pJ6ouLn1iv91aufPC5X7
[Nov 4 2026]
- TEST: signal raised while an exception is pending PL_get_nchars()
on a pending exception must not fail because a signal was raised
in the meantime. Uses a synthetic signal in the Prolog range
(PL_sigaction(0, ...)), so the test also runs on systems without
POSIX signals such as Windows and WASM.
[Nov 1 2026]
- TEST: #1560 retrying a query whose choicepoint is in the query frame
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Oct 30 2026]
- ADDED: sync with SWI-Prolog.h: PL_get_list_slice(), PL_get_arg_values()
Package graphviz
[Nov 15 2026]
- FIXED:
library(graphviz) failed to load after installation on Linux The
dot layout plugin was linked from graphviz's private plugin directory
(e.g. /usr/lib/x86_64-linux-gnu/graphviz). That directory is only
in the build RPATH, which is dropped on installation, so loading
graphviz4pl failed. The plugin is now only linked if it is next
to libgvc and otherwise opened at runtime, as the neato plugin is.
Runtime plugins are looked up by their soname (libX.so.N) rather than
the full version, so a compatible graphviz update does not break them.
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 6 2026]
- PORT:
library(graphviz) on Windows (MinGW) The dot layout plugin is
linked. The other plugins are opened on demand using LoadLibrary(),
as dlopen() is used elsewhere. The graphviz DLLs are installed with
the package.
- ENHANCED: replace graphviz_engines/1 and graphviz_has_engine/1 by
graphviz_engine/1 graphviz_engine(?Engine) tests an engine if Engine
is bound and enumerates the available engines otherwise.
- DOC: package documentation for
library(graphviz) Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com>
[Nov 5 2026]
- ENHANCED: register the EPL-1.0 license of Graphviz with license/0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FIXED: find the layout plugins after relocating the installation The
plugins opened at runtime were opened by the path found at build time,
which does not exist in a macOS bundle. They are now searched for
next to graphviz4pl, in graphviz/ next to libgvc and next to libgvc
before that path is used. macOS bundle and framework builds install
the plugins next to graphviz4pl, where the bundle fixup handles
their dependencies.
- ENHANCED: open the other layout plugins on demand The neato plugin,
which provides neato, fdp, sfdp, circo, twopi, osage and patchwork,
is opened when one of its engines is first used, so using dot does
not load GTS and GLib. The plugins are registered by the library:
graphviz' own plugin loading also loads its text layout plugin (pango,
cairo, ...). Added graphviz_has_engine/1.
- ADDED: graphviz_engines/1 to list the available layout engines
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ENHANCED: graphviz_layout_dot/4 also returns the clusters The layout
is now
layout(BB, Nodes, Edges, Clusters), where Clusters holds the
bounding box and label position of each cluster.
- ADDED:
library(graphviz): lay out graphs using the graphviz libraries
graphviz_layout_dot/4 lays out a graph in the DOT language and returns
the node positions and edge routes as a Prolog term. Only the layout
part of graphviz is used. If possible, the dot layout plugin is
linked and no plugins are loaded dynamically.
Package http
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- FIXED: WebSocket: a close frame with a 1-byte payload gave code -1
RFC 6455 requires a close payload to start with a 2-byte status code.
ws_receive/2,3 now raises
syntax_error(websocket(close_payload)) and
a server started by http_upgrade_to_websocket/3 closes the connection
with code 1002 (protocol error).
- FIXED: http_chunked_open/3: max_chunk_size buffer freed with the
wrong allocator The buffer was allocated with PL_malloc(), while
the stream frees it with
free(). These differ if Prolog uses a
garbage-collecting allocator. Let the stream allocate the buffer.
The test covers the option; the mismatch itself cannot be observed
with the default allocator.
- FIXED: cgi_property/2 content_length was 0 for chunked replies The
bytes written in chunked transfer encoding were never counted, so
content_length and the server's bytes-sent statistics missed all data
of chunked replies.
- FIXED: cgi_set/2 kept the stream locked on a non-atom transfer_encoding
The type error returned without releasing the CGI stream, so any
other thread using it blocked forever.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
- FIXED: multipart_open/3 leaked its stream if the output argument was
bound Close the new stream without closing the parent, which restores
the parent's encoding and releases it. Also release the parent if
allocating the context fails.
- FIXED: stream_range_open/3 leaked its stream if the output argument was
bound As cgi_open/4: close the new stream without calling the onclose
hook, which restores the parent stream, and raise an uninstantiation
error. Also erase the recorded onclose hook if the input is not
a stream.
- FIXED: cgi_open/4 leaked its stream if the output argument was bound
The new stream was neither closed nor freed, the parent stream stayed
held in octet encoding and the error was an instantiation error.
Close the new stream without output or hooks, which restores the
parent, and raise an uninstantiation error. Also erase the recorded
request on the early errors.
- SECURITY: WebSocket: reject text messages that are not valid UTF-8
RFC 6455 requires failing the connection on invalid UTF-8 in a text
message. ws_receive/2,3 now raises
syntax_error(encoding(Message))
instead of decoding invalid bytes to U+FFFD with a warning, and a
server started by http_upgrade_to_websocket/3 closes the connection
with code 1007 rather than 1011.
[Nov 11 2026]
- MODIFIED: close keep-alive connections with a large unread request body
If a handler does not read the request body, the server skipped the
remainder to keep the connection alive, regardless of its size. It now
only does so if at most the new setting http:max_keep_alive_drain
(64Kb) bytes are left and closes the connection otherwise.
[Nov 9 2026]
- DOC: pwp_handler/2: only serve trusted PWP files Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com>
- ENHANCED: WebSocket read timeout and hub read_timeout option A
timeout set on a WebSocket stream using set_stream/2 now applies to
reading from the underlying stream. hub_create/3 accepts the option
read_timeout(+Seconds) (default 60) that limits the time to wait for
the remainder of a message, such that a client sending an incomplete
message no longer blocks a hub reader thread forever.
- FIXED: multipart_open/3: invalid multipart/form-data error on small
buffers If a partial boundary match crossed a buffer boundary and
the output buffer was too small to hold the buffered data, the stream
raised an error.
- FIXED: cors_enable/0,2: send a single allowed origin
Access-Control-Allow-Origin only allows for a single origin or
*.
If the setting http:cors lists multiple origins, we now echo the Origin
header of the request if it is in the list and add Vary: Origin.
Also added the missing newline after Access-Control-Allow-Headers.
- MODIFIED: HTTP: deadline for receiving request headers and WebSocket
size limit - Added the setting http:header_timeout (default 30
seconds) that
limits the total time for receiving the request line and header.
Exceeding it results in `408 Request Timeout`. - ws_open/3 limits
the size of received messages to 16Mb by default.
The max_message_size option of ws_open/3, http_open_websocket/3 and
http_upgrade_to_websocket/3 can change this or set it to
infinite.
- MODIFIED: HTTP sessions: HttpOnly cookies and 128-bit session ids
The session cookie now has the HttpOnly attribute by default (use
http_set_session_options([http_only(false)]) to disable) and session
ids are 128 random bits, taken from library(crypto) or /dev/urandom.
OpenID login renews the session id, keeping the session data.
- FIXED: OpenID relying party: verify the provider and only use signed
AX data - After verifying the signature, run discovery on the asserted
identity
and require the signing provider to be its OpenID provider. Use the
provider from the session for looking up the association. - Only
use signed AX attributes. - Verify TLS certificates when talking to
OpenID providers.
- FIXED: setting http:client_backtrace had no effect Server
errors are now reported to the client without a backtrace
unless library(http/http_error) is loaded and the setting
http:client_backtrace is true.
- FIXED: library(http/http_cookie): domain, path, Secure and expiry
handling Cookies with a Domain attribute that does not match the host
or that has no dot are ignored. Domains and paths are matched on `.
and /` boundaries. Secure cookies are only sent over https and the
Max-Age and Expires attributes are honoured.
- FIXED: HTTP output: escaping in SSE, GraphQL, HTML, JavaScript and MIME
- sse_send/2: split data and comments on CR, LF and CRLF, including the
elements of a list, and raise a domain error if
event or id
contain a line terminator. - GraphQL documents: interpolated atoms
that are not valid names are
written as strings and invalid names raise a domain error. Control
characters in strings are escaped. - html_write: the check for
the end of script and style content
also detects `</script` followed by white space or /. Names of
search parameters in URLs are encoded. - js_write: escape `<!`
and U+2028/U+2029 in JavaScript strings and
validate the identifier of js_new//2. - Validate the Content-Type
of POST data. - mime_pack/3: quote name and filename, only send
the base name
of files and write nested multipart headers to the output stream.
- FIXED: HTTP digest authentication, session GC, pwp extensions and
log masking - Digest authentication: the
uri of the response must
match the
request URI. Server nonces are verified from their signature and
only stored on first successful use, so unauthenticated requests no
longer add facts. Fixed our_nonce/2 never succeeding. Unknown
fields in the Authorization header no longer create functors. -
http_gc_sessions/1 only considered one session if some session had
its own timeout. - pwp_handler/2: the pwp and
hide_extensions(List) extensions are
compared case insensitive. - http_log: mask passwords in the
request URI, Authorization and
Proxy-Authorization headers and cookie values. Also mask the
passwd and openid.password parameters.
- FIXED: HTTP server: request framing, header parsing and Range replies -
Requests with both Transfer-Encoding and Content-Length, with a
transfer encoding other than
chunked or with multiple different
Content-Length headers are rejected with 400 Bad Request.
Content-Length must consist of digits only. - Parsing header values
and cookie values took time quadratic in the
number of spaces. - Header values that contain CR, LF or NUL raise
a domain error rather
than being written to the reply header. - Range replies sent one
byte less than announced. Invalid or
unsatisfiable ranges are ignored and ranges are clipped to the file
size. - Domain errors while parsing the request header map to
400 Bad
Request rather than 500.
- FIXED: HTTP stream filters: strict chunked decoding and WebSocket
frame checks - Chunked encoding: chunk sizes must be 1*HEXDIG,
optionally followed by
extensions, and the line must end in CRLF. Too long chunk header
lines raise an error rather than being split. Limit the number of
trailer lines. Fixed http_chunked_add_trailer/3 dropping trailers
and a crash if the parent stream has no control function. -
stream_range_open/3: accept sizes of 2Gb and more and raise an
error if the parent stream ends before the range. - WebSocket:
reject reserved opcodes, fragmented or too long control
frames and 64-bit lengths with the high bit set. Raise an error on
a premature end of file. Skip the payload of a ping that arrives
between fragments. Added the option
max_message_size(+Bytes) to
ws_open/3. Fixed ws_start_message/3 not releasing the stream on
errors. - multipart_open/3: require a non-empty boundary option
rather than
crashing.
- FIXED: http_open/3: request line and header values, redirects and
keep-alive - Control characters and spaces in the request URI are
%-encoded and
header values that contain a CR or LF raise a domain error. -
When redirected to another scheme, host or port, the authorization
option and Authorization and Cookie request headers are removed.
- Keep-alive connections are only reused for the same scheme and
proxy, and are not reused if the server sent more data than
announced. - The proxy_authorization option is only sent to an
HTTP proxy. - http_set_authorization/2 URLs only match URLs with
the same scheme,
host and port and a path below the given path.
- MODIFIED: HTTP: limit the size of header lines and headers Added
http_read_line/3 to library(http/http_stream) to read a line with a
maximum length, and the settings http:max_header_line_length (64Kb)
and http:max_header_size (256Kb). These limits are used for reading
HTTP request and reply headers by the server, http_open/3 and multipart
part headers. The server replies `431 Request Header Fields Too Large`
if a limit is exceeded. Header lines that start with white space
(obsolete line folding) are rejected.
- MODIFIED: http_read_data/3: limit the size of request bodies Added
a setting http:max_request_size (default 10Mb, or
infinite) and an
option max_request_size(+Bytes) to http_read_data/3. Request bodies
that exceed the limit raise resource_error(max_request_size),
which the server maps to a new `413 Payload Too Large` reply.
This also limits form data, JSON and multipart file uploads read
through http_read_data/3.
Package inclpr
[Nov 13 2026]
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
Package jpl
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 11 2026]
- TEST: migrate the Java tests from JUnit 4 to JUnit Jupiter (JUnit 5/6)
JUnit 4 is no longer maintained and distributions start to replace
it, e.g., MacPorts junit is now JUnit 6, so the Java tests were
dropped and the build failed on the cached path of the removed jar.
The tests now use the Jupiter API, which is the same for JUnit 5 and 6.
[Nov 1 2026]
- ENHANCED: Releasing a Java object reference no longer scans all
references The release hook of a <jref> found its entry in the table
of object references by scanning the whole table. It now looks in
the slot of the
identityHashCode() of the object. With 50,000 live
references, releasing 65,536 others takes 0.28 s instead of 19 s.
- ENHANCED: Java object references and Strings are thread-local atoms
Object references (<jref> blobs) use PL_BLOB_LOCAL, and Strings
that Java returns to Prolog become atoms through PL_unify_wchars(),
as do org.jpl7.Atom terms that Java puts into Prolog. The thread
that creates them reclaims them in its own sweep, without global
atom garbage collection. A reference that reaches another thread is
promoted and remains the same atom.
Package json
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 9 2026]
- ADDED: JSON reply for the HTTP 408 request_timeout status
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ADDED: JSON reply for the HTTP 431 request_header_fields_too_large
status Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ADDED: JSON reply for the HTTP 413
payload_too_large(MaxSize) status
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- MODIFIED: JSON: raise an error on writing infinite or NaN floats JSON
has no representation for these values. json_write/3 and friends
used to emit e.g. 1.0Inf, which is not valid JSON. The new option
non_finite(How) selects between error (default), null and json5
(Infinity, -Infinity, NaN). With non_finite(json5), the reader
accepts these JSON5 tokens. Also, integer dict keys are written
as strings, <! and U+2028/U+2029 are escaped for embedding in HTML,
a lone \uDC00..\uDFFF escape is a syntax error and writing a cyclic
term raises a domain error rather than looping.
- FIXED: JSON: numbers over 255 characters, empty key as dict tag,
unbounded cache Reading a number of more than 255 characters parsed
uninitialised memory, json_read_dict/2 turned a "" key into the dict
tag and json_to_prolog/2 cached rules for each distinct sequence of
keys, so JSON data could make memory grow without bounds.
Package libedit
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
- CLEANUP: Windows: decode console input with PL_utf8_code_point()
Drop our copy of Prolog's UTF-8 decoder. The decoder also gets the
end of the bytes read. Requires PL_utf8_code_point().
- FIXED: Windows: console input accepted overlong and invalid
UTF-8 Decoding the bytes read from the console now follows
_PL__
utf8_code_point(): only the shortest encoding of a code point
up to U+10FFFF is valid, surrogates become U+FFFD and 5- and 6-byte
sequences are no longer recognised.
[Nov 12 2026]
- FIXED: loading library(editline) in a thread with captured output
raised an error The initialization goal el_wrap_if_ok/0 wrapped the
user streams if user_input is a terminal. A thread created while
output is captured, e.g., by with_output_to/3 or plunit, inherits
memory streams for user_output and user_error, for which el_wrap/5
raises a permission error. Loading Epilog from such a thread printed
this error. Only wrap if the output streams are OS files.
Package ltx2htm
[Nov 16 2026]
- FIXED: \term{F}{Args} failed in LaTeX if Args contains a nested
\term The emptiness test used \ifthenelse{\equal{}{#2}}, which
fully expands #2 and breaks on a nested \ifthenelse, e.g. for
\term{error}{\term{syntax_error}{\term{encoding}{Message}}, Context}.
Compare an unexpanded \def using \ifx instead.
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
Package mqi
[Nov 12 2026]
- FIXED: MQI: generated password was predictable; checks before
authentication The generated password was a version 1 UUID (time
and MAC address) or random/1. It now comes from 128 bits of
crypto_n_random_bytes/2 or /dev/urandom (fallback: a version 4 UUID).
[Nov 1 2026]
- ENHANCED: Create the Unix domain socket directory using tmp_directory/2
tmp_directory/2 creates the directory with mode 0700, so we no longer
need chmod/2, and it is safe if processes create temporary directories
concurrently.
Package nlp
[Nov 16 2026]
- BUILD: silence -Wmaybe-uninitialized false positive in
unify_stem()
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 10 2026]
- FIXED: double_metaphone/2 upper casing and snowball/3 error checks
double_metaphone/2 passed signed characters to
toupper(). snowball/3
checks for allocation failures and words that do not fit an int.
- FIXED: isub/4 could not be interrupted The isub algorithm takes time
cubic in the length of the input. It now handles signals, so it can
be aborted using e.g. call_with_time_limit/2.
- FIXED: porter_stem/2: words whose length changes by removing accents
porter_stem/2 stemmed only the first N characters of the unaccented
word, where N is the length of the input, e.g.
porter_stem('Æbles',
X) gave 'AEble'. Also downcase after removing accents.
[Nov 2 2026]
Package odbc
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 11 2026]
- FIXED: keep the functors of null(F(_)) and findall templates alive
Both kept a functor obtained from PL_get_functor(), which is only
valid as long as the term. Use PL_new_functor(), which keeps it
alive if functors are garbage collected.
[Nov 9 2026]
- FIXED: ODBC unicode encoding: UTF-16 surrogates and non-wide
text columns With
encoding(unicode), characters outside the Basic
Multilingual Plane were truncated to 16 bits where SQLWCHAR is smaller
than wchar_t. They are now exchanged as UTF-16 surrogate pairs in
the SQL text, parameters and results. CHAR, VARCHAR and LONGVARCHAR
columns and parameters are now also exchanged as wide characters, while
they were exchanged as bytes that were interpreted as ISO Latin 1.
- FIXED: ODBC: reading column data longer than the declared column size
If a driver returns more data for a column than its declared size,
as the SQLite driver does for BLOB and VARCHAR columns, the value was
read beyond the column buffer, returning garbage. The value is now
re-fetched using SQLGetData() or an error is raised if the driver does
not support this. Reading long values in chunks using SQLGetData()
no longer trusts the reported length as the number of bytes written.
Package pcre
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 9 2026]
- ENHANCED: pcre: flush the pattern caches automatically The caches
for compiled patterns and replacement specifications are flushed
after 10,000 entries have been added, avoiding unbounded growth when
patterns or options are computed.
- FIXED: pcre: crashes on match errors, unset groups and empty matches
Match results other than success or no match (e.g., a partial
match or exceeding the heap, depth or JIT stack limit) triggered an
assertion that terminated the process. These now raise a resource
or representation error, while a partial match fails. Capture groups
that did not participate in the match are returned as an empty capture
at the start of the match; for
capture_type(range) these were computed
from an invalid offset.
Package pengines
[Nov 12 2026]
- FIXED: pengine clients printed remote format/2 errors as messages
An error received from a pengine is data. A bare
format(Fmt, Args)
error was thrown as is and formatted when printed, which calls goals
if Fmt contains ~@. The client now passes it on as error(format(Fmt,
Args), _), which is printed without calling goals (requires the core
change for format/2 in exceptions).
[Nov 10 2026]
- MODIFIED: sandboxed pengines need allow_remote to access remote
pengines Add an application setting
allow_remote (default false).
Sandboxed pengines may only create remote pengines or load source using
src_url if this setting is true. The new hook allow_remote_server/2
may be used to restrict the servers that may be accessed.
- MODIFIED: sandboxed pengines may only address themselves and their
children pengine_send/3 (and thus pengine_ask/3), pengine_destroy/2
and pengine_pull_response/2 raise a permission error if a sandboxed
pengine addresses a pengine that is not itself or one of the pengines
it created.
- FIXED: pengine_listing/1 and src_predicates could list other modules
pengine_listing/1 and the src_predicates option of pengine_create/1
and pengine_rpc/3 accepted module-qualified predicate specifications,
which made them list predicates outside the pengine's module from
sandboxed code. pengine_listing/1 now raises a permission error for
qualified specifications. The sandbox declarations of pengine_create/1
and pengine_rpc/3 require src_predicates to be ground and unqualified.
- FIXED: sandbox declarations of write_term/2 and pengine_write_term/2
These are now declared using safe_meta/2, checking the portray_goal
option. Requires the matching library(sandbox).
Package pldoc
[Nov 12 2026]
- FIXED: PlDoc edit handler accepted forwarded and cross-site requests
The edit handler, which starts an editor on the server, is only
for the user on localhost. The X-Forwarded-For header was trusted
from any client, so a remote client could claim to be localhost;
it is now only used if the request comes from this host (a local
proxy). Requests that the browser marks as coming from another site
(Sec-Fetch-Site, Origin, Referer) are refused, so a web page in the
user's browser can no longer start the editor.
Package plunit
[Nov 12 2026]
- FIXED: --on-warning=status counted warnings intercepted by
message_hook/3 A test that traps the warnings it expects using
message_hook/3 failed with "Generated unexpected warning or error",
as the check used thread_message_hook/3, which sees a message before
message_hook/3. The check now compares the number of errors and
warnings this thread printed before and after the test, which excludes
messages a hook intercepted.
Package protobufs
[Nov 15 2026]
- TEST: uint32_codes_e3 and uint32_int32_e3 expectations
uint32_codes/2 raises
type_error(list, Codes) for a list that does
not have 4 elements; no code raises type_error('list[4]', Codes).
uint32_int32_e3 tested max_signed32_plus1 again (as e2) rather than
min_signed32_minus1.
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 11 2026]
- MODIFIED: include the value in
representation_error(uint64_t(Value))
Also update the tests for the representation and domain errors raised
by the C integer conversions.
[Nov 10 2026]
- MODIFIED: protobufs: reject invalid UTF-8 in string fields Decoding
strings now requires valid UTF-8, rejecting overlong forms,
surrogates, code points above 0x10FFFF and truncated sequences.
protobuf_parse_from_codes/3 raises
syntax_error(illegal_utf8_sequence)
for a string field that is not valid UTF-8, where it used to raise
a determinism error for some invalid input and silently accept other.
- FIXED: protobufs: serializing negative or too large varint values
Negative values for unsigned fields produced negative "bytes" and
values of 2^64 or larger produced varints of more than 10 bytes.
These now raise a type or representation error.
- MODIFIED: protobuf_parse_from_codes/3: limit nesting depth and fix
slow parsing Messages may be nested at most
protobuf_max_depth
levels (default 100, as the C++ implementation). Deeper nesting
raises a resource error.
[Nov 13 2026]
- TEST: document representation_error/domain_error + minor refactoring
[Nov 8 2026]
- TEST: document representation_error/domain_error + minor refactoring
Package redis
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 10 2026]
- MODIFIED: redis_connect/3: raise an error if
tls(true) cannot be used
If library(ssl) is not available or the address is not Host:Port,
the tls(true) option was silently ignored, using a plain connection.
- FIXED: redis: robustness of reading replies Malformed replies could
crash the client or abort the process. The nesting depth of aggregates
is now limited to 256 and invalid replies raise a syntax error.
Package semweb
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: resync murmur.c with src/pl-hash.c The algorithm was already
the same; this takes over the cleanup of the core version. Verified to
produce the same hashes as before.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 10 2026]
- FIXED: library(semweb/rdf_sandbox): restrict the options of
sparql_query/3 sparql_query/3 was declared safe with any options.
Options that access local files (certificate_file, key_file,
cacert_file, crl, post) are now refused and the SSL hooks
cert_verify_hook and pem_password_hook are verified as meta-calls.
- FIXED: Turtle parser: invalid code points in IRIs crashed the process
An IRI holding a code point that cannot be represented, either
from an escape or from the input, created an invalid atom handle,
which aborts the process. This now raises a representation error.
\U escapes for values above 0x10FFFF are syntax errors in the Turtle
and N-Triples parsers.
- FIXED: rdf_load_db/1: crash on corrupted files Loading a corrupted
or truncated file created by rdf_save_db/1 could crash or abort
the process. Such files now raise an I/O error.
[Nov 3 2026]
- BUILD: Avoid -Wfree-nonheap-object warning for stack triples Use
free_unallocated_triple() rather than free_triple() for triples on
the C stack, as already done elsewhere.
[Nov 2 2026]
- ENHANCED: Use PL_atom_index() rather than the atom bit layout Atom ids
and datums are derived from the atom index instead of shifting the atom
handle, so rdf_db no longer depends on how SWI-Prolog encodes atom_t.
Package sgml
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
- CLEANUP: decode UTF-8 with PL_utf8_code_point() Our own decoder
accepted overlong sequences and surrogates and could return a
negative code. Requires PL_utf8_code_point().
- SECURITY: XML/SGML parser accepted overlong UTF-8 sequences Decoding
UTF-8 input, e.g., C0 AF was read as "/". Only the shortest encoding
is valid; other sequences are now reported and replaced by U+FFFD, as
the parser already did for surrogates and code points above U+10FFFF.
[Nov 9 2026]
- FIXED: xmlns dialect: parsing deeply nested elements was quadratic
Namespace lookup walked all open elements. Each element now points
at the nearest ancestor that declares namespaces.
- DOC: library(pwp): PWP templates execute Prolog and must be trusted
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FIXED: xml_write_canonical/3: namespace handling for inclusive C14N
Inclusive canonicalization now keeps namespace declarations where they
are in scope, only omitting declarations that are already made by an
ancestor, and orders attributes by namespace URI rather than prefix.
The output now matches xmllint --c14n for documents with unused or
duplicate namespace declarations, multiple prefixes for the same URI
and redeclared prefixes. Exclusive canonicalization renders exactly
the visibly utilized namespaces.
- FIXED: XSD numbers and times: overflows, rounding and lexical checks -
xsd_time_string/3: years with more than 9 digits raise a syntax
error rather than overflowing and fractions of seconds with many
digits are handled correctly. Seconds are written with up to 9
decimals, never as -0.0 or as 60. - xsd_number_string/2 returns
an integer for "+5". - xsdp_convert/3 uses the XSD lexical rules
rather than Prolog number
syntax and enforces the ranges of int, long, unsignedInt and
unsignedLong.
- FIXED: SGML parser: invalid character references and UTF-8 aborted
parsing Character references outside the Unicode range or for
surrogates are reported as an error and ignored rather than raising
an exception that aborts the entire parse. Invalid UTF-8 sequences
no longer consume the following markup and sequences beyond U+10FFFF
are mapped to U+FFFD. Also fixed decoding 6-byte UTF-8 sequences.
- MODIFIED: SGML parser: restrict access to external entities and DTDs
With
system_entities(false) (default), parameter entities, entities
in attribute values and the external DTD subset are only loaded if
they are found through the catalog, are declared in a DTD file or
the document is read from a file. Notably, documents parsed from a
string or stream can no longer access local files.
- FIXED: SGML/XML parser: memory errors on malformed input; limit
entity expansion - Fixed buffer overflows for long name tokens (e.g.,
in <?xml ...?>),
long numbers, name groups with more than 256 names, long or empty
SHORTREF map strings and more than 32 omitted start tags. -
Fixed a buffer underflow for CDATA marked sections inside IGNORE.
- Fixed use of a freed attribute after ATTLIST declarations for a name
group that redefine an attribute. - Fixed reading uninitialised
or unterminated data for undefined
parameter entities in entity values, unquoted attribute list
defaults,
unterminated comments in declarations and when hitting max_memory.
- Recursive entities raise an error rather than crashing and entity
nesting is limited to 64 levels. - Characters produced by entities
referenced from entity values are
limited by the new parser option
max_entity_expansion(+Max), default
10,000,000.
- FIXED: sgml: crashes and memory errors in the Prolog interface and
catalogs - Resolving a long SYSTEM id relative to the document and
long tokens
in catalog files overflowed fixed size buffers. -
get_sgml_parser(P,
allowed(L)) overflowed if more than 256 elements
are allowed. - dtd_property/2 for entity and notation details read
wide strings as
narrow ones and crashed on incomplete entity declarations. -
Parsers created by new_sgml_parser/2 are registered, such that using
a freed parser raises an existence error. free_sgml_parser/1 raises
a permission error while the parser is in use. - sgml_parse/2 may
only be called recursively from the begin callback
and always restores the parser state, also on errors in the options.
- The namespace URL cache is now per parse rather than global, which
is not thread-safe. - Fixed invalid error calls for
cdata(Rep)
and attribute_value(Rep)
options and on allocation failures in xml_quote_*. - The entity
callback called the end callback.
- FIXED: xpath/3: text extraction raised an error on processing
instructions Text extraction (
text, normalize_space, etc.) now
skips pi(_), sdata(_) and ndata(_) content.
- FIXED: load_structure/3
entity(Name, Value) option: validate Name,
escape `%` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- MODIFIED: xml_write/3 and friends validate names and content Element
and attribute names must be valid XML names, processing instructions
may not contain the closing
?> (XML) or > (SGML), public and system
identifiers may not contain `"` and the content of HTML script and
style elements may not contain the closing tag. When writing XML,
characters that are not allowed in XML raise a representation error.
All these used to produce output with a different structure or that
is not well formed.
- FIXED: sandbox declarations for load_structure/3 and friends
load_structure/3, load_html/3, load_xml/3 and load_sgml/3 are only
considered safe if the input is a string, code list or stream and
the closures of
call(Event, Closure) options are safe.
[Nov 8 2026]
- FIXED: #100 crash after load_structure/3 raises with
max_errors(0)
The error handler raised the syntax error inside a foreign frame that
it never closed. If the error was raised while closing elements at
the end of the input, the remaining end-of-element callbacks reset
the term references below this frame, corrupting the local stack.
Package ssl
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
- FIXED: crypto_open_hash_stream/3 leaked its stream if the output
argument was bound The new stream was never closed and the parent
was left in octet encoding. Close it without closing the parent and
raise an uninstantiation error.
[Nov 11 2026]
- MODIFIED: a client context without
host(Host) fails certificate
verification Without host(Host), OpenSSL did not check whether the
certificate was issued for the server we connect to. Such a client
now fails as for a host name mismatch: the connection is rejected
unless the cert_verify_hook accepts the error hostname_mismatch.
peer_cert(false) still disables verification.
[Nov 9 2026]
- MODIFIED: SAML, XML signature and XML encryption validation
library(saml): - The RelayState is an opaque, single-use token that
refers to the
request state kept by the server. - Responses must be signed by
the IdP, either the response or each
assertion, and the signature must refer to the element that is used.
- The response must refer to our request (InResponseTo), Destination
must be our ACS URL, the issuer must be the IdP and bearer subject
confirmations must name our ACS URL as recipient and have a validity
period. Validity periods are compared as time stamps with a clock
skew and assertions are accepted only once. - Any failing check
raises an exception. - Fixed decrypting EncryptedAssertion and
verifying its signature. - AuthnRequests are signed using RSA-SHA256.
- FIXED: crypto: key and IV lengths, AEAD tags, crashes, leaks and limits
- crypto_data_encrypt/6 and crypto_data_decrypt/6 require the key and
IV to have the length of the cipher (or set the IV length for AEAD
ciphers) rather than silently truncating or reading beyond them.
Decrypting with an AEAD cipher (e.g., chacha20-poly1305) requires a
tag and encrypting requires the
tag(-Tag) option. All failures to
finish decryption raise the same error. Fixed memory leaks on
failures. - rsa_private_encrypt/4 and rsa_public_encrypt/4 freed
an invalid
pointer on errors. Fixed leaks when creating RSA keys. -
crypto_stream_hash/2 raises a type error on streams that are not hash
streams and closing a hash stream no longer frees the hash context
that may be in use. Writing to a hash stream whose parent raises an
error no longer loops. - crypto_password_hash/2,3: limit PBKDF2
iterations to 2^24 and bcrypt
cost to 18, reject 0 iterations and passwords with a NUL character
for bcrypt. - crypto_generate_prime/3 and crypto_is_prime/2 can be
interrupted. - crypto_n_random_bytes/2 checks the length and result.
- FIXED: TLS: peer certificate per connection, SNI verification and
crashes - ssl_peer_certificate/2 returned the certificate of an earlier
connection that used the same context. - If sni_hook or
alpn_protocol_hook select another context, also use its
verification settings and cert_verify_hook. Exceptions in these
hooks
are printed and abort the handshake. - Copying a context freed its
CRLs twice and corrupted its ALPN list. - Parse certificate and CRL
times using OpenSSL, fixing an out of bounds
read on malformed times and wrong dates from 2050. CRLs without a
next update and certificates with an unsupported key algorithm no
longer crash. - ssl_negotiate/5 now properly fails and cleans up
if the output
arguments cannot be unified. - Names, subject alternative names
and CRL distribution points are no
longer truncated at a NUL character. - If
host(Host) is an IP
address, verify it against the IP addresses
of the certificate and do not send it as SNI. - verify_certificate/3
no longer prints debug messages and handles
internal errors as failure. - Removed the fallback hostname
verification for OpenSSL versions
without X509_check_host(). - The demo client certificate hook in
https.pl only accepts verified
certificates.
Package stomp
[Nov 12 2026]
- FIXED: STOMP: stomp_connect/1 could miss the CONNECTED reply
connect_handshake/1 sent CONNECT before registering the thread waiting
for the reply. If the receiver thread processed CONNECTED first,
the reply was dropped, the handshake timed out after 10 seconds
and the connection was retried, possibly against a server that had
already finished. This made the broker tests hang under load on macOS.
The heart-beat property had the same problem.
[Nov 9 2026]
- MODIFIED: STOMP: limit the size of received frame headers and
bodies Added options
max_header_size(Size) (default 1Mb) and
max_body_size(Size) (default 100Mb) to stomp_connection/6. A frame
whose header exceeds the limit closes the connection. A body that
exceeds the limit is skipped with a warning if its size is given
by the content-length header and closes the connection otherwise.
Both options accept infinite.
- FIXED: STOMP: invalid JSON messages and frames without content-length
closed the connection A message with content type application/json
whose body is not valid JSON raised an exception in the receiver
thread, closing the connection. Such bodies are now passed as a
string after printing a warning. Frames without a content-length
header (e.g., ERROR frames) are read up to the terminating NUL byte
rather than closing the connection.
Package sweep
[Nov 13 2026]
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
Package swipy
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 12 2026]
- FIXED: Janus: crash when the Prolog stack overflows converting a term
Converting deeply nested or cyclic Prolog data to Python could exhaust
the Prolog local stack before Python's recursion check fired, which is
the case under `ulimit -s unlimited` with Python 3.14, which derives
its limit from the C stack. The unchecked PL_new_term_ref() result
then aborted the process with "invalid term_t 0". The conversion
now raises a resource error.
[Nov 9 2026]
- FIXED: Janus: crash on cyclic or deeply nested data Converting cyclic
or deeply nested data between Python and Prolog, in either direction,
exhausted the C stack. Conversion now respects the Python recursion
limit and raises a Python RecursionError.
[Nov 3 2026]
- TEST: Skip thread-based local sweep tests in single-threaded builds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Oct 31 2026]
- ENHANCED: Python object references are thread-local blobs Python
object references (<py> blobs) use PL_BLOB_LOCAL: the Prolog thread
that creates them reclaims them in its own sweep as soon as they
are no longer reachable, rather than at the next global atom garbage
collection, so the Python objects are released sooner. They become
ordinary atoms when they may be reachable from another thread.
Package table
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 11 2026]
- FIXED: keep the functor of the
functor(F) option alive The table kept
a functor obtained from PL_get_functor(), which is only valid as long
as the term. Use PL_new_functor(), which keeps it alive if functors
are garbage collected.
Package tipc
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
Package utf8proc
[Nov 13 2026]
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 10 2026]
- MODIFIED: adapt NFC atom normalisation hook to the new kernel
interface The hook writes to a caller-provided buffer and reports
the required size if this is too small. Atoms that grow under NFC
are now normalised correctly. Requires the matching kernel.
- FIXED: utf8proc: buffer over-read in unicode_property/2 and assertion
in unicode_map/3 - unicode_property/2 searched beyond the end of the
property tables
for values that are not in the table, returning random atoms. This
happened for the bidi isolate classes, which are now added. -
unicode_map/3 triggered an assertion if the result was empty, e.g.,
for
unicode_map('', X, [ignore]). - unicode_name/2 ignored text
after an embedded 0 character.
- FIXED: NFC atom normalisation hook aborted on text that grows under
NFC NFC may produce longer UTF-8 than its input, e.g., for composition
exclusions such as U+0958 that decompose under NFC. The in-place
hook asserted the result to be no longer than the input, aborting
reading such atoms with
unicode_atoms(nfc) or unicode_atoms(error).
Without assertions it would write beyond the buffer. The hook now
reports an error, leaving such atoms unnormalised.
Package windows
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
Package xpce
[Nov 15 2026]
- TEST: Epilog tab tests: run the POSIX shell rather than the
user's shell The terminals ran $SHELL, which may read files
that change what the tests check. The default ~/.bashrc of
Debian and Ubuntu sets the window title in its prompt, which
made a_title_the_shell_asks_for_is_not_shown fail always and
a_program_labels_its_tab_while_it_runs fail under load.
- FIXED: crash on halt after using an animated cursor with the SDL dummy
driver If the video driver cannot animate cursors (dummy, offscreen,
kmsdrm, ...), SDL 3.4 animates an animated cursor itself using a cursor
per frame. SDL_Quit() destroys the animated cursor together with these
frame cursors while walking its list of cursors, and then reads the
freed frames. This crashed about one in four runs of the animation
test on Ubuntu 26.04 (SDL 3.4.2). SDL main still has this bug.
We now destroy our animated cursors before calling SDL_Quit().
[Nov 13 2026]
- TEST: process_exit output test waits as long as output arrives On a
slow or loaded machine (s390x under QEMU) 50000 lines took more than
the fixed 3 seconds. Give up only after 3 seconds without progress.
- TEST: font member test must not assume the sans font lacks emoji
DejaVu Sans, the only sans font in minimal Debian images, has U+1F600.
Test with a private use character instead.
- TEST: whole wheel notches need SDL 3.2.12 (integer_y) Co-Authored-By:
Claude Opus 5.5 <noreply@anthropic.com> Claude-Session:
https://claude.ai/code/session_01Y7pJ6r44CrdPMcpJvHR8Eb
- FIXED: xpce sockets did not work on Windows Since the SDL port, an
xpce socket on Windows had no waitable handle, so the fd watcher thread
spun on a failing WaitForMultipleObjects() and no input or connection
was ever handled. The socket now signals a WSAEventSelect() event,
is kept in rdfd/wrfd as on Unix (ws_ref was shared with the watch),
and uses
recv()/send()/closesocket().
- FIXED: stale fd watch event could take over a reused watch slot An
event for a watch that was removed and whose slot was reused while
the event was queued took over the new watch's pending state, so the
new watch's own event was ignored. It also tested flags of its old,
possibly freed, object. Ignore events whose object is not the slot's
current one.
- FIXED: fd watcher could stop polling a newly added watch When releasing
watches, the watcher thread lowered watch_max to the highest slot
in use. If another thread claimed a higher slot in the meantime,
that slot was never polled. There are only 64 slots, so watch_max
is no longer lowered, and raising it is now atomic.
- FIXED: terminal output could be lost when another terminal was closed
Closing a terminal removed its watch and closed the pty right away,
while the watcher thread could still be polling the old fd. If a new
terminal got the same fd number, the watcher read its output into the
removed watch, which then dropped it. The watcher now skips watches
that are no longer active, and closes the terminal's fd itself when
it releases the watch, so the number cannot be reused before.
- MODIFIED: xpce: status is now a bool status was an int that only held
FAIL and SUCCEED. Functions that returned another value as a status
were fixed before. Declarations now agree with their definitions:
in interface.h,
pceSend(), pceInstanceOf(), pceExecuteGoal(),
pceResolveImplementation() and pceInitialise() return bool;
forward declarations that disagreed with their definition follow
the definition.
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: xpce: remove the O_RUNTIME conditionals Nothing defines
O_RUNTIME, and an O_RUNTIME build could not link:
rtSourceClass()
was registered but never defined. Removed with unifdef -UO_RUNTIME.
- CLEANUP: xpce: remove src/fmt/paragraph.c The file was not built and
class paragraph was never registered.
- CLEANUP: xpce: do not use status for non-boolean results
getConnectionPointsConnection() returned one of three values
as a status; it now returns an enum. requestGeometryParBox(),
scrollGesture() and userResizeSliceTable() are send methods declared
as returning int; they now return status like all other send methods.
This prepares for making status a bool.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
- CLEANUP: xpce: rename V_ERROR, V_INTEGER and V_DOUBLE to NV_* V_ERROR
clashes with a macro of <windows.h>, which we had to #undef after
including SWI-Stream.h.
- CLEANUP: xpce: use SWI-Stream.h instead of a copy of it src/h/stream.h
was an outdated copy of SWI-Prolog's stream header. It lacked
fields added since (esc_state, encoding_errors, unicode_atoms)
and would silently break if the layout of IOSTREAM changed.
SWIPL_WINDOWS_NATIVE_ACCESS keeps including <windows.h> on Windows,
as the copy did.
- CLEANUP: xpce: decode UTF-8 with PL_utf8_code_point() Drop our copy
of Prolog's decoder. Requires PL_utf8_code_point().
- SECURITY: xpce: reject overlong, surrogate and out-of-range UTF-8
As SWI-Prolog's decoder, only accept the shortest encoding of a code
point up to U+10FFFF. An invalid sequence decodes as its first byte;
a surrogate as U+FFFD. Before, e.g., C0 AF printed by a program
on an Epilog terminal showed as "/", and surrogates or codes above
U+10FFFF were stored as characters that cannot be read back.
- CLEANUP: xpce: make functions only used in their own file static
126 functions were declared in a header but used only in the file
that defines them. 85 of them are now static; where a use precedes
the definition a static forward declaration was added. Uses were
checked against the object files and lexically against all sources,
so code for other platforms is covered.
- CLEANUP: xpce: replace the per-directory proto.h files by a header
per C file Each C file that defines functions used elsewhere now has a
header <dir>/<file>.h with its prototypes, which it includes itself,
so the compiler checks declarations against definitions. h/kernel.h
includes the headers of ker, adt and msg; all other files include
the headers they use. The headers are self-contained after h/kernel.h.
- FIXED: popup->open leaked a point (and size) each time it opened
openPopup() passed tempObject()s to ->border and ->display without
releasing their code reference, so they were never freed.
- FIXED: terminal_image<-cells_size leaked its size The size was created
with
newObject(), which does not put it on the answer stack. A caller
that only reads it, such as Prolog unifying it with size(W,H), left
it behind. Epilog leaked one per terminal.
- FIXED: key_binding(@nil) was registered in @key_bindings and
protected An anonymous key binding was stored under @nil and could
never be freed. terminal_image creates one per terminal, so each
Epilog terminal leaked a key_binding, its sheet and two chains.
- FIXED: assigning a bound var leaked a code reference to its old value
valueVarBinding() referenced the new value of a binding but did not
release the old one. Besides leaking the old value of a var that is
assigned twice in one environment, an outer assignment that creates
the binding referenced its value twice.
- FIXED: SDL: events handled without reaching Prolog were never freed A
window keeps the event it handles in <-current_event. Assigning the
event to that slot takes it off the answer stack, so the rewind after
dispatching no longer frees it, and when the window lets go of it our
code reference was the last one, which frees nothing. Events that
reach Prolog were freed later, when the atom garbage collector
reclaimed their blob. The others, notably loc_move, area_enter and
area_exit on the menu bar and the tab window of Epilog, leaked.
- MODIFIED: Epilog: tty_link_hook/2 is replaced by tty_link_hook/5
The hook now says what a click on a link does without doing it:
tty_link_hook(+Terminal, +Link, -Label, -Goal, +Options) gives the
text for the report bar and the goal a click runs. Options is for
future extensions, e.g., icon(-Icon), and currently []. As the
hook is called while the pointer moves over links, it must not have
side effects.
- ENHANCED: Epilog: the link hover says what a click does The report
bar now starts with the action: "Edit file:line", "Open URL" or
"Not opened: link". A link to a file without a line that a click
hands to the application the desktop associates with it gets an
alert icon if that application may run code from the file, such
as a Java archive, a Word document or a macOS application bundle.
New open_document_method/2 tells how open_document/1 opens a file.
- ENHANCED: terminal_image: ->hover_message tells when the hovered link
changes The message gets the target of the link under the pointer,
or @nil, and the y of the pointer. It is also sent when output
replaces or scrolls away the text under a pointer that does not move.
Epilog uses it for showing where a link leads on its report bar, which
therefore no longer shows a link that is no longer under the pointer.
- ENHANCED: Epilog: show where the hyperlink under the pointer leads
While the pointer is on a hyperlink, the report bar over the terminal
shows the URL, as the status bar of a web browser does; for a link
to a file it shows the file and line. A link that a click does not
open says "(not opened)". The bar moves to the other edge rather
than cover the line with the pointer. Set
epilog_report.show_links
to @off to disable.
[Nov 12 2026]
- SECURITY: terminal: CSI n B with a huge n hung the terminal Cursor Down
adds a line for each row it moves below the last, so "\e[2147483647B"
added two billion lines. The count is now clipped to the window
height.
- SECURITY: terminal: CSI n @ with a huge n hung the terminal Insert
Character inserted n spaces one at a time, so a program writing
"\e[2147483647@", e.g.,
cat of a file, made the terminal hang.
The count is now clipped to the line width. Numeric arguments of
escape sequences now saturate rather than overflow.
- SECURITY: Epilog: only open
http(s) and mailto hyperlinks in the
browser The URL of a terminal hyperlink (OSC 8) is decided by the
program that writes it, e.g., a file being listed. Clicking any
non-file link asked the desktop to open it, and some desktops have
scheme handlers that run code, e.g., ms-msdt: on Windows.
- SECURITY: Edit with Emacs server: refuse requests from web pages
The server for the Edit with Emacs browser extension listens
on localhost:9292. Any web page the user visited could post to
it, opening an editor with text of its choice for every request.
Requests whose Origin is not a browser extension are now refused.
- MODIFIED:
pce_server(Port) only accepts connections from this machine
pce_server/1 runs any goal it receives without authentication, but
an integer address listened on all interfaces. It now binds to the
loopback interface. Use pce_server(Host:Port), e.g. '0.0.0.0':Port,
to bind to another interface.
- SECURITY: Unix domain server sockets are only accessible by the owner
The mode of the socket file depended on the umask and the directory it
is in. The PceEmacs server listens on such a socket and acts on what
it is sent, which allows running goals. The socket is now mode 0600.
- SECURITY: terminal: pasted text could end a bracketed paste Pasting
text that holds "\e[201~" ended the bracketed paste, after which the
client took the rest as typed keys, so a newline in it ran a command
the user never saw. As xterm, a paste now drops the control characters
other than TAB and the line breaks.
- FIXED: the text report of profile/2 loaded xpce
profile_node_label/2 called object/1 on every node of the call
tree, which autoloads xpce. If xpce is not loaded no node is a method,
so the hook now fails without loading it.
- FIXED: crash on halt while a thread waits to write to an audio_stream
SDL_Quit() destroys the device streams while a producer thread may be
waiting for room in
wait_for_room() without the xpce lock. The halt
hook now stops all audio streams and closes their devices first,
so the writer leaves and fails.
- TEST: stop_ends_producer: do not require the producer to get ahead
Under asan on a loaded machine the producer is slower than playback, so
the queue never reached one second and the test failed. The producer
is still running in that case, so the wait is best effort.
- BUILD: do not install the PceEmacs LSP client without threads
library(json_rpc_client) is only installed in multi-threaded builds, so
compiling lsp_client.pl stopped the single-threaded build. The client,
its diagnostics and highlighting are no longer installed there,
the registry does not try to load it, and emacs_lsp_editor is not run.
- TEST: run all xpce tests with the headless SDL driver Ten tests
(filter_item, graphics_state, toc, type_syntax, pending_exception,
pce_format, class_doc, pce_open, file_item, event_viewer) were
registered but missing from the hand-written list that receives
SDL_VIDEODRIVER=dummy, so they failed on a host without a display.
Tests are now added with
xpce_test(), which records them for that
environment, and the separate list is gone.
- TEST: test_video: skip if no clip can be written Where the encoders
are listed but cannot be opened, as in a sandbox without access to
the media services, all units failed. The condition now writes a
one-frame clip.
- FIXED: crash passing a host_method to Prolog as an argument
put_object() decoded any host data as a Prolog term, so the handle
of the message of a Prolog-defined method was read as a record, which
raised an assertion in copy_record(). Pass it as an object reference,
as unifyObject() does.
- FIXED: (//)/2 type errors on fractional graphics geometry An int slot
holds any num, so sizes, positions and font metrics can be fractional.
Use
truncate(E/N), which equals E//N on integers.
- FIXED: pcerefer/1 raised a type error on a named object (@name) A
named object is no blob, so Prolog holds no counted reference to it.
The tests also cover finding a stored value.
- FIXED: size->set ignored a height given with a default width It also
stored @default as the height when only the width was given.
- ENHANCED: pcerefer/1,2 accept a number to find where a value is stored
The holders of an int or num are the objects storing it in a slot,
chain, vector or hash table, directly or in a
real or number
object.
- FIXED: terminal_image: pasted lines were separated by empty lines A
copy put "\r\n" between lines on the clipboard and a paste sent the
text as is. Clients that take both CR and LF as a line end, libedit's
paste handler and Claude Code, inserted an empty line after every line.
A copy now uses the platform's line end ("\r\n" on Windows, "\n"
elsewhere) and a paste sends every line break as CR, as xterm does.
- TEST: epilog_label: wait for the program to run before asking its name
The shell puts the child in the foreground before it executes sleep.
Under load the test asked for the command in between and got the
shell's name.
- MODIFIED: terminal_image: output no longer scrolls a view the user
scrolled back A view the user scrolled back stays where it is while
output arrives, so it no longer jumps between the scroll back and
the end while a client keeps writing. Scrolling back to the end,
or sending input to the client, follows the output again. The class
variable and slot
scroll_on_output restores the old behaviour.
- TEST: test_theme: make theme tests independent of the desktop theme
The
theme unit assumed a light desktop. Skip the tests that need
one on a dark desktop, compare the theme after select_theme(system)
with @display<-system_theme and check that the original system colours
are restored rather than light ones. Load library(pce_colour_item)
for class theme_item, which is not autoloadable, so the theme_files
unit also runs on its own.
- CLEANUP: sdl_test_event: accept any num-convertible field value
field()
now converts sheet values using convertToNum(), so explicit real
and number objects are accepted besides tagged nums. Prolog floats
already arrive as tagged nums, so behaviour from Prolog is unchanged.
[Nov 7 2026]
- ENHANCED: profiler menu: tick the current settings; split sorting in
cumulative and flat The Profile menu now shows the current sort key,
measure and value display with a tick. Sorting is offered as two
popups, Sort cumulative and Sort flat. Sorting on the time or memory
of the children and on the predicate name was dropped from the menu.
- FIXED: plot hover and chart labels: type errors on fractional
coordinates On macOS the axis range, font height and window size may
be fractional, making between/3, //2 and plus/3 raise a type error
when showing the hover values of a plotter, as in the thread monitor.
[Nov 6 2026]
- ADDED:
library(graphviz_layout): graphviz_engine/1 Replacing
graphviz_has_engine/1 and graphviz_engines/1.
- TEST: predicate_info: find the info sheet as a tool pane; run
headless The sheet is no longer a frame labelled "Info for ...".
The test also lacked the SDL dummy environment and opened real windows.
- FIXED: theme checks and editor did not know the exception editor
colours
library(trace/exceptions) declares theme colours, but was
not listed by theme_library/1.
[Nov 5 2026]
- ENHANCED: IDE graph viewers draw their graphs as XPCE graphicals
The profiler call graph, the IDG and SDG viewers draw their nodes
and clusters themselves and use graphviz only for the layout. Their
class variable renderer selects
xdot to draw what graphviz draws.
The xref dependency graph uses graphviz for its full layout, placing
files left to right from exporters to importers; adding nodes and
the case where graphviz cannot be used still use the spring embedder.
- ADDED:
library(graphviz_layout) and graphviz_figure: lay out
graphicals library(graphviz_layout) uses graphviz to place nodes
of a given size and route the edges between them, so graphviz needs
no fonts. Class graphviz_figure in library(xdot) uses it to lay out
a graph whose nodes, clusters and edge labels are XPCE graphicals.
Running graphviz moved from library(xdot) to library(graphviz_layout).
- FIXED: Exception editor header unreadable in dark themes The header
used a fixed khaki background with the text colour of the theme.
Its colours are now theme colours with a black foreground.
- ENHANCED: Predicate info sheet is a reusable pane of the IDE The info
sheet (Info in PceEmacs, the profiler and xref) is now a tool pane
that can be docked. Asking for info on another predicate reuses
the open sheet. The tab strip is hidden while there is one tab,
scrolling stops at the table and the indexed property is shown as a
table using the notation of jiti_list/1. The header is bold and its
colours follow the theme, fixing white on yellow in dark themes.
- FIXED: tab close button a row too high after a lone tab's label
returns When a second tab is added to a tab stack that hides a lone
tab's label, the labels are laid out (placing the close buttons)
before the tabs are moved to make room for the label row. If the
label was shortened, the first tab was recomputed at its label-less
position and its close button ended above the label row. Lay the
labels out again after relayout.
[Nov 4 2026]
- FIXED: Wayland: Epilog caret sometimes left in the wrong place The
live resize event watch painted the frames whenever SDL posted a
window event. On Wayland, setting the window title makes libdecor
post such events from inside SDL_SetWindowTitle(). Epilog changes the
title from the prompt mark callbacks of the terminal, so the terminal
was painted halfway through processing output, typically showing the
caret where it was before the prompt. The watch now only paints if
the xpce lock is free, which is the case in the modal resize loops
of MacOS and Windows it is meant for.
- FIXED: terminal_image: text and caret sometimes not painted Painting
the terminal forgot the changes of all its lines, including those
outside the area being painted. Changes become damage when a chunk
of output has been handled; a paint while handling it (the callback
of ->prompt_mark releases the xpce lock) thus lost them. The prompt
was then not painted and the caret not moved until something repainted
the whole terminal, e.g., making a selection.
- ENHANCED: Profiler: Info item on the predicate popups The popups of the
call graph nodes, the call tree and the predicates of the details tab
have an Info item that opens the information sheet of the predicate,
as the Info item of PceEmacs does. It is not shown for xpce methods.
Clicking the source location on the sheet now starts PceEmacs if it
is not running, rather than raising an existence error on @emacs.
- FIXED: Profiler details: sort callers and callees by calls and redos
The time of the children was added to the calls instead of the redos.
- ADDED: Profiler GUI: show global stack memory The profile menu has
a Measure submenu to switch between time and global stack memory.
For memory: - The flat profile, the call graph and the call tree show
the bytes
allocated. - The details show the bytes allocated and discarded.
- The status line tells the memory allocated, discarded and reclaimed
by GC, and the number of garbage collections.
[Nov 3 2026]
- ENHANCED: PceEmacs C and C++ modes colour preprocessor directives
The
#name of a directive gets the new style preprocessor.
Lines starting with # inside a comment or string are skipped and the
if or else of #if and #else no longer get the keyword style.
- FIXED: Class directives of an extension refer to the class object
of the compiling process If the class exists while compiling a
pce_extend_class/1 block, the expansion embedded a reference to
that class object. A .qlf file compiled this way raised "object
@<class>_class does not exist" when loaded before the class was
realised, e.g.,
library(emacs/lsp_client) loaded from a user mode
extension. Class directives are now always stored with the class
and run by pce_extended_class/1 or when the class is realised.
- ENHANCED: PceEmacs C and C++ modes use clangd if it is installed If
clangd is in PATH, C and C++ buffers get semantic highlighting and
diagnostics, \e. finds the definition of the symbol at the caret, \e?
lists its references, goto_symbol finds a symbol by name and dynamic
abbreviation completes using clangd. Without clangd, \e. uses the
tag table. Both modes colour comments, strings and keywords, also
without clangd; C++ mode knows the C++ keywords.
- FIXED: A syntax_table created from another one keeps its line comment
syntax_table(Name, Parent) copied the character table but not the
line_comment, so PceEmacs modes inheriting their syntax, such as
C++ from C, did not recognise // comments. The quasi-quotation
delimiters were not copied either, and sentence_end got the parent's
paragraph_end.
- ADDED: PceEmacs: LSP diagnostics, semantic highlighting and symbol
items Diagnostics of an LSP server appear as underlined fragments
with an icon in the margin, which shows the message and the fixes
the server proposes. Language modes move between them using \egn
and \egp. Modes that have a style for
lsp(Type) highlight tokens of
Type using the server's semantic tokens. Positions are translated
from UTF-16 units.
- ENHANCED: text_buffer<-lsp_offset scans from the line it found before
<-lsp_offset counted lines from the start of the buffer on every
call, so translating all semantic tokens or diagnostics of a file
was quadratic. It now remembers the last line and its start, and
scans from there for a line at or after it. A change before that line
resets it. 20,000 lookups in line order take 3ms instead of 600ms.
- ADDED: PceEmacs: LSP client and a registry of LSP servers PceEmacs
connects buffers to LSP (Language Server Protocol) servers registered
using the multifile predicate lsp_server/2. It registers
clangd for C and C++ if clangd is in PATH, unless the Prolog flag
clangd is false. The client (and the JSON-RPC libraries) are
only loaded if a buffer is opened in a mode for which a server is
registered. A server declares the roles it plays (e.g., highlight,
symbol, complete), which a mode uses to find a client.
- TEST: Skip thread-based local sweep tests in single-threaded builds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- TEST: Epilog tab directory tests compare files, not paths macOS reports
a process's working directory with symlinks resolved, so /tmp shows
as /private/tmp and $TMPDIR as /private/var/folders/...
- FIXED: Epilog symbol picker raised "No implementation for
->insert_self" A key binding table mapped every character from 128
up to ->insert_self, also a table that binds no printable characters.
pane_frame ->shortcut offers each key to such a table, so a non-ASCII
key sent ->insert_self to the frame. Only tables that inherit insert
now insert these.
- FIXED: crash when dragging over a menu bar that was rebuilt while
open
menu_bar ->clear left <-current pointing at the open popup.
The pane frame frees the popups after clearing the bar, so the next
popup shown dropped the last reference to the freed one and then sent
->close to it. Local blobs made this visible: the Prolog reference
to the popup used to keep it alive until the next global atom GC.
[Nov 2 2026]
- FIXED: Scrolling or centering beyond the end of the text crashed
editor->scroll_to and text_image->center with a position beyond the end
of the text raised "More than 500 lines???" and crashed on large texts.
Both now show the end of the text.
- TEST: Profiler preferences include prof_tree.group_small
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- ENHANCED: Scroll bar thumb keeps a usable size on huge documents The
thumb is at least
scroll_bar.min_thumb_length long, a new class
variable whose default is twice the width of the bar. It travels
over the remaining free space, so it ends flush with the bar ends.
Middle-click/drag centres the thumb at the pointer.
- ENHANCED: profiler call graph shows pruned relatives as "… N more"
As the IDG viewer, the call graph shows the callers or callees that
its limits leave out as a dashed "… N more" node, with the summed
calls and time on its edge. Clicking it adds them to the graph,
connected to the predicates already there, until another predicate
becomes the current one. The new preference prof_tree.group_small
combines the callees the call tree does not expand because of min_share
into one such node. The profiler preferences have PlDoc comments,
so the "?" of the class variable editor explains them.
- FIXED: PceEmacs status messages were lost after a warning or error A
warning or error stood until a key was typed in an editor, so after one
given by a command started with the mouse, e.g., from a menu, status
messages no longer showed. Now a warning or error holds against lesser
reports for
pane_status_dialog.report_hold seconds (default 2),
counted from when it was given, which still prevents a command from
hiding its warning with the status message that follows. A warning
said again when its pane comes back into view no longer flashes.
- CLEANUP: Deleted unused images and prolog/unsupported The frame icons
of the PceEmacs modes and IDE tools, the old thread monitor icons, the
hourglass images and other 16x16 images were no longer referenced.
The subframe and TWM resizer classes in prolog/unsupported were
neither installed nor used; the tiling panes of
library(tab_frame)
supersede them.
- ENHANCED: LSP margin and action icons are SVG images in bitmaps/ide/lsp
The diagnostic icons (error, warning, information, hint), the code
action icons (apply-fix, apply-tweak) and the dictionary icon replace
the PNG images in bitmaps/64x64. The severities differ in shape as
well as colour, so they remain distinguishable at margin size.
- ENHANCED: The tools of the IDE show an icon on their tab A pane
names the image on its tab with the class variable
pane_icon, which
`pane <-pane_icon` reads; the tab gets it when it is made and when
the pane gets the keyboard in a tab it shares. New SVG icons in
bitmaps/ide/tools for the profiler, cross-referencer, memory viewer,
debug monitor, IDG/SDG/variants viewers, debugger, term viewer, key
bindings, bookmarks, buffer menu, editor and manual; the navigator,
thread monitor, symbol picker, debug status and exceptions editor
reuse existing icons. Deleted the broken `emacs_mode <-icon`.
- ENHANCED: Epilog tabs say what runs and shorten their labels to fit
A tab of a Prolog console shows the query; once it finished the label
keeps it and the icon turns gray. A tab running an external program
shows the program, or the directory of an idle shell, also after
cd.
A tab the user named keeps its name. Labels are shortened to fit the
tab row with a Unicode ellipsis, a directory at its start; a shortened
label shows the full label as tooltip and tab icons are drawn at 80%
of the label height.
- ENHANCED: Tabs are unique by name, so Epilog tabs may share a label
tabbed_window ->tab numbers the name of a tab whose name is taken,
keeping its label. Tabs are found by name, so Epilog no longer numbers
its labels: two shells are both labelled "OS shell". A client clearing
its title gets the tab's label back rather than its name.
[Oct 31 2026]
- ENHANCED: Object references are thread-local blobs Anonymous object
references (<pce> blobs) use PL_BLOB_LOCAL: the thread that creates
them reclaims them in its own sweep as soon as they are no longer
reachable, rather than at the next global atom garbage collection,
so the objects they keep alive are freed sooner. They become ordinary
atoms when another thread gets a reference to the same object or when
they are recorded. In a 20 s PceEmacs session driven by xdotool this
replaces 5 global atom garbage collections by 50 local sweeps that
reclaim about 50,000 references.
[Nov 2 2026]
- FIXED: profiler showed short times in seconds as 0.00 s. Times shown
in seconds now use a unit that keeps them readable, e.g., 1.2 ms or
547.7 µs, as the call tree does. Exact profiles are often over in
milliseconds.
library(plot/hierarchy_chart) exports format_value/3
for this.
- ENHANCED: profiler call tree shows times as "Show time as" says As
the other tabs, the call tree shows times as a percentage of the time
of the profile or in seconds. For this, class hierarchy_chart has
a new unit
percentage, of ->reference, which defaults to the total
of the root.
[Nov 1 2026]
- FIXED: crash on a mouse wheel event in a window without vertical
scrollbar <-vertical_scrollbar of such a window is @nil, which
was taken for a scroll_bar, passing a field read from beyond @nil
as receiver. This crashed swipl-win on macOS when using the wheel
over the profiler's call graph.
- FIXED: profiler call tree counted the time of recursions more than once
The tree followed calls between the predicates of a recursion using
the time of the outermost call, which includes that of all deeper
levels, while each predicate also got its own time at all levels.
The predicates of a recursion are now shown once each, owning the
time they spent themselves and in calls out of the recursion, such
that the tree adds up to the time of the call into the recursion.
- ENHANCED: profiler call graph: preference max_edge_width The width
of an edge along which all time flows is now the class variable
prof_graph.max_edge_width, editable in the preferences. Set it to
1 for all edges to be thin.
- FIXED: terminal: programs addressing the screen over a closed fold
wrote into the fold Caret motion and screen positions counted buffer
lines rather than rows of the window, so a closed fold's hidden lines
took part.
top, which homes the caret and writes its rows with a
newline after each, showed only its first row over the old screen.
- TEST: Only test editing a C method if its C source can be found
Finding the C source of a method requires
addr2line(1) or atos(1)
and debug information, which is not available in every build, notably
not on Windows.
- TEST: Use tmp_directory/2 to avoid clashes between parallel tests
Creating a temporary directory using tmp_file/2 and make_directory/1
fails on Windows if parallel test processes get the same name from
_
wtempnam(). tmp_directory/2 retries with a new name.
[Oct 31 2026]
- FIXED: Crash at halt in SDL's timer thread Prolog unloads pl2xpce.so at
halt and with it libSDL3, while SDL's timer thread and our fd-watcher
thread were still running in that code. A new exit hook, which runs
after the others, stops and joins the fd-watcher thread and calls
SDL_Quit(), which stops the timer and audio threads.
[Oct 30 2026]
- FIXED: terminal: output that scrolls a hovered link away left it armed
The hovered link and the link cursor were only re-evaluated when
the mouse moved. The terminal now remembers the pointer position
and re-evaluates what it hovers whenever the text changes, updating
the cursor. Leaving the terminal disarms.
Package yaml
[Nov 13 2026]
- CLEANUP: static int -> bool for functions that return a truth value
Mechanical, by a tool that only converts static functions whose every
return, in every alternative definition, is a truth value (literal,
comparison, logical expression, call to a bool function, or an
int variable that only holds truth values), whose address is never
taken and that use no macro returning other values. Return values
are unchanged.
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
- CLEANUP: decode the emitter output with PL_utf8_code_point() Drop
our own UTF-8 decoder and the copy that kept it from reading past
a truncated sequence: PL_utf8_code_point() respects the end of
the buffer. Requires PL_utf8_code_point().
[Nov 9 2026]
- FIXED: yaml_write/2,3 left the output stream locked The emitter
acquired the output stream without releasing it, such that other
threads blocked forever when writing to this stream. The stream is
now only locked while emitting an event.
[Nov 2 2026]
- FIXED: yaml_read/2 on streams whose encoding is not UTF-8 The
input handler passed the raw bytes to libyaml, which expects UTF-8.
This notably broke
yaml_read(string(Text), DOM) if Text contains
non-ASCII characters below 256 as open_string/2 then uses ISO Latin 1.
We now read code points and encode them as UTF-8 if the stream encoding
is not octet, ASCII or UTF-8.
Package zlib
[Nov 13 2026]
- CLEANUP: use true/false instead of TRUE/FALSE, drop register
Mechanical: TRUE and FALSE outside string literals became true and
false, local definitions of TRUE/FALSE became #include <stdbool.h>,
the register storage class and trailing white space were removed.
[Nov 9 2026]
- FIXED: zlib: decompression recursed for input that produces no
output Reading many empty gzip members or other input that produces
no output for a long time, such as long headers, called the read
function recursively. This is now a loop. Also check the result
of
inflateInit2().