Skip to content

fix(store): drop the SQLite page-cache slab that faults on arm64 - #1274

Merged
DeusData merged 1 commit into
mainfrom
fix/arm64-pagecache-alignment
Jul 26, 2026
Merged

fix(store): drop the SQLite page-cache slab that faults on arm64#1274
DeusData merged 1 commit into
mainfrom
fix/arm64-pagecache-alignment

Conversation

@DeusData

Copy link
Copy Markdown
Owner

The slab was a static char array handed to SQLITE_CONFIG_PAGECACHE. A static char array carries no alignment guarantee and SQLite requires 8-byte-aligned page-cache memory: x86_64 tolerates the unaligned access, arm64 faults.

Every suite that opens a store died instantly on windows-11-arm with STATUS_ILLEGAL_INSTRUCTION (pass=0 secs=0) while pure-logic suites in the same wave passed. Both arm64 shards were green on the commit before the merge that introduced it.

It was also never the fix it was added for: measurement showed the slab installed correctly (config_failed=0) and #581's growth unchanged, because the cause was thread heaps never being released. Removing rather than aligning it — an unverified optimisation has no claim on a release gate.

Note PR CI does not build the windows-11-arm leg, so this defect class can only surface in the Dry Run.

The slab was a static char array handed to SQLITE_CONFIG_PAGECACHE. A static
char array carries no alignment guarantee and SQLite requires 8-byte-aligned
page-cache memory: x86_64 tolerates the unaligned access, arm64 faults. Every
suite that opens a store died instantly on windows-11-arm with
STATUS_ILLEGAL_INSTRUCTION (pass=0, secs=0) while pure-logic suites in the same
wave passed, and both arm64 shards were green on the commit before the merge.

It was also never the fix it was added for: measurement showed the slab
installed correctly and #581's growth unchanged, because the cause was thread
heaps never being released. Removing it rather than aligning it -- an unverified
optimisation has no claim on a release gate.

Note PR CI does not build the windows-11-arm leg, so this class of defect can
only surface in the dry run.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData
DeusData merged commit 00495a7 into main Jul 26, 2026
11 checks passed
timothybrush pushed a commit to timothybrush/codebase-memory-mcp that referenced this pull request Jul 26, 2026
This reverts commit f843db8, which removed the DeusData#581 fix on a false
attribution. The arm64 shards were crashing because of an unaligned SQLite
page-cache slab (fixed in DeusData#1274, arm64 shard 2/2 green since); removing this
callback never changed those crashes, which is what exonerated it. The Windows
soak then failed for the obvious reason: the leak was back.

Static MinGW links have no DllMain and register no TLS callback, so
mi_thread_done never runs and every thread leaks its heap -- 607 heaps after 300
requests holding 170 MiB against a ~300 KiB live set. With the callback the
10-minute Windows soak measured 1.1x against the original 53x.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant