mORMot2 DailyDaily read of upstream commits

Shutdown races and forged ZIP inputs are blocked

This edition fixes a concurrent shutdown race in TSynBackgroundThreadMethodAbstract and adds two layers of ZIP bounds and decompression-size hardening. It also introduces relational CSV and Markdown exports, CSV input, stricter preprocessing and the reusable JOP processor. Android, old FPC Windows and POSIX enumeration receive targeted fixes.

TL;DR

  • Take both TSynBackgroundThreadMethodAbstract commits; the later one completes paused-worker shutdown.
  • ZIP parsing rejects forged offsets and stops decompression before output exceeds the declared maximum.
  • mormot.tools.jop converts JSON dialects, XML, YAML, CSV, Markdown and text with preprocessing and batches.
  • Relational exporters and CsvToJson add native structured-data interchange to mormot.core.fmt.

Upgrade advice

Land on the complete 2.4.18231 edition. Do not stop at the first shutdown-race commit: the later stability fix is required for paused workers. Prioritize this batch for untrusted ZIP input, concurrent RunAndWait use, or Delphi Android NativeActivity; review the new fenced-CSV Markdown default before adopting table exports.

Build2.4.18198 → 2.4.18231
Commits31
Lines+9082 -590
Read4 min

29 of 29 entries · 31 commits upstream

Stories
# Entry Category Units
1 High ZIP decompression enforces declared output limits TSynZipDecompressor takes QWord MaxSize; TZLib.DoFlush checks the next chunk before writing, and TZipRead tightens forged descriptor validation. Security mormot.core.zip+1 3eae4136+50-30

core: hardened against forged .zip content

Impact

Untrusted archives stop before output exceeds the declared maximum, reducing forged-size and decompression-bomb exposure.

Public API

  • TSynZipDecompressor.Createsignature-changed
  • LIBDEFLATE_MAXSIZEadded

Arnaud Bouchez · 15:01 UTC · view the commit on GitHub →

2 High ZIP local headers are bounded by the central directory TZipRead.Create rejects local offsets in the central directory and verifies a complete TLocalFileHeader fits before storing a pointer. Security mormot.core.zip 3f75595e+9-2

core: another .zip decompression hardening

Impact

Forged or truncated archives fail during parsing instead of creating an out-of-bounds pointer.

Public API

  • TZipRead.Createbehaviour-changed

Arnaud Bouchez · 15:14 UTC · view the commit on GitHub →

3 High Worker destruction rejects new callers without racing active ones fStopping and fRunAndWaitCount are protected by fPendingProcessLock; Destroy waits for registered callers and joins before freeing fCallerEvent. Fixes mormot.core.threads 2f29bd8d+76-39

core: fixed TSynBackgroundThreadMethodAbstract shutdown race

Impact

The fix prevents shutdown use-after-free, but the later paused-worker follow-up is also required.

Worth a look

Public API

  • TSynBackgroundThreadMethodAbstract.RunAndWaitbehaviour-changed
  • TSynBackgroundThreadMethodAbstract.Destroybehaviour-changed

Arnaud Bouchez · 15:57 UTC · view the commit on GitHub →

4 High Paused background work resumes before destruction waits TSynBackgroundThreadMethodAbstract.Destroy calls SetExecuteLoopPause(false) under its state lock so an accepted request can finish. Fixes mormot.core.threads 4023044b+3-2

core: small stability fix in TSynBackgroundThreadMethodAbstract.Destroy

Impact

This closes the remaining hang after the preceding shutdown-race fix; take both commits together.

Public API

  • TSynBackgroundThreadMethodAbstract.Destroybehaviour-changed

Arnaud Bouchez · 16:04 UTC · view the commit on GitHub →

5 High Android startup no longer indexes an empty ParamUtf8 InitializeProcessInfo creates ParamUtf8[0] before assignment when a Delphi Android NativeActivity supplies no argv. Fixes mormot.core.os c0675eb1+2-0

core: fixed AV in InitializeProcessInfo when ParamUtf8[] is empty

Impact

Delphi Android NativeActivity applications avoid an access violation during startup; desktop and FPC paths are unchanged.

Public API

  • InitializeProcessInfobehaviour-changed

Dimitris Kounalakis · 09:05 UTC · view the commit on GitHub →

6 Medium Reusable JOP code settles under mormot.tools.jop The temporary jop.main identity becomes mormot.tools.jop, containing the final JSON, XML, YAML, CSV, Markdown and text API. Fixes mormot.tools.jop 84466e25+174-106

tools: include the proper mormot.tools.jop.pas unit

Impact

Applications should use mormot.tools.jop; earlier same-day unit names were not settled.

Worth a look

Public API

  • mormot.tools.jopadded

Arnaud Bouchez · 21:22 UTC · view the commit on GitHub →

7 Medium JOP rejects empty includes and joins the main tests TPreproc.DoInclude reports empty or unreadable files, validates included text on request and updates include statistics; JOP tests enter mormot2tests. Fixes mormot.core.fmt+1 81d46b7f+26-12

tools: fixed JOP process

Impact

Strict preprocessing no longer treats an empty include as success; intentional empty includes need adjustment.

Worth a look

Public API

  • TPreproc.DoIncludebehaviour-changed

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

8 Medium JSON reformatting closes comments and implicit roots correctly EOF terminates // comments; trailing commas are only emitted in containers, and synthetic Hjson roots are tracked before closing. Fixes mormot.core.json 57db08f1+19-3

core: refined JSON parsing/reformatting edge cases

Impact

JSON-family reformatting avoids stray commas or braces and rejects malformed implicit objects.

Public API

  • TJsonWriter.AddJsonReformatbehaviour-changed

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

9 Medium POSIX FileNames matches FindFiles folder sorting With ffoSortByName and ffoIncludeFolder, POSIX FileNames now uses FindFiles and its shared sorting path. Fixes mormot.core.search 497bacab+11-4

core: fixed FileNames/FindFiles inconsistency on POSIX

Impact

File and folder enumeration now has consistent ordering; review code that relied on the old accidental order.

Worth a look

Public API

  • FileNamesbehaviour-changed
  • FindFilesbehaviour-changed

Arnaud Bouchez · 14:01 UTC · view the commit on GitHub →

10 Medium A new JOP utility converts structured files The jop CLI and reusable layer provide convert, batch, generate and compare for JSON dialects, YAML, CSV, Markdown and text with definitions, includes and atomic replacement. New features mormot.tools.jop 865336f8+2716-13

tools: introducing the `jop` command line tool

Impact

Projects gain a native conversion API; callers must pass private writable RawUtf8 because processing may decode in place.

Worth a look

Public API

  • TJopFormatadded
  • TJopOptionsadded
  • TJopErroradded
  • JopProcessadded
  • JopProcessFileadded
  • JopProcessFilesadded
  • JopGenerateadded
  • JopCompareFilesadded

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

11 Medium JSON and TDocVariant flatten into linked tables mormot.core.fmt adds table options, schemas, rows, callbacks and Variant/JSON export to tables, Markdown and CSV; nested arrays use __parentid. New features mormot.core.fmt+1 482a8028+1118-2

core: introducing Relational Markdown and CSV Tables from JSON

Impact

Services can export structured data without a custom flattener; callbacks must copy retained row data.

Worth a look

Public API

  • TTableOptionadded
  • TTableResultadded
  • TTableInfoadded
  • TTableRowadded
  • TOnTableWriteadded
  • VariantToTablesadded
  • JsonToTablesadded
  • VariantToMdadded
  • JsonToMdadded
  • VariantToCsvadded
  • JsonToCsvadded
  • TTextPairadded
  • TTextPairsadded

Arnaud Bouchez · 08:24 UTC · view the commit on GitHub →

12 Medium Relational exports add fenced CSV and pipe tables TTableTextFormat adds ttfCsv, ttfMarkdownCsv and ttfMarkdownPipe; VariantToMd and JsonToMd gain optional Format and stronger failure handling. New features mormot.core.fmt 825d322e+394-77

core: enhanced table export routines and tests

Impact

Calls stay source-compatible, but default Markdown becomes fenced CSV; request ttfMarkdownPipe for the former pipe layout.

Worth a look

Public API

  • TTableTextFormatadded
  • VariantToMdsignature-changed
  • JsonToMdsignature-changed
  • VariantToMdbehaviour-changed
  • JsonToMdbehaviour-changed

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

13 Medium The preprocessor gains writer APIs and strict policies mormot.core.fmt adds TPreprocSettings, TPreprocStatistics, EPreprocException, JsonPreprocessToWriter and TextPreprocessToWriter plus flags for includes, UTF-8 and comments. New features mormot.core.fmt 7bf3aa62+382-45

core: enhanced pure text pre-processor

Impact

Backends can stream preprocessing and enforce strict include policy; existing entry points keep their defaults.

Worth a look

Public API

  • TPreprocSettingsadded
  • TPreprocStatisticsadded
  • EPreprocExceptionadded
  • JsonPreprocessToWriteradded
  • TextPreprocessToWriteradded

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

14 Medium JOP converts XML through native Variant mapping JOP adds jfXml input/output, .xml inference, @attribute/#text mapping, explicit preprocessing and XML errors. New features mormot.tools.jop 6f3901c6+295-22

tools: added XMl support to the JOP tool

Impact

Delphi and FPC tools can convert XML natively; output needs one valid root and input scalars remain strings.

Worth a look

Public API

  • TJopFormat.jfXmladded
  • TJopError.jeInvalidXmladded

Arnaud Bouchez · 16:06 UTC · view the commit on GitHub →

15 Medium CSV input converts to JSON string objects mormot.core.fmt adds TCsvError, CSV_ERROR and CsvToJson overloads with strict headers, quoting and row-width checks. New features mormot.core.fmt adcbb270+217-2

core: new CSV Input to JSON conversion functions

Impact

Services can parse headered CSV natively; all cells remain strings, preserving leading zeros and empty values.

Worth a look

Public API

  • TCsvErroradded
  • CSV_ERRORadded
  • CsvToJsonadded

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

16 Medium ReplaceFile atomically replaces an existing destination mormot.core.os adds ReplaceFile using MoveFileExW on Windows and rename on POSIX. New features mormot.core.os c7feb281+24-2

core: new ReplaceFile() atomic function

Impact

Applications can publish a completed temporary file without a delete-then-rename gap; empty paths return false.

Worth a look

Public API

  • ReplaceFileadded

Arnaud Bouchez · 09:40 UTC · view the commit on GitHub →

17 Medium Socket.IO Open factories accept an after-open callback Both TSocketsIOClient.Open overloads add optional aOnAfterOpen and assign it before connecting. New features mormot.net.ws.client dc82ac5b+11-9

net: new OnClientOpen callback parameter for TSocketsIOClient.Open()

Impact

Existing calls remain compatible; clients can install initialization without manual construction.

Worth a look

Public API

  • TSocketsIOClient.Opensignature-changed

Arnaud Bouchez · 15:08 UTC · view the commit on GitHub →

18 Medium ReplaceFile compiles with old FPC Windows headers Windows code defines MOVEFILE_REPLACE_EXISTING and MOVEFILE_WRITE_THROUGH when old FPC headers omit them. Compiler & platform mormot.core.os 707b434b+6-2

core: fixed ReplaceFile() compilation on oldest FPC

Impact

Old FPC Windows builds using ReplaceFile compile again; Delphi and current FPC are unchanged.

Arnaud Bouchez · 14:36 UTC · view the commit on GitHub →

19 Low JOP initializes its random seed before parsing options The CLI initializes seed before generate option parsing and rewrites help text with shared CRLF constants. Fixes d7481eed+15-15

tools: minor tweaks to JOP

Impact

No framework API impact; unseeded generation always has an initialized random default.

Arnaud Bouchez · 17:34 UTC · view the commit on GitHub →

20 Low JOP accepts md-pipe and randomizes its default seed The md-pipe alias is documented, generation uses Random32 without --seed, and the Lazarus project points at mormot.tools.jop. Fixes mormot.tools.jop 0f821401+11-6

tools: some JOP tool fixes and enhancements

Impact

No migration is required; unseeded generated documents are intentionally non-reproducible.

Arnaud Bouchez · 14:02 UTC · view the commit on GitHub →

21 Low YAML number detection follows YAML 1.2 forms Public IsYamlNumber recognizes signed decimal, hexadecimal and octal forms and guides YAML string quoting. New features mormot.core.fmt 56768e58+44-3

core: new IsYamlNumber() efficient function

Impact

YAML output better preserves numeric-looking strings; applications may call IsYamlNumber directly.

Worth a look

Public API

  • IsYamlNumberadded

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

22 Low DuckDB literals use shorter writer calls DuckDB parameter emission replaces repeated TJsonWriter calls with AddDirect, AddShorter and AddNull. Performance mormot.db.sql.duckdb 2b5517e2+7-9

db: minor DuckDB optimization

Impact

SQL output remains equivalent; allocation and call overhead may fall slightly.

Arnaud Bouchez · 14:01 UTC · view the commit on GitHub →

23 Low Table export internals reduce allocations mormot.core.fmt refactors table names, scalar types, schema cleanup and failures with direct buffers and pointer iteration. Under the hood mormot.core.fmt 2b7ed25f+73-58

core: relational table exporters refactoring

Impact

No intended public behavior change; exporters should allocate less.

Arnaud Bouchez · 08:53 UTC · view the commit on GitHub →

24 Low JOP gains a dedicated regression unit test.core.fmt adds TTestCoreJop coverage for formats, definitions, includes, writers, files, batches, generation and comparison. Tests 5bb8bba8+1300-2

test: introducing test.core.fmt.pas new unit

Impact

No direct application impact; the new JOP surface gains broad coverage.

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

25 Low Relational exporters receive broad regression coverage Over one thousand test lines cover schemas, nested arrays, strict modes, callbacks, Markdown, CSV, escaping and failure cleanup. Tests f93ee480+1016-2

test: cover mormot.core.fmt relational table exporters

Impact

No direct application impact; the new table API gains substantial coverage.

Arnaud Bouchez · 08:53 UTC · view the commit on GitHub →

26 Low Format tests avoid a Windows filename edge case test.core.fmt changes temporary names and assertions around a Windows-specific filename behavior. Tests 41d36bd3+13-9

test: circumvent weird Windows file name behavior

Impact

No application impact; only test portability changes.

Arnaud Bouchez · 14:27 UTC · view the commit on GitHub →

27 Low JOP tests align with current processing behavior TTestCoreJop updates expectations and fixtures after the processing changes; production units are untouched. Tests 7dfce00f+6-9

tests: some TTestCoreJop fixes

Impact

No application impact; this repairs regression coverage.

Arnaud Bouchez · 14:03 UTC · view the commit on GitHub →

28 Low The main test program includes the new format tests mormot2tests.dpr adds test.core.fmt to its uses list so the split format tests compile and run. Tests 883701d6+3-2

test: fixed mormot2tests compilation

Impact

No application impact; this only restores test-suite coverage.

Arnaud Bouchez · 21:26 UTC · view the commit on GitHub →

29 Low Ten shell demos document JOP workflows Ten runnable demos cover generation, JSON dialects, XML, preprocessing, CSV, Markdown, batches and errors. Docs f31eabde+821-7

tools: added 10 demo .sh scripts

Impact

No backend impact; the files are examples and verification helpers.

Arnaud Bouchez · 18:42 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