Skip to content

Fix pthread stack alignment for SQLite sorter temps#784

Open
brandonpayton wants to merge 1 commit into
mainfrom
gascity/kd-cfo/kd-c5i.10-sqlite-node-sort-open-db
Open

Fix pthread stack alignment for SQLite sorter temps#784
brandonpayton wants to merge 1 commit into
mainfrom
gascity/kd-cfo/kd-c5i.10-sqlite-node-sort-open-db

Conversation

@brandonpayton

Copy link
Copy Markdown
Member

Summary

  • Align wasm pthread clone stack pointers to 16 bytes before kernel_clone, fixing pthread varargs corruption that produced malformed SQLite sorter temp filenames.
  • Patch staged SQLite test/testrunner.tcl in both Node and browser paths so nested config jobs inherit Kandelo's platform shim.
  • Add a local Sortix pthread regression for snprintf("%s/etilqs_%llx%c", ...) from a pthread.

Audit Result

Focused SQLite upstream Tcl sort/sort2 inventory on Node:

  • Baseline: 19 jobs, 2 pass, 17 fail, 0 skip.
  • Final composite: 19 jobs, 19 pass, 0 fail, 0 skip; 1335 cases, 0 errors.

Primary artifacts are recorded on bead kd-c5i.10; final report:
/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-c5i.10-sqlite-node-sort-open-db/test-runs/kd-c5i.10-final-report/20260627T210611Z/final-report.md

Validation

  • bash -n scripts/run-sqlite-official-tests.sh
  • bash -n scripts/run-browser-sqlite-official-tests.sh
  • bash scripts/dev-shell.sh bash scripts/build-musl.sh
  • bash scripts/dev-shell.sh bash packages/registry/sqlite/build-testfixture.sh
  • Focused SQLite post-fix composite: 19 pass, 0 fail, 0 skip.
  • Node Sortix regression: 1 pass, 0 fail, 0 skip.
  • Browser Sortix regression: 1 pass, 0 fail, 0 skip.
  • bash scripts/dev-shell.sh cargo test -p kandelo --target aarch64-apple-darwin --lib: 959 pass, 0 fail.
  • scripts/run-libc-tests.sh after materializing the recorded libc-test submodule tree: 303 pass, 0 fail, 20 XFAIL.
  • scripts/run-posix-tests.sh: 174 pass, 0 fail, 3 XFAIL, 2 skip.
  • bash scripts/dev-shell.sh bash scripts/check-abi-version.sh: passed.
  • cd host && npx vitest run --exclude test/wasm64.test.ts: 727 pass, 0 fail, 127 skip.

Exact cd host && npx vitest run in this worktree fails only because programs/wasm64/hello64.wasm is unavailable; tracked separately as bead kd-c5i.10.1.

Align wasm pthread clone stacks to 16 bytes before kernel_clone so stack-based variadic calls made from pthreads read 64-bit arguments correctly. This fixes SQLite sorter temp-name corruption in sort/sort2 tests.

Also install the Kandelo SQLite testrunner platform shim into the staged upstream testrunner so nested config jobs inherit it, including the browser demo path, and add a Sortix pthread snprintf regression for the SQLite temp-name format.
@github-actions

Copy link
Copy Markdown

Phase B-1 matrix build status — pr-784-staging

ABI v15. 66 built, 1 failed, 67 total.

Package Arch Status Sha
libcurl wasm32 built 156639e0
libcxx wasm32 built d980e270
libcxx wasm64 built 4f19b379
libpng wasm32 built 03516c79
libxml2 wasm32 built 932395ce
libxml2 wasm64 built c603fc29
openssl wasm32 built 25107c7c
openssl wasm64 built 0186a933
sqlite wasm32 built d11f3fed
sqlite wasm64 built b27a2b88
zlib wasm32 built c44ba717
zlib wasm64 built 013d4033
bc wasm32 built 8aba63eb
bzip2 wasm32 built fa77b7e9
coreutils wasm32 built 1eb2c432
curl wasm32 built a87ea7a9
dash wasm32 built 18b6701e
diffutils wasm32 built 4ddbd318
dinit wasm32 built b21d4d0c
fbdoom wasm32 built bc580caf
file wasm32 built e7e696ab
findutils wasm32 built 08c2994f
gawk wasm32 built ed9efd8a
git wasm32 built 7fc012d7
grep wasm32 built 76f366bc
gzip wasm32 built 35daa131
kandelo-sdk wasm32 built aff48a87
kernel wasm32 built 165be564
less wasm32 built a8ab3002
lsof wasm32 built ea06f688
m4 wasm32 built 8e040534
make wasm32 built b664393e
mariadb wasm32 built 5dc76152
mariadb wasm64 built 675adf78
modeset wasm32 built 55622395
msmtpd wasm32 built 6b010700
nano wasm32 built 9e06634d
ncurses wasm32 built 93d74b21
netcat wasm32 built 0c3fd98d
nginx wasm32 built d818d039
php wasm32 built 49e4f38f
posix-utils-lite wasm32 built 5b74fc95
sed wasm32 built 22bf565e
spidermonkey wasm32 built 98ca933b
tar wasm32 built b1b49227
tcl wasm32 built b6749d69
unzip wasm32 built 37e3c0f4
userspace wasm32 built c50ec01a
vim wasm32 built 805d174b
wget wasm32 built 46f4e50f
xz wasm32 built 750664a1
zip wasm32 built 1f215bd1
zstd wasm32 built 1e338c2b
bash wasm32 built a271d90e
mariadb-test wasm32 built 38b562e0
mariadb-vfs wasm32 built 6af6377b
mariadb-vfs wasm64 built 939e36ff
nethack wasm32 built 6f7f6870
node wasm32 built 3f01f369
spidermonkey-node wasm32 built 8a0ff0f9
vim-browser-bundle wasm32 built a6a2d75f
nethack-browser-bundle wasm32 built 3d594ced
rootfs wasm32 built be89d8e7
shell wasm32 built 5b9bc762
lamp wasm32 built 3d04546d
node-vfs wasm32 failed
wordpress wasm32 built 29f1aa7f

Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.

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