Worth a looka fix or feature you may want
ARM lock hardening, SQLite speed and Delphi Win64 stability
This edition closes several platform-specific faults: ARM and AArch64 lock state is read and updated atomically, old Delphi Win64 no longer enters SynLZ with an undefined register, and mORMot's static SQLite engine disables costly statement profiling by default. A fresh PDF canvas also starts with a valid identity mapping, ORM JSON honors woStoreClassName, and the LIBCURLMULTI entry table compiles again.
TL;DR
- ARM and AArch64 users should take the complete three-commit lock sequence through build 2.4.17850.
- Static SQLite reads recover their normal speed because DBOpen disables SQLITE_DBCONFIG_STMT_SCANSTATUS collection.
- Old Delphi Win64 SynLZ decompression no longer risks a GPF from CountTrailingZeros32 reading the wrong register.
- Fresh PDF canvases now emit finite integer coordinates before any metafile establishes a mapping.
- Builds using LIBCURLMULTI and CURL_ENTRIES compile again after the conditional entry-list comma is fixed.
Upgrade advice
Land on 3d613744132451978d296997aea3907dbc2c66e3, build 2.4.17856. ARM/AArch64 services should stress lock contention; old Delphi Win64 applications should rerun SynLZ decompression; static SQLite users should benchmark representative reads; and PDF users should regenerate documents that call MoveToI, LineToI or BoxI before metafile rendering. The raw payload records no superseded_by revisions.
11 of 11 entries · 15 commits upstream
1
High
TSynLocker completes the ARM-safe lock-state rewrite
TSynLocker changes fLockCount to Cardinal, updates it through LockedInc32 and LockedDec32 and checks it with LockedExc32. IsLocked becomes a method, while TOSLock.LockAndInitIfNeeded always serializes the initialization check through OSSafe.
Fixes
mormot.core.os
de33ae02+18-23
core: another pass on locks for ARM32/64
Impact
ARM32 and AArch64 no longer rely on non-atomic TSynLocker counter reads or writes, and lazy critical-section initialization has a single synchronization path. Intel behavior remains compatible; parameterless IsLocked calls retain the same Boolean intent in Delphi and FPC source.
Upgrade recommended
Take this final lock pass or a later build on ARM/AArch64 and stress shared, read-write and re-entrant lock paths under contention.
Public API
TSynLocker.IsLockedsignature-changed — The Boolean property backed by GetIsLocked becomes a parameterless method with direct atomic checks.
Units
2
High
Old Delphi Win64 passes CountTrailingZeros32 its real argument
The Win64 assembly implementation of CountTrailingZeros32 now moves its c argument into EAX before executing BSF. This helper is used internally by SynLZdecompress1pas when HASBITINTRINSICS is unavailable.
Fixes
mormot.core.base
3a84c4a8+3-2
core: fixed GPF in SynLZ on oldest Delphi Win64
Impact
SynLZ decompression on the oldest supported Delphi Win64 compilers no longer scans an undefined EAX value and triggers a general protection fault. Modern Delphi builds with bit intrinsics and FPC backends do not use this fallback path.
Upgrade recommended
Upgrade old Delphi Win64 applications that decompress SynLZ data and rerun archived and malformed-input samples.
Units
3
Medium
TMultiLightLock acquisition becomes atomic on ARM
TMultiLightLock.TryLock removes the preliminary Flags read on non-Intel targets and relies on LockedExc32 for acquisition. WaitUnlocked now calls IsLocked, while re-entrant ownership still uses LockedThreadID.
Fixes
mormot.core.os
d070b0e8+18-16
core: fixed TMultiLightLock on ARM
Impact
ARM32 and AArch64 no longer make a lock decision from a non-atomic preliminary flag read. Delphi and FPC Intel paths retain the guarded fast check; later commits in this edition complete the wider lock-state hardening.
Units
4
Medium
ARM write-lock waits use atomic flag comparisons
TRWLightLock.WriteLockSpin and TRWLock.WriteLock keep the direct Intel flag reads but use LockedExc32 or LockedExc as atomic no-op comparisons on other CPUs. TSynLocker delegates its read-write state check to TRWLock.IsLocked.
Fixes
mormot.core.os
552446d9+14-5
core: other fixes for locks on ARM/AARCH64
Impact
ARM and AArch64 writers wait on coherent reader counts instead of racing plain loads; Intel keeps its existing fast path. This is an intermediate lock-hardening commit completed later in the same edition by de33ae02.
Units
5
Medium
Fresh PDF canvases no longer emit NaN integer coordinates
TPdfCanvas.Create initializes fWinSize, fViewSize and fWorldFactorX/Y to one, establishing the identity mapping expected by MM_TEXT before any metafile changes those values.
Fixes
mormot.ui.pdf
869305c6+7-0
ui: pdf - fixed TPdfCanvas integer coordinate methods before any metafile rendering
Impact
MoveToI, LineToI, BoxI and other integer-coordinate methods on a fresh canvas no longer divide zero by zero and write NaN into the PDF stream. The correction applies equally to Delphi and FPC renderers without changing method signatures.
Upgrade recommended
Upgrade PDF generators using integer-coordinate methods before metafile rendering, then regenerate and inspect affected documents for NaN coordinates.
Public API
TPdfCanvas integer-coordinate methodsbehaviour-changed — Fresh canvases now use an identity mapping instead of producing NaN before metafile initialization.
Units
6
Medium
ORM JSON now honors woStoreClassName
TOrm.RttiJsonWrite writes a ClassName property immediately after opening the JSON object when woStoreClassName is present, matching the behavior of the generic RTTI JSON writer.
Fixes
mormot.orm.core
bda1daf8+4-2
orm: fixed #675
Impact
Delphi and FPC callers that explicitly request class metadata for TOrm instances now receive the missing ClassName member. Consumers with strict JSON schemas should allow that field when the option is enabled; output without the option is unchanged.
Worth a look
If woStoreClassName is enabled, update strict JSON snapshots or schemas to include ClassName and verify polymorphic deserialization.
Public API
TOrm.RttiJsonWritebehaviour-changed — With woStoreClassName, serialized ORM objects now include ClassName.
Units
7
Medium
Static SQLite stops profiling every VDBE opcode by default
TSqlDataBase.DBOpen calls sqlite3.db_config with SQLITE_DBCONFIG_STMT_SCANSTATUS set to zero when the function is available. The new public constant documents how callers may explicitly re-enable scan statistics for statement profiling.
Performance
mormot.db.raw.sqlite3
311060f4+20-2
db: fixed #705 SQLite3 static engine slow down
Impact
mORMot's static SQLite build no longer pays two RDTSC reads per VDBE opcode during normal queries; the source comment reports read queries had become two to five times slower. Older or dynamic engines that ignore the option remain compatible on Delphi and FPC.
Upgrade recommended
Upgrade static-SQLite deployments and compare representative read latency before and after; explicitly re-enable SQLITE_DBCONFIG_STMT_SCANSTATUS only for profiling sessions.
Public API
SQLITE_DBCONFIG_STMT_SCANSTATUSadded — Adds the SQLite db_config selector value 1018 for controlling statement scan-status collection.
8
Medium
LIBCURLMULTI no longer leaves a doubled entry-list comma
The conditional before multi_add_handle no longer emits its own comma because the preceding '?mime_type' entry already supplies one. This removes the empty expression from CURL_ENTRIES when LIBCURLMULTI is defined.
Compiler & platform
mormot.lib.curl
e6c8e014+1-1
lib: fixed CURL_ENTRIES compilation with LIBCURLMULTI defined
Impact
Delphi builds using the static CURL_ENTRIES table together with LIBCURLMULTI no longer fail with E2029 at compile time. Runtime libcurl behavior and FPC builds that did not hit the syntax error are unchanged.
Upgrade recommended
Update builds that define LIBCURLMULTI and compile mormot.lib.curl with the static entry table, then rebuild all target compilers.
Units
9
Low
External-database regression rows keep their interface alive
TTestExternalDatabase.BatchFromOtherThread stores query results in a local ISqlDBRows variable and clears it before freeing the external storage. The batch and DuckDB cases are also moved to background Run calls.
Tests
24ca8879+18-18
tests: fixed TTestExternalDatabase
Impact
The regression suite avoids a random GPF caused by an interface outliving its connection context and runs slow database checks concurrently. No application API or production Delphi/FPC behavior changes.
10
Low
PDF tests cover integer drawing before metafile setup
A regression test creates a fresh A4 document, calls MoveToI(100,100), LineToI(200,300) and Stroke, then checks the expected MM_TEXT coordinates and rejects any NaN in the saved PDF.
Tests
5c239213+27-0
test: ui pdf - the integer coordinate methods before any metafile
Impact
There is no application or public API change. The test confirms the related constructor fix on Delphi 7, Delphi 13 Win32/Win64, FPC 3.3.1 and FPC 3.2.2 Win64 according to the commit message.
11
Low
LEB128 malformed-input tests coexist with attached debuggers
TTestCoreBase.Integers now runs valid LEB128 vectors even when a debugger is attached. Only the three expected-exception vectors are skipped in that case; normal runs temporarily suppress exception logging around those vectors.
Tests
3d613744+12-7
tests: refined LEB128 encoding coverage
Impact
Application behavior, public APIs and Delphi/FPC backends are unchanged. The core test suite retains useful encoding coverage during interactive debugging without producing expected exception noise.