Skip to content

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

Closed as not planned

Description

@reyani-dev

ProsperoTV (PPSA99003) stops right after its menu opens, on main a11c8f7 (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.

Activity

  1. reyani-dev commented on Oct 11, 2026

    @reyani-dev
    ContributorAuthor

    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 a11c8f7 plus those two changes.)

  2. oneandonlydean commented on Oct 12, 2026

    @oneandonlydean
    Collaborator

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions