libkernel: poll throws 'descriptor 3 is not a socket' for a pipe descriptor (ProsperoTV) #3584

Closed
opened 2026-10-11 13:46:01 +00:00 by reyani-dev · 2 comments
reyani-dev commented 2026-10-11 13:46:01 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T13:46:01Z.


ProsperoTV (PPSA99003) stops right after its menu opens, on main a11c8f7f (Windows 11, RTX 4070, catalog build with eboot.bin and sce_module/libc.prx unwrapped):

[debug:0] [TV] menu open session=1
[libc] unhandled exception 'St13runtime_error' thrown from 00007ffa0d4efe86
terminate called after throwing an instance of 'std::runtime_error'
  what():  poll: descriptor 3 is not a socket

The title writes this to its own log (download0/profiles/10000000/logs/app.log). The console shows only the entry-point line and exit 0xc0000409.

poll (Socket/src/Udp.cpp:868) accepts only socket descriptors (>= GuestSockets::FirstDescriptor, 0x10000000) and throws for anything else. Descriptor 3 here comes from pipe:

  • pipe (File/src/Stdio.cpp:380) returns the host C-runtime descriptors from _pipe/pipe, which start at 3;
  • the executable imports pipe once, next to socketpair, select, and poll (9 call sites);
  • ProsperoTV's own sources (blackbearreloaded/ProsperoTV) don't call poll, so it comes from a library linked into the title. A wakeup pipe polled together with sockets (as curl's multi interface does) fits.

On FreeBSD, poll on a pipe reports POLLIN when data is buffered or the write end is closed (POLLHUP), and POLLOUT when there is room. Supporting this means poll has to wait on a mix of socket and pipe descriptors with one timeout. On Linux the host descriptors can go to the native poll as they are. On Windows, CRT pipes can't be waited on with WSAPoll, so it needs another readiness check (for example PeekNamedPipe on the read end) or a different pipe implementation.

Found with Claude Code.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5801628496 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3584). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T13:46:01Z. --- ProsperoTV (PPSA99003) stops right after its menu opens, on `main` a11c8f7f (Windows 11, RTX 4070, catalog build with `eboot.bin` and `sce_module/libc.prx` unwrapped): ``` [debug:0] [TV] menu open session=1 [libc] unhandled exception 'St13runtime_error' thrown from 00007ffa0d4efe86 terminate called after throwing an instance of 'std::runtime_error' what(): poll: descriptor 3 is not a socket ``` The title writes this to its own log (`download0/profiles/10000000/logs/app.log`). The console shows only the entry-point line and exit `0xc0000409`. `poll` (`Socket/src/Udp.cpp:868`) accepts only socket descriptors (`>= GuestSockets::FirstDescriptor`, `0x10000000`) and throws for anything else. Descriptor 3 here comes from `pipe`: - `pipe` (`File/src/Stdio.cpp:380`) returns the host C-runtime descriptors from `_pipe`/`pipe`, which start at 3; - the executable imports `pipe` once, next to `socketpair`, `select`, and `poll` (9 call sites); - ProsperoTV's own sources (blackbearreloaded/ProsperoTV) don't call `poll`, so it comes from a library linked into the title. A wakeup pipe polled together with sockets (as curl's multi interface does) fits. On FreeBSD, `poll` on a pipe reports `POLLIN` when data is buffered or the write end is closed (`POLLHUP`), and `POLLOUT` when there is room. Supporting this means `poll` has to wait on a mix of socket and pipe descriptors with one timeout. On Linux the host descriptors can go to the native `poll` as they are. On Windows, CRT pipes can't be waited on with `WSAPoll`, so it needs another readiness check (for example `PeekNamedPipe` on the read end) or a different pipe implementation. Found with Claude Code.
reyani-dev commented 2026-10-11 14:45:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T14:45:21Z.


A second title reaches this: ProsperoLichess (PPSA99009), once its two earlier stops are fixed (mspace alignment, #3639, then kern.arandom):

  what():  poll: descriptor 5 is not a socket

(Its own log, download0/prosperolichess/app.log, Windows 11, on main a11c8f7f plus those two changes.)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6110205573 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3584#issuecomment-6110205573). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T14:45:21Z. --- A second title reaches this: ProsperoLichess (PPSA99009), once its two earlier stops are fixed (mspace alignment, #3639, then `kern.arandom`): ``` what(): poll: descriptor 5 is not a socket ``` (Its own log, `download0/prosperolichess/app.log`, Windows 11, on `main` a11c8f7f plus those two changes.)
oneandonlydean commented 2026-10-12 06:17:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T06:17:42Z.


Closing as a duplicate of #3521: same throw, poll: descriptor N is not a socket (Socket/src/Udp.cpp:907). #3649 and #3644 both fix it; whichever merges covers PPSA99009 too.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118865162 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3584#issuecomment-6118865162). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T06:17:42Z. --- Closing as a duplicate of #3521: same throw, `poll: descriptor N is not a socket` (`Socket/src/Udp.cpp:907`). #3649 and #3644 both fix it; whichever merges covers PPSA99009 too.
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#3584
No description provided.