libkernel: poll on Windows reports a stream whose peer closed as POLLHUP only, never as POLLIN #8482
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-20T13:27:43Z.
Repro
Windows host. Connected stream pair; one side calls
shutdown(s, SHUT_WR)(orclose); the other callspoll({fd, POLLIN}, 1, 1000).Expected (FreeBSD 11.4
sopoll_generic, sys/kern/uipc_socket.c:3080-3086):revents == POLLIN. A socket that can receive no more is readable;POLLHUPis added only when it can send no more either.Actual:
revents == POLLHUP(0x10) withPOLLINrequested alone,0x14withPOLLIN|POLLOUT:WSAPollreportsPOLLHUPwithoutPOLLRDNORM, andpoll_nid_postfixpasses it on. A caller that waits forPOLLINand then reads the end of the stream never wakes for it.Test:
core/libs/tests/GuestPoll.cpp(PollsAStreamWhosePeerClosed, new; aborts before the fix).Fix branch: https://github.com/xXPBSXx/AnyPS5/tree/fix/poll-peer-close-pollin
AI-assisted (Claude Code).