Repository navigation
Conversation
kill() returned the raw WASI errno from __wasi_proc_signal, so a failed call came back as a positive number with errno untouched. Callers that follow POSIX and check for -1 treated every failure as success; for example kill(pid, 0) on a pid that no longer exists returned 71 (ESRCH) instead of -1 with errno = ESRCH. Map a non-zero result to errno and -1, as setitimer() already does. Committed by Claude Code (AI agent) on behalf of Arshia Ghafoori. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 5, 2026
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.
Summary
kill()returned the raw WASI errno from__wasi_proc_signalinstead of following POSIX: a failed call came back as a positive number (e.g.71forESRCH) anderrnowas left untouched. Callers that checkkill(...) == -1(or< 0) treated every failure as success.Now a non-zero result sets
errnoand returns-1, the same waysetitimer()already handles__wasi_proc_raise_interval.Impact
Until now this was masked because the runtime's
proc_signalalways returned success. wasmerio/wasmer#7045 makes it reportESRCHfor a positive PID that doesn't exist, sokill(pid, 0)liveness checks can finally work — but only once libc reports the failure the POSIX way.Verification
A small program calling
kill(getpid(), 0),kill(0x7fffffff, 0)andkill(0, 0), run on the wasmer#7045 runtime:kill(self, 0)kill(missing, 0)kill(0, 0)071,errno = 000-1,errno = ESRCH0raise()has a similar shape (it returns the raw result of__wasi_thread_signal), but POSIX only requires a non-zero return there; left as is.Implemented by Claude Code (AI agent) on behalf of @Arshia001.
🤖 Generated with Claude Code