fix(kernel): handle redirected standard pipes #19824
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19824"
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 DonRyuzaki on 2026-11-14T00:38:14Z.
What
Classify real pipes before applying standard-descriptor console readiness assumptions. Currently queued input on a pipe duplicated onto descriptor 0, 1 or 2 is ignored by select/poll, and poll treats redirected output as writable even under pipe backpressure.
Use the existing pipe readiness paths for those descriptors. Preserve the non-pipe console fallback and its errno behavior. Make the old console fixture use a valid non-pipe null device, independent of CTest's pipe stdin; restore standard descriptors before asserting or rethrowing.
Tested
Linux, Ubuntu 24.04 under WSL2, GCC 13.3, Release; base
6fd2999417948562be633aa71629bab45d0e8b81, head156f7723601dad71e775e8c38293c061023bfcff, treedb50f7aaa75b1771950e8694d37ffcb81442007f.guest_select_waitfailure on the previous exact headb38d4a7890a9ff465aa2b9f3c3dbe1f4843a1c96:select with no ready device did not time out. The inherited CTest stdin pipe can be readable at EOF after the corrected pipe classification. The test now temporarily installs a controlled non-pipe null device and restores the original descriptor even on exceptions. Timeout and bitmap assertions are unchanged; production pipe logic is unchanged by this review fix.cmake --build build --target libs guest_poll_tests guest_select_tests guest_select_wait_tests --parallel 8passes on this exact head.ctest --test-dir build --no-tests=error --output-on-failure -R '^guest_(poll|select|select_wait)$': 3/3 pass, zero skips, 9.73 seconds locally.descriptor=0 ready=0); the controlled-device wait fixture passes. Local test-only baseline fixture99629f67786bdf16d9419ad91ce89f8344251877. Reproduce by applying only these changed test files to the base.BUILD_TESTING=ON,FT_ENABLE_ERROR_STRINGS=OFF,CMAKE_LINK_DEPENDS_NO_SHARED=ON. Conventions and literalgit diff --checkpass.git merge-tree --write-treeagainst its head17bebb404f8dd4f5db013095f3d9d073f1dd118fsucceeds.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T00:39:18Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
b38d4a7890:tools/check_conventions.pypassed;git diff --checkclean.guest_poll_tests,guest_select_testsbuilt cleanly.guest_poll,guest_select_wait,guest_select):Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T20:24:06Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
156f772360:tools/check_conventions.pypassed;git diff --checkclean.guest_poll_tests,guest_select_tests,guest_select_wait_testsbuilt cleanly.guest_poll,guest_select_wait,guest_select):core/libs/prx/libkernel/Socket/src/Socket.cpp,core/libs/prx/libkernel/Socket/src/Udp.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T20:24:07Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
156f772360:tools/check_conventions.pypassed;git diff --checkclean.guest_poll_tests,guest_select_tests,guest_select_wait_testsbuilt cleanly.guest_poll,guest_select_wait,guest_select):core/libs/prx/libkernel/Socket/src/Socket.cpp,core/libs/prx/libkernel/Socket/src/Udp.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T16:18:24Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
967cbb82db:tools/check_conventions.pypassed.guest_poll_tests,guest_select_tests,guest_select_wait_testsbuilt cleanly.guest_poll,guest_select_wait,guest_select):core/libs/prx/libkernel/Socket/src/Socket.cpp,core/libs/prx/libkernel/Socket/src/Udp.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T16:23:40Z.
Review: APPROVED
Reviewed — looks good
The reviewed change routes redirected standard pipes through pipe readiness handling and adds regression coverage for poll and select at descriptors 0–2.
What I ran
Reviewed head
967cbb82db30517a7cf35aaf8c7136375b173e40. I read the prepared description, commits, diff, manifest, and all five changed repository files at the pinned head usingrepo_read.py; I did not run commands or tests. The description reports Linux runtime tests and Windows compile-only checks, which I did not independently run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not independently run the reported Linux tests or Windows compilation, and did not verify console or game behavior. All files listed as reviewed in the manifest were read:
Socket.cpp,Udp.cpp,GuestPoll.cpp,GuestSelect.cpp, andGuestSelectWait.cpp. No files were excluded by the manifest.To get this to a good state
Nothing is required.