Worth a looka fix or feature you may want
Channel binding and ARM-safe locks land amid DuckDB churn
This edition adds optional TLS channel binding to server-side Kerberos authentication and closes concrete portability faults in CPU32 integer encoding, ARM lock inspection and FPC 3.3 aarch64 RTTI. DuckDB and Quack receive another long refactor sequence, ending with a nested-type cleanup fix in build 2.4.17841. ZIP writers and the EMF-to-PDF renderer also get correctness fixes that are worth taking for affected applications.
TL;DR
- Land on build 2.4.17841 rather than 2.4.17840, whose TDuckDBTypeInfo rewrite did not release cached nested names.
- Kerberos servers can now require a tls-server-end-point channel-binding digest through SetAuthorizeNegotiate.
- CPU32 VarInt64 encoding, ARM lock-state reads and FPC 3.3 aarch64 published-method enumeration receive concrete fixes.
- ZIP level-0 streaming now emits a valid deflated entry, while empty directories carry the correct zero CRC.
- The EMF renderer corrects clipping, stock-font metrics, device-pixel bounds and transformed drawing.
Upgrade advice
Take cda3c7395288a4b3c50b7591174cc1c41de92833, build 2.4.17841, so the full DuckDB sequence includes its final nested-name cleanup. CPU32, ARM, FPC 3.3 aarch64, ZIP-stream and EMF-to-PDF users should prioritize the upgrade and rerun their platform-specific tests. Kerberos deployments enabling CBT should test both matching and missing bindings. The raw payload records no superseded_by revisions.
27 of 27 entries · 32 commits upstream
1
High
EMF-to-PDF rendering matches GDI clipping and transforms
TPdfEnum and TPdfCanvas now treat EMR_INTERSECTCLIPRECT as its own region, map EMR_EXTSELECTCLIPRGN and record bounds in device units, measure stock fonts from LOGFONT and apply world transforms before page mapping. Device-pixel expansion, rotation, shear and reflection handling are corrected, with six regression tests.
Fixes
mormot.ui.pdf
f07cc6d9+1405-131
ui: pdf - EMF clipping, stock fonts, device pixels and world transforms
Impact
PDFs generated from Windows EMF no longer lose edge pixels, collapse stock-font text, over-clip text or misplace mirrored and rotated shapes. Backends that embed reports, charts or printing output should see corrected layout without API changes.
Upgrade recommended
Regenerate representative EMF reports and compare clipping, font size, edge bitmaps and transformed shapes.
Units
2
High
RTTI readers wait for registration to finish
TRttiCustomList.RegisterSafe changes from TOSLock to reentrant TMultiLightLock. FindType, FindClass, RegisterClass, FindByArrayRtti and TInjectableObject.AutoResolve now wait or re-enter safely when metadata registration is active, while pair insertion stays under the global registration lock.
Fixes
mormot.core.collections+4
9982b009+83-74
core: enhanced TRttiCustomList thread safety
Impact
Backends that first discover or register RTTI from multiple threads are less likely to observe partially initialized metadata or race through VMT cache slots. No application migration is required.
Upgrade recommended
Take build 2.4.17831 or later and rerun concurrent startup and dependency-injection tests.
3
High
ZIP level-zero streams and empty folders become standards-compliant
TZipWrite.AddEmptyFolder writes CRC32 zero for no data. AddDeflatedStream always declares Z_DEFLATED, including CompressLevel zero where zlib emits stored blocks inside a raw deflate stream; regression tests reopen and verify both archives.
Fixes
mormot.core.zip
bf1d7825+63-5
mormot.core.zip: fix empty folder crc and AddDeflatedStream level 0
Impact
ZIP files containing empty directories or streams created with compression level zero are now accepted and verified by readers instead of carrying an invalid CRC or mismatched compression method.
Upgrade recommended
Upgrade ZIP-producing services and add interoperability checks for empty directories and CompressLevel=0 streams.
Units
4
High
Lock-state probes become atomic on ARM
IsLocked in TLightLock, TRWLightLock, TRWLock and TOSRWLightLock keeps the direct Flags read on Intel but uses a no-change LockedExc32 or LockedExc compare-exchange on other CPUs.
Fixes
mormot.core.os
86e4bb5c+20-4
core: ensure T*LightLock.IsLocked is thread safe on ARM
Impact
ARM Delphi and FPC builds no longer rely on a plain shared-memory read when inspecting lock state. This removes a weak-memory-ordering race in diagnostics and lock-dependent control paths.
Upgrade recommended
Prioritize build 2.4.17841 for ARM servers that use the lightweight lock types.
Units
5
High
Published-method enumeration stops crashing on FPC 3.3 aarch64
GetPublishedMethods keeps the packed four-byte entry offset for FPC 3.2 and older, but derives ENTRIES_OFFSET from TVmtMethodTable for newer compilers. On aarch64 with FPC 3.3 this moves entries from offset four to offset eight.
Fixes
mormot.core.rtti.fpc
f8f23b92+12-3
core: fixed GetPublishedMethods on FPC 3.3+ aarch64
Impact
FPC 3.3 aarch64 code can enumerate published methods, including TSynTestCase tests, without reading a shifted pointer and raising EAccessViolation. FPC 3.2 layouts remain unchanged.
Upgrade recommended
Upgrade FPC 3.3 aarch64 targets before running published-method discovery or TSynTestCase suites.
Units
6
High
CPU32 now encodes the full Int64 range consistently
ZagZigInt64 now special-cases Low(Int64) on CPU32 to avoid negating the unrepresentable minimum value. TFastReader.VarLeb64 also promotes the one-byte sign-extension expression to Int64.
Fixes
mormot.core.buffers
ff48d654+7-4
core: fixed VarInt64 encoding on CPU32
Impact
32-bit Delphi and FPC builds now produce the same VarInt64 bytes as 64-bit builds for Low(Int64), and single-byte signed LEB128 reads keep a 64-bit result. Stored data and protocol values at this boundary are corrected.
Upgrade recommended
Upgrade 32-bit targets and add a Low(Int64) round-trip to serialization tests.
Units
7
High
Nested DuckDB type names are released with their metadata
TDuckDBTypeInfo.Done in mormot.db.raw.duckdb now assigns nil to Names after recursively freeing Child and destroying Handle. This releases the managed TRawUtf8DynArray used by nested STRUCT and ENUM metadata.
Fixes
mormot.db.raw.duckdb
cda3c739+4-2
db: fixed potential memory leak in TDuckDBTypeInfo
Impact
Repeated DuckDB result descriptions with nested or enumerated types no longer retain cached name arrays. Delphi and FPC application APIs are unchanged, but long-running database processes avoid this leak.
Upgrade recommended
Use build 2.4.17841 or later if DuckDB queries return STRUCT, UNION or ENUM columns.
Units
8
Medium
Kerberos acceptors verify optional channel-binding data
KerberosServerAuthHeader accepts a CbtHash, places it in TSecContext before ServerSspiAuth and rejects invalid lengths or unsupported old Windows versions. POSIX additionally calls gss_inquire_context and requires GSS_C_CHANNEL_BOUND_FLAG.
Security
mormot.lib.gssapi+1
909a6703+42-5
net: extend KerberosServerAuthHeader() with an optional binary CBT hash
Impact
SSPI and GSSAPI server authentication can enforce that the client observed the same TLS endpoint certificate. Authentication fails when a requested binding is absent or mismatched; the default empty digest remains backward compatible.
Worth a look
Public API
KerberosServerAuthHeadersignature-changed — Adds optional const CbtHash: RawByteString = ''.
9
Medium
HTTP Negotiate authentication can require a TLS channel binding
THttpServerSocketGeneric.SetAuthorizeNegotiate accepts an optional raw CbtHash, stores it until authorization and passes it to KerberosServerAuthHeader. SetAuthorizeNone clears the stored digest, and invalid oversized values raise EHttpServer.
Security
mormot.net.server
9a783e77+22-6
net: CBT hash support for THttpServerSocketGeneric.SetAuthorizeNegotiate
Impact
Kerberos-authenticated HTTP endpoints can reject credentials that are not bound to the active TLS certificate, reducing credential forwarding exposure when CBT is configured. Existing calls without CbtHash retain prior behavior.
Worth a look
Public API
THttpServerSocketGeneric.SetAuthorizeNegotiatesignature-changed — Adds optional const CbtHash: RawByteString = ''.
Units
10
Medium
Channel-binding certificate parsing adds an explicit ASN.1 gate
TX509.HashForChannelBinding still tries PemToCert and otherwise treats the input as DER, but now exits unless AsnDecChunk accepts the original Cert buffer before TX509.LoadFromDer runs.
Fixesinterp
mormot.crypt.x509
1550a1c7+5-6
net: hardened TX509.HashForChannelBinding()
Impact
Malformed certificate input is rejected earlier. Because the new check is applied to Cert rather than the normalized der buffer, deployments passing PEM chains should explicitly retest this path.
Worth a look
Units
11
Medium
Name lookup avoids cached RTTI while registration is locked
TRttiCustomList.FindName now checks RegisterSafe.IsLocked before dereferencing fLastHashName and comparing its Name. The lock test moves ahead of all cached-object access.
Fixes
mormot.core.rtti
ed9dfefa+5-5
core: minor TRttiCustomList.FindName hardening
Impact
Concurrent RTTI registration no longer lets a name lookup inspect a cached object while it may still be changing. Application code and public RTTI method signatures are unchanged.
Units
12
Medium
Windows CNG signing no longer dereferences a missing logger
TCryptPrivateKeyCng.SignDigest now wraps both success and exception trace calls in Assigned(log). Private-key handle cleanup remains in the existing finally block.
Fixes
mormot.crypt.win
31279f42+5-3
crypt - Ensure log exist before logging
Impact
Windows backends can sign through CNG when no TSynLog instance is supplied without raising an access violation from diagnostic logging. Cryptographic output and method signatures are unchanged.
Upgrade recommended
Update Windows CNG users that disable logging or pass a nil logger.
Units
13
Medium
Core buffers can now write standard signed LEB128
ToVarLeb64 and TBufferWriter.WriteVarLeb64 encode signed LEB128 separately from mORMot zigzag VarInt64. TFastReader.VarLeb64 receives explicit bounds checks, and regression tests verify known encodings and full Int64 limits.
New features
mormot.core.buffers+1
7a50e3a6+91-13
core: new SLEB128 encoding
Impact
Delphi and FPC code can produce standard SLEB128 for DWARF, DuckDB, WebAssembly and similar protocols without custom writers. Existing VarInt64 remains zigzag encoded.
Public API
ToVarLeb64added — Encodes an Int64 using standard signed LEB128.TBufferWriter.WriteVarLeb64added — Appends a standard signed LEB128 value.
14
Medium
TFastReader gains signed LEB128 decoding
TFastReader.VarLeb64 decodes one- through ten-byte signed LEB128 values, performs sign extension and rejects invalid tenth bytes. Regression tests cover positive, negative, boundary and malformed encodings.
New features
mormot.core.buffers
a2e88d9e+86-2
core: new TFastReader.VarLeb64 method for LEB128 decoding
Impact
Core, DWARF and DuckDB code can share one checked SLEB128 decoder instead of maintaining separate implementations. Existing VarInt64 semantics remain unchanged.
Public API
TFastReader.VarLeb64added — Reads a signed LEB128 value as Int64.
Units
15
Medium
TMultiLightLock can wait without taking ownership
TMultiLightLock renames ThreadID to LockedThreadID, makes IsLocked atomic on non-Intel CPUs and adds WaitUnlocked. The new method spins until another thread releases the lock but returns immediately for the current reentrant owner.
New features
mormot.core.os
e61a4388+30-11
core: enhanced TMultiLightLock
Impact
Framework code can wait for protected initialization without acquiring the lock or deadlocking its reentrant owner. Existing Lock, TryLock and UnLock callers keep their behavior.
Public API
TMultiLightLock.WaitUnlockedadded — Waits for another thread to unlock without acquiring ownership.
Units
16
Medium
X.509 certificates can produce the digest required by CBT
TX509.HashForChannelBinding accepts DER or a PEM chain, selects the first certificate, parses its signature algorithm and calls mormot.crypt.secure.HashForChannelBinding to return the raw tls-server-end-point digest.
New features
mormot.crypt.secure+1
15ebdd5a+35-2
crypt: new class function TX509.HashForChannelBinding
Impact
Delphi and FPC servers can derive the CBT value directly from their certificate material instead of duplicating signature-algorithm mapping. Existing certificate APIs are unchanged.
Public API
TX509.HashForChannelBindingadded — Returns the raw tls-server-end-point digest from DER or PEM input.
17
Medium
REST service metadata gets a locked snapshot method
TRest.ServicesInfo locks the new shared fStatSafe field around fServices.AsSoa. Session creation and GET /stat/soa use the wrapper, while the previous server timestamp lock is folded into the same 32-bit TLightLock.
New features
mormot.core.os+3
2c404822+21-11
rest: new TRest.ServicesInfo method
Impact
Concurrent requests for SOA metadata no longer read TServiceContainer.AsSoa without owner-side protection. Service registration itself remains non-thread-safe and should still finish before serving requests.
Public API
TRest.ServicesInfoadded — Returns a thread-safe snapshot of Services.AsSoa.
18
Medium
Quack type conversion moves from table scans to direct dispatch
TQuackType.SetStorage replaces a linear FIXED_TYPES lookup with a case statement, reuses TFastReader.VarLeb64 for sequence and HugeInt values and routes fixed-value text through DuckFixedToTextBuf. Interval months and days are also read as signed integers.
Performance
mormot.db.raw.duckdb+1
4820957c+94-97
db: some DuckDB/Quack enhancements
Impact
Quack decoding removes an O(n) type lookup and correctly preserves negative interval components. DuckDB and Quack callers keep the same SQL-facing behavior and interfaces.
19
Medium
DuckDB type metadata becomes method-based and Delphi 7 compatible
TDuckDBTypeInfo becomes a record with methods when USERECORDWITHMETHODS is available and an object otherwise. Child changes from a dynamic array to allocated PDuckDBTypeInfoArray storage with ChildCount, while Init, Done, Nest, EnumValue and HasVariant replace global helpers.
Compiler & platform
mormot.db.raw.duckdb+1
d7cabac6+110-98
db: rewritten TDuckDBTypeInfo
Impact
The mORMot DuckDB SQL driver keeps the same behavior and now compiles on Delphi 7/2007. Code directly using the low-level TDuckDBTypeInfo fields or removed helper procedures must be updated.
Worth a look
Public API
TDuckDBTypeInfo.Childsignature-changed — Dynamic-array storage is replaced by PDuckDBTypeInfoArray plus ChildCount.DuckDBTypeInfoInit/DuckDBTypeInfoDone/DuckDBEnumValue/DuckDBTypeHasVariantremoved — Use the corresponding TDuckDBTypeInfo methods.
20
Medium
macOS ODBC resolves Homebrew and MacPorts libraries
TOdbcLib uses libodbc.2.dylib on Darwin and tries the bare name followed by /opt/homebrew/lib, /usr/local/lib and /opt/local/lib. Other POSIX systems keep libodbc.so.1 and Windows keeps odbc32.dll.
Compiler & platform
mormot.db.raw.odbc
3b37a262+12-1
db: load unixODBC on macOS
Impact
FPC backends on Intel and Apple Silicon macOS can load unixODBC installed by Homebrew or MacPorts without modifying the dyld search path. Windows and Linux behavior is unchanged.
Upgrade recommended
Upgrade macOS ODBC deployments and verify TOdbcLib.Create against the installed unixODBC package.
Units
21
Low
Follow-up checks tighten lengths and relax CBT digest sizing
Quack ReadLen compares its QWord length with a PtrUInt remaining size instead of signed Int64 values. KerberosServerAuthHeader and SetAuthorizeNegotiate now accept any non-empty digest up to THash512 size rather than only 32, 48 or 64 bytes.
Fixes
mormot.db.raw.duckdb+2
7c4407ef+7-11
all: minor fixes after previous commits
Impact
Quack rejects oversized lengths without a signed conversion edge case, and CBT can use other standard digest widths. Existing callers and wire formats remain compatible.
22
Low
A public helper extracts the first certificate from PEM text
PemToCert iterates NextPem blocks, accepts the first pemCertificate, converts it with PemToDer and wipes each temporary PEM string. PemHeader also initializes cached label lengths from the final enum slot instead of the always-empty first slot.
New features
mormot.crypt.secure
88940b8b+26-4
crypt: new PemToCert() function
Impact
Callers can safely obtain a leaf certificate from a concatenated PEM chain. Existing parsing behavior is unchanged except that PemHeader no longer recomputes its label table on every call.
Public API
PemToCertadded — Extracts and DER-decodes the first standard CERTIFICATE block.
Units
23
Low
DuckDB 128-bit decimal conversion uses native 64-bit halves
DuckHugeIntToTextBuf now stores the 128-bit value in THash128Rec and negates it through its L and H QWord fields. Division still walks four 32-bit limbs, but zero tests and two's-complement negation use the wider fields.
Performance
mormot.core.buffers+1
f38a16df+18-25
db: optimized DuckDB HugeInt conversion
Impact
DuckDB HUGEINT, UHUGEINT and DECIMAL text conversion performs less limb-by-limb work while preserving output. No Delphi or FPC application code changes are required.
24
Low
Quack decoding removes temporary strings and duplicate float paths
QuackSingle centralizes unaligned 32-bit float reads, ReadStr fills an existing RawUtf8 and SkipStr advances without allocation. Parser errors call ESqlDBQuack directly, and HugeInt writing delegates signed LEB128 to TBufferWriter.WriteVarLeb64.
Under the hood
mormot.db.raw.duckdb
ac8ccd17+86-114
db: some more DuckDB refactoring
Impact
Quack response decoding performs fewer allocations and follows one conversion path for unaligned floats and signed 128-bit values. The response format and application-facing SQL API do not change.
Units
25
Low
DuckDB nested type metadata briefly returns to dynamic arrays
TDuckDBTypeInfo replaces the pointer-based Children array and ChildCount with a managed Child dynamic array. Initialization, variant discovery, cleanup and SQL vector conversion switch to length(Child) and direct indexing.
Under the hood
mormot.db.raw.duckdb+1
60dfac79+49-61
db: rewritten TDuckDBTypeInfo structure
Impact
This is internal churn in the same-day DuckDB sequence and is superseded in practice by the later Delphi 7-compatible structure at build 2.4.17840. Applications should consume the final build rather than target this intermediate layout.
26
Low
DWARF line decoding reuses the bounded SLEB128 reader
TDwarfReader removes its private ReadLeb128 routine and uses TFastReader.VarLeb64 for DW_LNS_ADVANCE_LINE. The shared reader supplies the same signed line delta with centralized overflow and malformed-input checks.
Under the hood
mormot.core.log
055df2b4+4-29
core: let DWARF decoding use the new TFastReader.VarLeb64 method
Impact
Stack-trace line mapping keeps its behavior while malformed or truncated DWARF data follows the core reader's validation path. No application API changes are introduced.
Units
27
Low
Service registration is explicitly limited to startup
Comments on TRest.Services, ServiceContainer and client/server ServiceRegister and ServiceDefine overloads now state that registration is not thread-safe and belongs at startup. TRest.ServicesInfo also releases fStatSafe in a finally block.
Docs
mormot.rest.client+2
13e0ec2c+24-4
rest: documentation that Services registration is not thread-safe and should be done at startup
Impact
Application behavior does not otherwise change, but teams should not mutate the service registry after worker threads begin. ServicesInfo now cannot leave its statistics lock held if AsSoa raises.