Fix mmap accounting under partial munmap churn - #769
Conversation
Phase B-1 matrix build status —
|
| Package | Arch | Status | Sha |
|---|---|---|---|
| libcurl | wasm32 | built | bec46d0b |
| libcxx | wasm32 | built | c331e742 |
| libcxx | wasm64 | built | c844f6bb |
| libpng | wasm32 | built | 641c37b6 |
| libxml2 | wasm32 | built | be6e19ba |
| libxml2 | wasm64 | built | a6885aab |
| openssl | wasm32 | built | e31a4e3f |
| openssl | wasm64 | built | 03668e32 |
| sqlite | wasm32 | built | 3f626c20 |
| sqlite | wasm64 | built | 57ef076d |
| zlib | wasm32 | built | 728c7909 |
| zlib | wasm64 | built | a3dc0e46 |
| bc | wasm32 | built | af5a6ede |
| bzip2 | wasm32 | built | fa17baf1 |
| coreutils | wasm32 | built | b6d8b93b |
| curl | wasm32 | built | 1b8bc0c7 |
| dash | wasm32 | built | c2cd98b6 |
| diffutils | wasm32 | built | 47b7c330 |
| dinit | wasm32 | built | c24f75d5 |
| fbdoom | wasm32 | built | 2bfcce51 |
| file | wasm32 | built | 6089029f |
| findutils | wasm32 | built | 9f2625fe |
| gawk | wasm32 | built | a29ca70e |
| git | wasm32 | built | 09108998 |
| grep | wasm32 | built | f4ee8e96 |
| gzip | wasm32 | built | 38fb8ddf |
| kandelo-sdk | wasm32 | built | fffef875 |
| kernel | wasm32 | built | f269adc7 |
| less | wasm32 | built | ccaa6c7d |
| lsof | wasm32 | built | 0a4102c9 |
| m4 | wasm32 | built | 0770227d |
| make | wasm32 | built | ad203925 |
| mariadb | wasm32 | built | 8027a3be |
| mariadb | wasm64 | built | cf4ef8a7 |
| modeset | wasm32 | built | 6e66cfe5 |
| msmtpd | wasm32 | built | 60d1dfe8 |
| nano | wasm32 | built | 75164b0c |
| ncurses | wasm32 | built | ffd48fef |
| netcat | wasm32 | built | 3b05b016 |
| nginx | wasm32 | built | 4fd44cf0 |
| php | wasm32 | built | 3199182a |
| posix-utils-lite | wasm32 | built | f280f251 |
| sed | wasm32 | built | 122e4e69 |
| spidermonkey | wasm32 | built | 1e70624f |
| tar | wasm32 | built | dbb8b117 |
| tcl | wasm32 | built | 0376be28 |
| unzip | wasm32 | built | 5699385b |
| userspace | wasm32 | built | d4f9fe28 |
| vim | wasm32 | built | 25e9ff9c |
| wget | wasm32 | built | f79e283d |
| xz | wasm32 | built | 03a0a427 |
| zip | wasm32 | built | 27175dfb |
| zstd | wasm32 | built | d0933168 |
| bash | wasm32 | built | 15989fa1 |
| mariadb-test | wasm32 | built | d837a7e8 |
| mariadb-vfs | wasm32 | built | daf28d6f |
| mariadb-vfs | wasm64 | built | 1b8ca84e |
| nethack | wasm32 | built | a700934f |
| node | wasm32 | built | 1604ae9b |
| spidermonkey-node | wasm32 | built | bdd092b9 |
| vim-browser-bundle | wasm32 | built | 62531f22 |
| nethack-browser-bundle | wasm32 | built | bb8c62ae |
| rootfs | wasm32 | built | 9f2461ad |
| shell | wasm32 | built | 4139368d |
| lamp | wasm32 | built | 0c58abee |
| node-vfs | wasm32 | built | aac70179 |
| wordpress | wasm32 | built | c130690c |
Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.
(cherry picked from commit da16dcf)
SQLite no_mutex_try incrvacuum3 exposed a case where adjacent anonymous mappings were coalesced in kernel metadata. A later mremap could report in-place growth success without extending exact mapping metadata, allowing the next mmap to reuse pages that the guest allocator believed were reserved. Keep adjacent mapping boundaries intact, make extend_mapping report whether it updated exact metadata, and return EINVAL from mremap when the grow check cannot be materialized. Add a regression test for mremap growth followed by mmap reuse.
|
Disposition for commit 4318995: extracted into the rebuilt #782. I rewrote #782 directly from current main instead of replaying the stale composite ancestry. It now contains only the host-owned browser setImmediate helper, the normal and network-worker wiring, and focused regressions for cancellation retention, timeout-handle collisions, and macrotask ordering. Final head: 3f133f9. The rest of #769 is not included in that PR. |
|
Extracted the initial-credentials work from I recorded #769 at head The old parser was not replayed verbatim: it accepted Disposition for this source commit: extracted into #926 with the reserved-sentinel correction. |
|
Commit
This disposition does not close #769; its other commits still need their own ownership decisions. |
|
Lock-table disposition: commit |
|
Directory- The focused replacement is based directly on current Ownership for this row can now be recorded as extracted to #930, not merged through #907 and not retained in #769. |
|
Stat metadata slice disposition:
|
|
Two more SQLite patch rows now have explicit ownership decisions:
Focused validation for #932 rebuilt the testfixture and passed |
|
The post-#907 split is complete. Here is the final ownership map for every
#907 already landed the actual mmap/munmap platform work. The focused PRs above No #769 commit remains unclassified. I am closing this PR as decomposed, not as |
|
Every commit is now extracted, superseded by #907, replaced by a contract-focused follow-up, or explicitly rejected in the matrix above. Closing this composite PR as decomposed, not merged verbatim. |
Summary
munmaplengths up to the Wasm page size before kernel bookkeeping and host mmap cleanup checks.Root cause
SQLite
memsubsys1/altermalloc.testrepeatedly mapped roughly 0x30000-byte regions and unmapped caller lengths around 0x29000. Kandelo roundedmmapto 64 KiB pages but used the literalmunmaplength in memory bookkeeping, leaving tiny tail mappings. Under mmap churn, those tails inflated the mapping list and the allocator path eventually hitRuntimeError: unreachablein focused Node/browser SQLite lanes.Validation
cargo test -p kandelo --target aarch64-apple-darwin --lib: 964 pass / 0 fail / 0 skip. Artifact:/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-cfo.4-debug-wave34-browser-memsubsys-readonly-sqlite-failures/test-runs/kd-cfo.4/kernel-full-lib-after-current-rebuild-20260623T213359Zcd host && npx vitest run: 752 pass / 0 fail / 108 skip, exit 0. Exact gate artifact:/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-cfo.4-debug-wave34-browser-memsubsys-readonly-sqlite-failures/test-runs/kd-cfo.4/host-vitest-after-hello64-20260623T213936Z; JSON outcome lists:/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-cfo.4-debug-wave34-browser-memsubsys-readonly-sqlite-failures/test-runs/kd-cfo.4/host-vitest-json-outcomes-20260623T214029Zscripts/run-libc-tests.sh: 303 pass / 0 fail / 0 skip, plus 1 flake-pass and 20 documented XFAIL, exit 0. Artifact:/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-cfo.4-debug-wave34-browser-memsubsys-readonly-sqlite-failures/test-runs/kd-cfo.4/libc-tests-after-submodule-init-20260623T214334Zscripts/run-posix-tests.sh: 174 pass / 0 fail / 2 skip, plus 3 documented XFAIL, exit 0. Artifact:/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-cfo.4-debug-wave34-browser-memsubsys-readonly-sqlite-failures/test-runs/kd-cfo.4/posix-tests-after-munmap-fix-20260623T215119Zbash scripts/check-abi-version.sh: passed with dev-shell nightly plus explicit bzip2/xz library paths. Artifact:/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-cfo.4-debug-wave34-browser-memsubsys-readonly-sqlite-failures/test-runs/kd-cfo.4/abi-check-dev-shell-nightly-bzip2-path-after-munmap-fix-20260623T213546Z/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-cfo.4-debug-wave34-browser-memsubsys-readonly-sqlite-failures/test-runs/kd-cfo.4/focused-browser-memsubsys1-cluster4-after-current-rebuild-20260623T213021Z/Users/brandon/src/kandelo-gascity/worktrees/kandelo/kd-cfo.4-debug-wave34-browser-memsubsys-readonly-sqlite-failures/test-runs/kd-cfo.4/focused-browser-readonly-unableopen8-after-current-rebuild-20260623T213224ZNotes
cargo fmt -p kandelo --checkwas attempted and is blocked by pre-existing formatting drift in unrelated parts ofsyscalls.rsandwasm_api.rs; no broad rustfmt was applied to avoid unrelated churn.RuntimeError: unreachableafter the done row; follow-up beadkd-cfo.5tracks that separate post-pass runtime issue.