Deliver SIGEV_THREAD timers to pthread helpers#906
Closed
brandonpayton wants to merge 2 commits into
Closed
Conversation
Implement kernel-owned per-timer notification state and exact thread-directed delivery so musl SIGEV_THREAD helpers work on Node and browser hosts. Preserve timer siginfo/overrun metadata, finite wait deadlines, lifecycle cleanup, and the legacy interval export contract. Build musl with the SDK Wasm EH/SjLj model and add an end-to-end regression fixture.
The host/kernel contract now includes kernel-owned POSIX timer expiration delivery and exact SIGEV_THREAD_ID targets. Bump the ABI epoch and regenerate the authoritative snapshot plus C and TypeScript bindings so mixed ABI-18 host/kernel pairs fail loudly.
Member
Author
|
Independent exact-head review completed for
No review blocker was found. CI still owns the full ABI 19 artifact rebuild and broad browser/conformance evidence. |
This was referenced Jul 13, 2026
Phase B-1 matrix build status —
|
| Package | Arch | Status | Sha |
|---|---|---|---|
| libcurl | wasm32 | built | d91660ac |
| libcxx | wasm32 | built | 6ab57bf4 |
| libcxx | wasm64 | built | 95a9b1db |
| libpng | wasm32 | built | 3cd08346 |
| libxml2 | wasm32 | built | 9bd3619f |
| libxml2 | wasm64 | built | 03616b63 |
| openssl | wasm32 | built | 5ae4fe50 |
| openssl | wasm64 | built | d9d249d6 |
| sqlite | wasm32 | built | 06655b03 |
| sqlite | wasm64 | built | ad7294fe |
| zlib | wasm32 | built | 347ca36b |
| zlib | wasm64 | built | 0c033641 |
| bc | wasm32 | built | ef20578a |
| bzip2 | wasm32 | built | cf7f30e0 |
| coreutils | wasm32 | built | 7f0b7802 |
| curl | wasm32 | built | d0187845 |
| dash | wasm32 | built | f802bddb |
| diffutils | wasm32 | built | 674b8f44 |
| dinit | wasm32 | built | a8168ccb |
| fbdoom | wasm32 | built | 0f4818ed |
| file | wasm32 | built | 0b9fac52 |
| findutils | wasm32 | built | b636d32c |
| gawk | wasm32 | built | 0a8f6795 |
| git | wasm32 | built | 5ba8c0c6 |
| grep | wasm32 | built | 2aac26f9 |
| gzip | wasm32 | built | 3698a07a |
| hello | wasm32 | built | 6553ed19 |
| kandelo-sdk | wasm32 | built | 4062f2d6 |
| kernel | wasm32 | built | be880b01 |
| less | wasm32 | built | 7f9297f6 |
| lsof | wasm32 | built | dbdabdbb |
| m4 | wasm32 | built | 6fd6a44b |
| make | wasm32 | built | cfb18f6e |
| mariadb | wasm32 | built | deaffec4 |
| mariadb | wasm64 | built | 4adc1d3b |
| modeset | wasm32 | built | 24d1188e |
| msmtpd | wasm32 | built | 275d3474 |
| nano | wasm32 | built | e88a4c8d |
| ncurses | wasm32 | built | 4c36b411 |
| netcat | wasm32 | built | 319765d3 |
| nginx | wasm32 | built | 76a029d6 |
| php | wasm32 | built | 2d325e8d |
| posix-utils-lite | wasm32 | built | 818c4bb5 |
| ruby | wasm32 | built | 7c32e926 |
| sed | wasm32 | built | dc5d015b |
| spidermonkey | wasm32 | built | 72ee84d8 |
| tar | wasm32 | built | 3c8d4efe |
| tcl | wasm32 | built | 13ec97f7 |
| unzip | wasm32 | built | 1c8bc9c1 |
| userspace | wasm32 | built | 95446055 |
| vim | wasm32 | built | 088793df |
| wget | wasm32 | built | 099fffa4 |
| xz | wasm32 | built | 3f435f79 |
| zip | wasm32 | built | cd9a1e95 |
| zstd | wasm32 | built | 9bc9f13e |
| bash | wasm32 | built | 8b4bd77a |
| mariadb-test | wasm32 | built | b0273594 |
| mariadb-vfs | wasm32 | built | 317f8ee0 |
| mariadb-vfs | wasm64 | built | b6fa7e8a |
| nethack | wasm32 | built | 10851493 |
| node | wasm32 | built | 9a4036cf |
| spidermonkey-node | wasm32 | built | 0516a7ee |
| vim-browser-bundle | wasm32 | built | c3e294a1 |
| nethack-browser-bundle | wasm32 | built | 2b945cc9 |
| rootfs | wasm32 | built | 0036fdc9 |
| shell | wasm32 | built | 5f332d81 |
| lamp | wasm32 | built | ade2ef08 |
| node-vfs | wasm32 | built | d2b85408 |
| wordpress | wasm32 | built | 29a03d35 |
Auto-generated; replaced on each push. Raw data in the publish-status workflow artifact.
brandonpayton
added a commit
that referenced
this pull request
Jul 13, 2026
Keep timer expiration state in the kernel while the shared host runtime schedules deadlines and wakes the exact main or worker thread selected by SIGEV_THREAD_ID. Preserve SI_TIMER metadata, overruns, finite sigtimedwait deadlines, and timer cleanup across exec and deletion. Reconcile musl's SIGEV_THREAD helper with the fixed four-i32 timer wire on wasm32 and wasm64, and make kernel_posix_timer_fire a required host-adapter export. Regenerate the ABI snapshot and generated constants atomically with the ABI 38 to 39 bump. Source-PR: #906
Member
Author
|
Merged PR #907 supersedes this work through the strengthened timer-delivery implementation now on main at |
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.
Purpose
Vim's POSIX
start_timeout()path usestimer_create(..., SIGEV_THREAD, ...). Musl implements that contract with a helper pthread and lowers the timer notification to Linux-compatibleSIGEV_THREAD_ID. Kandelo rejected that exact notification mode withEINVAL, so Vim reportedE1286, remained in its timer error path, and left Git waiting indefinitely for the default editor.This fixes the platform timer contract instead of suppressing Vim timers or adding package-specific behavior.
What changed
SI_TIMERmetadata, overrun state, and cleanup.sigtimedwait()deadlines across retries and wake the matching blocked thread channel.setjmp/longjmpimports.SIGEV_THREADtimer fixture and targeted host coverage.ABI
This PR has an intentionally reviewable two-commit shape:
1382547ac5b6083830bba336d17c5aab7e31348eis the complete functional change.0d03f899103408c6c233379072c93b0407c81cedis the isolated ABI 19 bump and generated snapshot/binding update.The timer delivery export and semantics are ABI-visible, so the standalone PR correctly bumps
ABI_VERSIONto 19. The ABI batching work in #871 should cherry-pick the functional commit and replace or omit this PR's standalone bump when assigning the consolidated epoch.No package archives, VFS images, or release indexes are changed here. They must be rebuilt for the final merged ABI epoch.
Validation
Run through
scripts/dev-shell.shon the functional head, followed by ABI consistency checks on the exact PR head:sigtimedwaittests: 5 passedscripts/check-abi-version.sh: passed on exact headgit diff --check: passedThe standalone ABI bump has not been followed by a full local ABI 19 artifact rebuild. Full browser, libc conformance, POSIX conformance, and Sortix suites were not run locally; CI is the evidence gate for those claims.