libkernel: a stream send on a connection the peer closed fails with ECONNABORTED/ECONNRESET on Windows, FreeBSD 11.4 fails with EPIPE #8669

Closed
opened 2026-10-20 20:36:45 +00:00 by xXPBSXx · 0 comments
xXPBSXx commented 2026-10-20 20:36:45 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T20:36:45Z.


Repro

Windows host. Connected stream pair; the peer calls close; the other end calls send(s, buf, n, MSG_NOSIGNAL) repeatedly.
Expected (FreeBSD 11.4 sosend_generic, sys/kern/uipc_socket.c:1260-1264): -1/EPIPE (32), because a socket that can send no more fails with EPIPE before so_error is looked at.
Actual: -1/ECONNABORTED (53) or ECONNRESET (54), the Winsock WSAECONNABORTED/WSAECONNRESET mapped as is. guest_tcp, guest_socket_read_write and guest_socket_pair skip the check on Windows.
Test: the three tests above (the check now runs on Windows).
Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/stream-send-after-reset-epipe
AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5949244466 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/8669). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-20T20:36:45Z. --- ### Repro Windows host. Connected stream pair; the peer calls `close`; the other end calls `send(s, buf, n, MSG_NOSIGNAL)` repeatedly. Expected (FreeBSD 11.4 `sosend_generic`, sys/kern/uipc_socket.c:1260-1264): -1/EPIPE (32), because a socket that can send no more fails with EPIPE before `so_error` is looked at. Actual: -1/ECONNABORTED (53) or ECONNRESET (54), the Winsock `WSAECONNABORTED`/`WSAECONNRESET` mapped as is. `guest_tcp`, `guest_socket_read_write` and `guest_socket_pair` skip the check on Windows. Test: the three tests above (the check now runs on Windows). Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/stream-send-after-reset-epipe AI-assisted (Claude Code).
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#8669
No description provided.