RELEASE NOTES

v0.2.79

Abla 0.2.79

View original release and assets

Abla 0.2.79 keeps safe code out of memory it doesn't own in native buffers and the GPU kernel runtime, closes another way a dependency's $ syntax could use your file's compile-time grants, and checks prepared package copies against the lock.

Before you upgrade

  • Fields of restricted standard-library types, such as closed of a NativeByteBuffer, NativeI64Cell or NativePointerCell, can be written only from trusted code. Code that sets one itself now fails with native.trust:<Class>.<field>; move the write into a trusted function or use the type's own functions.
  • HTTP clients refuse, before connecting, a method, target, host or header value that could split the request. HttpClientResult.error names the refused part.
  • Every build checks a prepared package copy in .abla/packages/ against abla.lock, and fetches a changed copy again.

The full release notes also cover the static Linux compiler's hardening, HTTP/1, HTTP/2 and WebSocket fixes, faster exact-sized reads, AArch64 Linux libraries, and regex findAllWithin and replaceWithin.

Verify downloads against the signed checksum list before unpacking.

Download the Windows x86-64 toolchain (ZIP)

Download the Windows ARM64 toolchain (ZIP)

Verify this release

Save SHA256SUMS, SHA256SUMS.sig, and the project's release-signing.pub alongside your download. To verify the signature and the file together, run tools/verify-release.sh from the release tag's checkout in Bash (Git Bash or WSL on Windows). Pass the directory containing the downloads and the exact filename you downloaded.

bash tools/verify-release.sh /path/to/downloads abla-toolchain-x86_64-linux.tar.gz

To verify manually with OpenSSH, run these commands in the download directory and set archive to your download's filename.

awk 'NR == 1 { print "ablac-release " $1 " " $2 }' release-signing.pub > allowed-signers
archive=abla-toolchain-x86_64-linux.tar.gz
ssh-keygen -Y verify -f allowed-signers -I ablac-release -n abla-release -s SHA256SUMS.sig < SHA256SUMS &&
  awk -v archive="$archive" '$2 == archive { print }' SHA256SUMS | shasum -a 256 -c

Installation and downloads · Language tour · Standard library reference

Full release notes

Behaviour changes and migration (read first)

  • **A dependency's $ syntax can't have its own code run with your

file's compile-time grants (high; fixes a known issue of v0.2.68 to v0.2.78).** Code that a dependency's $ handler leaves for the compiler to run later now runs only with grants that both your file and the dependency allow, as the # sites a handler builds do since v0.2.78. The standard library's handlers are unchanged. (afb1bb8da, #1139 area 1)

  • **Fields of restricted standard-library types can be written only from

trusted code (high; fixes a known issue of v0.2.60 to v0.2.78; decision

161).** Ordinary code could write fields that native buffers and cells

rely on, so safe code could reach memory it doesn't own. A field of a class whose raw constructor is restricted (closed of a NativeByteBuffer, NativeI64Cell or NativePointerCell, error of a CudaKernelDevice) can still be read anywhere, but writing it outside a trusted function is now the error native.trust:<Class>.<field>. This can break a build: code that sets such a field itself, for example buffer.closed = true to keep a drop from freeing memory it doesn't own, must move the write into a trusted function or use the type's own functions. docs/language.md describes the rule. (0586414ea)

  • **The GPU kernel runtime keeps safe code inside its own memory (high;

experimental; fixes a known issue of v0.2.72 to v0.2.78).** Three routes let safe code make abla/kernel or abla/kernel/cuda read or write memory it doesn't own. The CPU backend's launch state (KernelCpuState) is now private to abla/kernel. Every CUDA driver call makes its own device's context current, so memory and launches go to the right device when several are open. Upload and download refuse a closed host buffer. A device record is also checked against both its context and its module (low). (aa056c459, #1139 area 13)

  • **Builds check a prepared package copy against the lock (medium; fixes

a known issue of v0.2.64 to v0.2.78).** A single-file build, and a project build that also had a vendored copy, trusted the copy in .abla/packages/ by its marker files, so a changed copy (from a restored CI cache, or committed next to a reviewed lock) was built as is. Every build now checks the copy's files against abla.lock, and a copy that differs is fetched again or set aside for the vendored tree. The result is recorded with the copy's file sizes, inodes and change times, so an unchanged copy isn't hashed again (about 240 ms saved per build for four packages of 650 files). (6bf6d9434, 7528d2a0d, #1139 area 2)

  • **HTTP clients refuse a request that would split (medium; fixes a known

issue of v0.2.60 to v0.2.78).** HttpClient.send, HttpAsyncClient (also over HTTP/2) and the WebSocket TLS client's upgrade wrote the method, target, host and header values they were given unchecked, so a line break in user input could add headers or a second request. They now refuse, before connecting, a method or header name that isn't a token, a target with a space or control byte, a host with a space, comma or control byte, and a header value with a control byte other than tab. HttpClientResult gains error, which names the refused part without its value; the async completion carries the same error, and H2Client.request returns -1. (ce912c5bb, #1139 area 4)

  • **The static Linux compiler's own hardening works (medium; fixes a known

issue of v0.2.64 to v0.2.78).** The compiler links LLVM and lld against Abla's static libc, which weakened their protections: the stack canary was one constant on AArch64 and RISC-V (now random per process; on x86-64 its low byte is now zero, as with glibc), and the _FORTIFY_SOURCE checks did the plain copy instead of aborting. Four libc functions are also fixed: realpath could write past a PATH_MAX buffer (low-medium), posix_memalign returned a small block for a size near the maximum (low-medium), qsort could step outside the array with an inconsistent comparator (low), and printf now follows C for %.0d of zero and a NULL %s under a short precision (low). None of these is reachable alone; each made a separate overflow in LLVM or lld easier to exploit when compiling untrusted code. (5453a3022, 8a541e5b3, fe9865f0a, 985e8fd0e, c074fd04c, c7f77e7a0) A second review fixed more: on AArch64 the printf family read its arguments from the wrong place, so text LLVM formats could show stack contents or crash the compiler (medium; 8bb1b3ee4). errno and pthread key values are each thread's own (they could be shared by two threads; low-medium; fcba677fe, 6e1d5ee83), and atexit handlers registered from several threads at once are no longer lost or written into a freed table (low-medium; 91e1942b6). sprintf writes its text again, and bounded string functions given SIZE_MAX treat it as no limit (low-medium; c44428507, 4e789a4f5). printf, strftime and __wctype_l no longer read past the end of their input (low; 9ea376d93, 9e3117c48), sched_getaffinity clears the part of the mask the kernel doesn't write (low; c26dec79b), and the ctype tables and log2f are thread-safe (low hardening; 47f8bc801, 49f6e2ebd). (#1139 area 14)

Fixes

  • HTTP/2 server (low-medium): a request is held to the HTTP/1.1 rules.

An :authority or host that isn't a host, a second host, a :path with a space or control byte, and bad trailers on streaming routes now reset the stream with PROTOCOL_ERROR. (622742884, #1139 area 4)

  • HTTP/1 servers (low-medium): a request in absolute form (`GET

http://host/path) is served as /path with that host, as RFC 9112 requires, instead of keeping its Host line; one with another scheme, userinfo or no host is refused. The HTTPS event server's streaming routes, the WebSocket event server and the WebSocket server's plain HTTP path now check the request line and framing as the HTTP servers do: the last one took the last of two Content-Length values and accepted two Host` lines. (2e666ec26, #1139 area 4)

  • HTTP/2 client (low-medium): a response header or trailer whose name

isn't a token, or whose value has NUL, CR or LF, resets the stream, so it can't reach an HTTP/1.1 peer a program forwards it to. (5da712d0f)

  • Async HTTP client URLs (low): userinfo (http://token@host/) is

refused before any DNS lookup instead of going to the resolver, the host ends at ? and #, the fragment is no longer sent, and the scheme matches in any case. IPv6 literals never worked and are now refused with "invalid URL"; docs/networking.md says so. (312478356)

  • WebSocket TLS client (low): each frame gets a fresh masking key, as

RFC 6455 asks, instead of one key per connection, and a masked frame from the server closes the connection. (c3de6642e)

  • Packages (low): a fetched package may not hold file names Windows

reads as other files or refuses (backslash, colon, device names, a trailing dot or space, < > " | ? *), so a vendored project still checks out on Windows, and its abla.toml may not be a symbolic link (7e2c2e9a7). ablac package info, add and outdated read a repository under the same file limit, timeout and object checks as a fetch (a7a973fb7). Package index and manifest text refuses C1 and bidirectional control characters, which could make one package name read as another (5f4ee3679). (#1139 area 2)

  • `$json` (low): an object whose computed key equals another key at

run time has that key once, with the later member's value, as JSON.parse reads it. Before, both members were written. (715c606d9, decision #154)

  • AES-GCM (low): a text over 2^36 - 32 bytes under one nonce is

refused, as NIST SP 800-38D requires. Past it the block counter would wrap onto the block that masks the tag. (11986ef0c)

  • RSA key generation (low hardening): the primality test does all of

its squarings on the prime it keeps, so its timing no longer depends on that prime. (918ce8309)

  • Compile-time grants (low-medium): a file inside your project that

only a dependency imports now counts as that dependency's code, so its compile-time code gets the dependency's grants, not yours. A file your project imports anywhere stays yours. (199cedde0, #1139 area 1)

  • `$regex` (low hardening): a literal with named captures runs only the

standard library's Regex constructor at compile time; its capture factory is called at run time. Its cost is unchanged. (3f619b27f, #1139 area 1)

  • TLS 1.3 (low): data after a KeyUpdate in the same record is refused

with unexpected_message, as RFC 8446 requires, and a server that ignores early data stops skipping records at the first one that decrypts under the handshake key. (5f318a4d4)

  • Shared libraries with compile-time code: an uncached x86-64 Linux

shared-library build whose source runs compile-time code no longer prints "JIT session error: Unexpected definitions" (the library was written either way). (6cde5e749)

  • Import remap: a replacement module that doesn't parse is reported by

its parse errors, not as missing declarations, and the annotation error says that private goes before @inline. (def041785)

  • verify-release: the published v0.2.67 verifies as a whole

directory, and a missing SHA256SUMS is explained (a draft has none until its publish job signs it). (1e3999561)

  • Windows: the intermittent watchdog hang is fixed: the watched thread

could close the handle the watchdog was stopping it through and stay suspended. A run stopped by the watchdog can also no longer leave a newer watch without a deadline, which let a hung JIT loop or a long sleep run on. (ccc7e516d, 1212cee84, 9b8f45e7a)

Improvements

  • Reads into an exact-sized string are one memory copy. A read that

fills less than half its buffer (a socket read on an event server, a file read under a large limit, pipes, process output, pure TLS) was copied 8 bytes at a time with a check per step. An HTTP event server's request with a 16 KB body takes 81% fewer instructions, a 1 KB body 18% and small JSON requests 6 to 7%. (0b5fcacc7)

  • AArch64 Linux libraries: shared and static libraries for the

aarch64-linux target carry their own runtime, as Android's do: the shared one links without libc (only pthread_create and pthread_join come from the host), and the static one no longer imports malloc, write and the rest. The shared one failed to link before. (8f85a9b88)

  • Regex: `findAllWithin` and `replaceWithin` bound the work of a whole

findAll or replace with one step budget, counted as findWithin counts. findAllWithin(text, maximumSteps, start = 0) gives RegexFindAllDone(matches) or RegexFindAllExhausted(matches, resumeAt); pass resumeAt as start to continue. replaceWithin gives RegexReplaceDone(text) or RegexReplaceExhausted(), never a half-replaced text. Use these for text from untrusted clients: a pattern like a+b|a made findAll take 12 million steps on 2,000 characters. (73d4992a3, decision #153)

  • Editor: a repeated request on an unchanged project is answered

without reloading and re-parsing the project (120 to 150 ms saved per request on a large project). (3d4f61758)

  • Browser playground: the WebAssembly runtime's collector sweeps in

address order and merges free blocks with a bitmap instead of a sort. Compiling the "Write JSON" example is about 3% and then 5 to 7% faster from the two changes, and "Compile-time functions" about 10%. (38e730d12, 66a3b0798)

Bootstrap convergence

Two fresh Linux builders bootstrapped the source of v0.2.79 (ba5d6b7d5c26a65059ed7ca02c32a6780add41c7) from different seeds and reached the same compiler:

  • route A: v0.2.78 (ablac-x86_64-linux sha256 334959d4198a44871dfaf974f8b446be6ede5d4d0a929eb203665f933f5e608c) -> stage 1, 2, 3
  • route B: v0.2.77 (sha256 3ec18350dc1c09f8d5d3920ed7a65d2a23a6f9f72c50a73f66f82366f84dd3d8) -> the sources of v0.2.78 (648cf072a454ae1f7d172cd9bc484976ac567054), twice -> stage 1, 2, 3
  • canonical IR (raw, non-debug, pre-prune --emit-llvm src/orc_main.ab at /build/source): sha256 64f6d203479005f3d8b2f92171dc324501904b7f649f7764ecc0f21cb0226e72
  • stage 2 executable d12a85450f4c0ae8461457006b5d49eb27a39a0634b3452347380071178d6cde, object 14ceff55fc3635c5418395768d6dcbc6169d8eeef91d98761a47c57daa1bad36
  • toolchain: environment af5f2ced5b6bcfdab3d335ce55c899e0416169cfa683d20a5ba8712fca1b6474, closure b1872f918c677d4b376f11826949774047bafeac6c208592b89a05f2dc4640aa
  • run: https://github.com/AndreBaltazar8/ablac/actions/runs/46030062723

This is route convergence within one compiler lineage: it is not an independent implementation, and it does not exclude a seed compromise shared by both routes (docs/bootstrap.md).