Act nowcan affect a running systemMerge commits and version include bookkeeping are excluded. The raw payload has no superseded_by links, so landing advice uses the completed same-day sequence and final build.
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.
29 of 29 entries · 31 commits upstream
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.
Upgrade recommended
Upgrade archive extraction and test that declared-size violations abort before excess output reaches the destination stream.
Public API
TSynZipDecompressor.Createsignature-changedLIBDEFLATE_MAXSIZEadded
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.
Upgrade recommended
Upgrade ZIP readers and add forged local-offset and truncated-header cases to archive ingestion tests.
Public API
TZipRead.Createbehaviour-changed
Units
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-changedTSynBackgroundThreadMethodAbstract.Destroybehaviour-changed
Units
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.
Upgrade recommended
Upgrade through 4023044b20652cd20e0be54e366cf05e31422d49 or later and test destroying a worker while SetExecuteLoopPause(true) is active.
Public API
TSynBackgroundThreadMethodAbstract.Destroybehaviour-changed
Units
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.
Upgrade recommended
Delphi Android NativeActivity builds should upgrade and verify startup when the platform provides no argv entries.
Public API
InitializeProcessInfobehaviour-changed
Units
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
Units
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
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.
Upgrade recommended
Upgrade and rerun JSONC, JSON5 and Hjson cases containing EOF comments, top-level scalars and malformed implicit objects.
Public API
TJsonWriter.AddJsonReformatbehaviour-changed
Units
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-changedFindFilesbehaviour-changed
Units
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
TJopFormataddedTJopOptionsaddedTJopErroraddedJopProcessaddedJopProcessFileaddedJopProcessFilesaddedJopGenerateaddedJopCompareFilesadded
Units
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
TTableOptionaddedTTableResultaddedTTableInfoaddedTTableRowaddedTOnTableWriteaddedVariantToTablesaddedJsonToTablesaddedVariantToMdaddedJsonToMdaddedVariantToCsvaddedJsonToCsvaddedTTextPairaddedTTextPairsadded
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
TTableTextFormataddedVariantToMdsignature-changedJsonToMdsignature-changedVariantToMdbehaviour-changedJsonToMdbehaviour-changed
Units
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
TPreprocSettingsaddedTPreprocStatisticsaddedEPreprocExceptionaddedJsonPreprocessToWriteraddedTextPreprocessToWriteradded
Units
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.jfXmladdedTJopError.jeInvalidXmladded
Units
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
TCsvErroraddedCSV_ERRORaddedCsvToJsonadded
Units
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
Units
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
Units
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.
Upgrade recommended
Old-FPC Windows users should take this commit together with ReplaceFile and rebuild the affected target.
Units
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.
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.
Units
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
Units
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.
Units
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.
Units
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.
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.
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.
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.
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.
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.