libkernel: poll throws for non-socket descriptors, first stop of ProsperoTV on main; fix branch ready (files and Windows pipe read ends) #3521
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 screamm on 2026-10-11T12:13:00Z.
libkernel's
pollthrows for any descriptor that is not a libSceNet socket. On currentmain0f863c10that is the first stop of PPSA99003 (ProsperoTV; the line is in the title's owndownload0/.../app.log):Descriptor 3 there is a pipe read end.
Fix branch ready:
screamm:feat/libkernel-poll-files(two commits onmain0f863c10:632eb162feat(libkernel): poll on file descriptors,839a9f0efeat(libkernel): poll Windows pipe read ends). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commits as they are. It shares theFile/src/DescriptorPoll.cpphelper with theselectbranch of #2811 (not merged), extended here, so the two will need one rebase whichever lands first.sys_generic.c(sys_poll,kern_poll,pollscan,poll_no_poll),vfs_default.canduipc_shm.c(8c639945): descriptors below the socket range go through the helper; regular files, directories and anonymous shm report the requestedPOLLIN/POLLRDNORM/POLLOUTat once and never the band events; on Linux pipes and character devices use hostpoll; closed descriptors getPOLLNVAL;POLLHUPclearsPOLLOUT; mixed arrays poll the sockets without waiting once a host descriptor is ready, otherwise in 100 ms slices within the one timeout. Throws: more than 1024 descriptors (the console'smaxfilesperprocis unknown), Windows consoles and unknown handles, the random device, the existing unsupported bits.pipenow records each end on Windows (File/src/PipeEnd.cpp, copied bydup/dup2, dropped byclose); a read end answers throughPeekNamedPipe(POLLIN/POLLRDNORMwith bytes available;POLLIN|POLLHUPonERROR_BROKEN_PIPE, as FreeBSD'spipe_pollreports end of file), a write end reports nothing for read events andPOLLOUTon it throws, since the host does not report free space; pipes not created bypipethrow. The two FreeBSD differences (a writer closing with buffered bytes shows noPOLLHUPuntil drained; a write end whose reader closed reports nothing) are in TechnicalDebt.guest_pollgains a file withPOLLIN|POLLOUT, a file plus an idle UDP socket returning 1 at once, a UDP-only 200 ms timeout, a closed filePOLLNVAL, 1025 descriptors throwing, an empty pipe read end not ready and ready after a write,POLLHUPafter the writer closes, and the write-end cases.Title run: with the rebuilt
libkernel.prxPPSA99003 gets past the call, logs[TV] menu ready display=3840x2160, and keeps running until killed at 60 s; its next stop is the known graphics one,AGC graphics: last provoking vertex with explicit per-vertex flat interpolation is unsupported.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:guest_poll,guest_udp,guest_tcp,guest_socket_pair,guest_socket_read_write,guest_dup3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"533/534, the one failure beingwindows_exceptions(#3411); withmain'sUdp.cppthe extendedguest_pollfails;tools/check_conventions.py --base mainandgit diff --checkpass. Linux only syntax-checked.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T13:08:54Z.
Independent verification on Linux: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.8c639945onto currentmain: applies cleanly, no conflicts.tools/check_conventions.py --base origin/mainandgit diff --checkpass.The rebased branch is available at
blawesom:verify/3521for anyone carrying — the commit is otherwise unchanged.Imported from boykopovar/AnyPS5. Originally posted by pushkarreddyy on 2026-10-11T14:45:50Z.
Hi @screamm! I have carried your branch
feat/libkernel-poll-filesinto #3649 (feat(libkernel): poll on file descriptors and Windows pipe read ends) rebased cleanly on currentmain(a11c8f7), with your commits (c50ac7856ande8d123804) and authorship fully preserved!All PR intake, eligibility, and convention checks have passed cleanly. This also resolves the runtime abort observed on PSXS5 (
PPSA975102.2.0) at the 31-second mark (what(): poll: descriptor 6 is not a socket (#3521)) verified by @orishamir in #3494. Thank you for the great work on this implementation!Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-12T23:48:50Z.
Additional title evidence for the existing non-socket poll guard: Sonic Unleashed Recompiled (PPSA99902 /01.003.000), Windows11 Enterprise26200, WinLibs GCC15.2r7 /Release, RTX5080. After a controlled libc-only #4822 comparison, the conditional title run aborts at:
The current integration and current main
e6ecece94have the sameSocket/src/Udp.cppGit blob8f1fd2bfd7ca6135143699d03cd305c72e8b0760; the refusal is unchanged. The fixed replay exits0xC0000409 after9.981s, no timeout/frames. A subsequent scalar observer confirms pipe read ends, with descriptor numbers shifted by instrumentation:The creation pairs identify the read end from
_pipeslot0 (Microsoft contract);GetFileType=3and valid CRT handles corroborate the pipe class. Both calls request POLLIN (0x1) and an infinite wait (-1), count1. The observer run stops after9.827s, with the same guard and restored assets/runtime/user data. It is separate from the uninstrumented descriptor3/5 run; no fixed descriptor number is assumed. Production source is restored exactly and its ordinary libraries rebuilt. The clean current-main carry of #3644 now passes six native groups ×20 and full NVIDIA1011/0/8 of1019. Its kernel-only title comparison removes the poll abort, renders the SEGA startup logo and runs to the existing private MSAA guard after789.240s, without timeout. Originals/runtime/user data are restored. The updated #3644 validation comment has the source/profile scope, commands and remaining limits. This validates the pipe implementation in the conditional stack; #3649 and the combination with #4391 remain untested here. This is a conditional profile with private prerequisites, not a whole-main title launch. Original executable/bundled libc, baseline runtime, converted guest and user data were restored/hash-verified. The fresh control, exact-source and one-library hash checks are in #4814 and the #4822 validation comment. I will update this comment with controlled fix validation; no duplicate issue/PR is being created for this guard. AI-assisted: Codex.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:07:03Z.
Closing: fixed by #3644, which polls pipe descriptors; that is the
poll: descriptor 3 is not a socketstop of PPSA99003 and PPSA99902.pollon a regular file still throws (is neither a socket nor a pipe); #3649 is open for that, and POLLPRI is #4478.