[PHP] fix: raise SIGPIPE for bridged TCP EPIPE#749
Merged
brandonpayton merged 2 commits intoJul 10, 2026
Conversation
(cherry picked from commit aede00b)
The SIGPIPE-on-EPIPE change added a test for external send with MSG_NOSIGNAL (signal suppressed) but not for external send with default flags, which is the main new branch in sys_send. Add that case, and record the observable behavior in docs/posix-status.md: a send to a broken stream peer returns EPIPE and raises SIGPIPE across host-bridged external and loopback TCP, with MSG_NOSIGNAL suppressing the signal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
brandonpayton
changed the base branch from
integration/kd-6nz-php-phpt-harness-only-base
to
integration/kd-6nz-php-phpt-batch-1-kernel-fixes
July 10, 2026 17:03
brandonpayton
merged commit Jul 10, 2026
f644474
into
integration/kd-6nz-php-phpt-batch-1-kernel-fixes
1 check passed
This was referenced Jul 10, 2026
brandonpayton
pushed a commit
that referenced
this pull request
Jul 13, 2026
Delivering SIGPIPE for this existing EPIPE path changes observable signal and default-termination semantics. Advance ABI 18 to 19 and regenerate the ABI evidence in the same commit. Source-PR: #749 Folded coverage and documentation: a9652e91c.
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.
Why
POSIX requires that writing to a stream socket whose peer has closed the read end returns
EPIPEand raisesSIGPIPE, unless the caller opts out withMSG_NOSIGNAL(orSO_NOSIGPIPE). Kandelo's in-kernel pipe-backed sockets already did this, but the host-bridged TCP path (host_net_sendfor AF_INET/AF_INET6) only propagated theEPIPEerrno and never raised the signal — and it did not honorMSG_NOSIGNAL. So PHP stream/socket tests saw non-Unix behavior that depended on whether a connection was loopback or host-bridged.Making the bridged path match the in-kernel socket model is a platform fix that benefits every package using bridged TCP, not just PHP.
What
crates/kernel/src/syscalls.rs: insys_write's external-TCP branch, map anEPIPEfromhost_net_sendto raisingSIGPIPE(mirroring the pipe-backed path). Insys_send, honorMSG_NOSIGNAL— suppress theSIGPIPEa write would raise, and on the external path raiseSIGPIPEonEPIPEonly whenMSG_NOSIGNALis unset.MockHostIOsohost_net_connect/connect_status/send/listenresults are configurable, and adds tests: external-TCPEPIPEraisesSIGPIPE;send(..., MSG_NOSIGNAL)suppresses it.Provenance
Supersedes fork-headed PR #729; identical head commit
9e252cfb8d6af2e1dd5c91d61c1357456411b84d, re-pointed onto anAutomattic/kandelobranch. No code changed from #729.