libc: align wasm32 pthread entry stacks#784
Closed
brandonpayton wants to merge 1 commit into
Closed
Conversation
Phase B-1 matrix build status —
|
| Package | Arch | Status | Sha |
|---|---|---|---|
| icu | wasm32 | built | 1b708b23 |
| libcurl | wasm32 | built | 5d2baeb6 |
| libcxx | wasm32 | built | 10822bd9 |
| libcxx | wasm64 | built | 25ef3300 |
| libiconv | wasm32 | built | c599d681 |
| libpng | wasm32 | built | ba7e28f0 |
| libxml2 | wasm32 | built | d98f801a |
| libzip | wasm32 | built | 3dd483d4 |
| openssl | wasm32 | built | 424389bb |
| openssl | wasm64 | built | 912c6480 |
| sqlite | wasm32 | built | 7a1d359e |
| sqlite | wasm64 | built | d6e76f5f |
| zlib | wasm32 | built | 8d1bcd09 |
| zlib | wasm64 | built | 72d2453b |
| bc | wasm32 | built | b698cee4 |
| bzip2 | wasm32 | built | cdb19a37 |
| coreutils | wasm32 | built | c28d9a8a |
| curl | wasm32 | built | 82d34889 |
| dash | wasm32 | built | 78cb51e3 |
| diffutils | wasm32 | built | bb0fe725 |
| dinit | wasm32 | built | 0dd97701 |
| fbdoom | wasm32 | built | 197275c8 |
| file | wasm32 | built | 81d6e9e3 |
| findutils | wasm32 | built | 2ee580be |
| gawk | wasm32 | built | 20093498 |
| git | wasm32 | built | d9662860 |
| grep | wasm32 | built | 54ab22a4 |
| gzip | wasm32 | built | 98d8b80e |
| hello | wasm32 | built | 3894ce0b |
| kandelo-sdk | wasm32 | built | 1e680135 |
| kernel | wasm32 | built | ddd26fef |
| less | wasm32 | built | 82b4d006 |
| lsof | wasm32 | built | f615f276 |
| m4 | wasm32 | built | cf2867c0 |
| make | wasm32 | built | c78cf168 |
| mariadb | wasm32 | built | d3638d5d |
| mariadb | wasm64 | built | 43505255 |
| modeset | wasm32 | built | cb65434e |
| msmtpd | wasm32 | built | 110af331 |
| nano | wasm32 | built | 7e849192 |
| ncurses | wasm32 | built | 5aac1ff2 |
| netcat | wasm32 | built | e9929ccd |
| nginx | wasm32 | built | 436389b6 |
| php | wasm32 | built | 2fc5a872 |
| posix-utils-lite | wasm32 | built | cd44f9a1 |
| ruby | wasm32 | built | fafb2e6d |
| sed | wasm32 | built | d30d7968 |
| spidermonkey | wasm32 | built | 70375ff9 |
| tar | wasm32 | built | 150eb5ed |
| tcl | wasm32 | built | 214ce39f |
| unzip | wasm32 | built | 519079b3 |
| userspace | wasm32 | built | 29ed6757 |
| vim | wasm32 | built | 7cab6404 |
| wget | wasm32 | built | 6a064f94 |
| xz | wasm32 | built | 7f2d6ad6 |
| zip | wasm32 | built | 44cbe377 |
| zstd | wasm32 | built | de354193 |
| bash | wasm32 | built | 1b021b0c |
| mariadb-test | wasm32 | built | ebc24b15 |
| mariadb-vfs | wasm32 | built | ada20fed |
| mariadb-vfs | wasm64 | built | dbd74217 |
| nethack | wasm32 | built | ffc9e23e |
| node | wasm32 | built | 60cf998c |
| spidermonkey-node | wasm32 | built | 7802aac3 |
| vim-browser-bundle | wasm32 | built | e748a6cf |
| nethack-browser-bundle | wasm32 | built | e6d2b836 |
| rootfs | wasm32 | built | 18d09b37 |
| shell | wasm32 | built | 2f6265da |
| lamp | wasm32 | built | 221369e3 |
| node-vfs | wasm32 | built | 045bef36 |
| wordpress | wasm32 | built | 40f60c19 |
Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.
13 tasks
Align the stack passed to kernel_clone to the 16-byte boundary required by Wasm code generation. This keeps stack-based variadic arguments intact when a new pthread begins. Add a local Sortix regression that formats the SQLite temporary-file pattern from fresh pthreads. The kernel_clone interface and ABI layout are unchanged.
cded11d to
fc25245
Compare
This was referenced Jul 13, 2026
Member
Author
|
Closing this focused source PR because its wasm32 pthread stack-alignment fix and direct regression are now carried by #934 at exact green head |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
#907 already landed PHP support, ABI 39, and the shared process, VFS, host,
package, and test fixes found during that work. This PR does not replay those
changes.
The unique fix here aligns the stack passed to
kernel_cloneto the 16-byteboundary expected by wasm32 code generation. Without that alignment, a fresh
pthread can corrupt stack-based variadic arguments. The regression formats the
same
%llx%cshape that exposed the problem in SQLite, but tests the libccontract directly through a new pthread.
What was removed
The old PR mixed this libc fix with SQLite Node/browser test-runner work. That
harness work now belongs to #783 and is deliberately absent here. No mmap,
package, VFS, or unrelated #769 changes remain; the final diff is exactly one
libc source file and one Sortix regression.
ABI and package impact
The
kernel_clonearguments and ABI layout are unchanged, so there is no ABIversion bump. Rebuilding musl changes libc/toolchain artifact bytes. No package
revision changes are included.
Validation run
All validation used
scripts/dev-shell.shon exact headfc25245984f346a5620998f02f93ad9b85dae80b:flaky test that passed on this run;
supported-boundary skips;
/bin/shsetup failures passed after the declared dash/rootfsdependency was materialized;
Validation not run
The full browser and Sortix suites were not run locally. Focused host pthread
Vitest did not start because global setup requires a wasm64 sysroot; wasm64 was
not built because this change is in the wasm32 libc implementation. The full
rootfs source-fallback build was stopped after the relevant artifacts existed.
No performance measurement was made and this PR makes no performance claim.
Extracted from the useful pthread portion of #769 and narrowed from the old
composite #784 diff.