mORMot2 DailyDaily read of upstream commits

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.

Build2.4.17841 → 2.4.17856
Commits15
Lines+178 -78
Read4 min

11 of 11 entries · 15 commits upstream

Stories
# Entry Category Units
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.

Public API

  • TSynLocker.IsLockedsignature-changed — The Boolean property backed by GetIsLocked becomes a parameterless method with direct atomic checks.

Arnaud Bouchez · 12:46 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 12:56 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 10:59 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 11:12 UTC · view the commit on GitHub →

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.

Public API

  • TPdfCanvas integer-coordinate methodsbehaviour-changed — Fresh canvases now use an identity mapping instead of producing NaN before metafile initialization.

Ian Branch · 00:45 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 11:22 UTC · PR #675 · view the commit on GitHub →

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.

Public API

  • SQLITE_DBCONFIG_STMT_SCANSTATUSadded — Adds the SQLite db_config selector value 1018 for controlling statement scan-status collection.

Arnaud Bouchez · 13:22 UTC · PR #705 · view the commit on GitHub →

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.

Paul McGee · 11:14 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 11:35 UTC · view the commit on GitHub →

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.

Sven Harazim · 07:46 UTC · view the commit on GitHub →

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.

Arnaud Bouchez · 13:33 UTC · view the commit on GitHub →

Upstream activity commits per day · last 60 days
Commits1007
Active days49/60
Busiest2026-09-30
Peak60
2026-09-30: 60 commits2026-10-01: 26 commits2026-10-02: 30 commits2026-10-03: 32 commits2026-10-04: 15 commits2026-10-05: 1 commit2026-10-06: 26 commits2026-10-07: 37 commits2026-10-08: 27 commits2026-10-09: 35 commits2026-10-10: 12 commits2026-10-11: 2 commits2026-10-12: 40 commits2026-10-13: 31 commits2026-10-14: 23 commits2026-10-15: 16 commits2026-10-16: 27 commits2026-10-17: 0 commits2026-10-18: 0 commits2026-10-19: 0 commits2026-10-20: 0 commits2026-10-21: 0 commits2026-10-22: 3 commits2026-10-23: 6 commits2026-10-24: 29 commits2026-10-25: 7 commits2026-10-26: 25 commits2026-10-27: 4 commits2026-10-28: 8 commits2026-10-29: 17 commits2026-10-30: 20 commits2026-10-31: 0 commits2026-11-01: 0 commits2026-11-02: 16 commits2026-11-03: 32 commits2026-11-04: 15 commits2026-11-05: 32 commits2026-11-06: 26 commits2026-11-07: 19 commits2026-11-08: 2 commits2026-11-09: 29 commits2026-11-10: 17 commits2026-11-11: 8 commits2026-11-12: 38 commits2026-11-13: 39 commits2026-11-14: 9 commits2026-11-15: 6 commits2026-11-16: 21 commits2026-11-17: 30 commits2026-11-18: 37 commits2026-11-19: 28 commits2026-11-20: 31 commits2026-11-21: 0 commits2026-11-22: 0 commits2026-11-23: 1 commit2026-11-24: 6 commits2026-11-25: 3 commits2026-11-26: 3 commits2026-11-27: 0 commits2026-11-28: 0 commits
2026-09-302026-11-28