Repository navigation
Conversation
|
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes. |
|
Thanks @Recapi for the socket duplication implementation. I independently tested its allocation-failure paths. Independent fault-injection finding at 1864f37: the new socket There is also a state-recovery consequence: A proposed minimal correction catches
Reproduction, proposed patch and complete logs: patch, reproduction instructions and test results. Tested on Linux/WSL with GCC 15.2. The harness catches the escaping exception; no game-process crash or native PS5 OOM contract is claimed. Original socket usability, successful-alias lifetime and bounded native-FD cleanup were checked; Windows/macOS, concurrency, full-emulator behavior and CI were not validated. I see intake has paused and this PR was automatically closed. Sharing a focused finding for future use, without opening a PR or requesting an intake exception. AI-assisted with OpenAI Codex. |
|
Thanks @popeee99, confirmed: the other socket exports in |
What
dupanddup2in libkernel.dup/dup2(_dup/_dup2on Windows), which share the open file, offset and flags as FreeBSD does.dup2(fd, fd)returnsfdwhen it is open.GuestSockets::FirstDescriptor):dupgives a new socket number that shares the socket, which stays open until its last number is closed;dup2onto another socket number replaces what was there and keeps later socket numbers above it.kern_dup: a negative or closed source, or a negative target, is -1 withEBADF;EMFILEand other host failures are passed through.Prior work: #1855 (
dup) and #1870 (dup2) were closed because no title stopped at them onmainthen.Log
Linux (Ubuntu, GCC 15.2.0),
main8b393b6 with nothing else merged; catalog release ZIPs checked against their sha256,eboot.binand bundled modules unwrapped from their SELF containers, relinked withrelinker --registry, run in abwrapsandbox (no network, read-only filesystem). These are the stops for both titles in the catalog table in #1578.XPSemu (PPSA97358, Alpha-2), on
main:With this PR it stops at the next absent import,
__inet_aton(#1848):Prospero Win (PPSA99995, 0.1.1), on
main:With this PR it stops at
sigemptyset(#1641):In their sources both titles use
dup(1)/dup2(logfd, 1)to redirect stdout and stderr to a log (util/log.cin XPSemu,native/ps5log/ps5log.hin Prospero Win). Prospero Win also hasdup2(socketpair end, 1)(native/wine64_main.c,capture_fd), which this PR throws on; it runs after the title loads Wine, past several other absent imports.Tested
Ubuntu, Linux 7.0, GCC 15.2.0, full build with
BUILD_TESTING=ON. New testguest_dup: adupof a pipe end outlives the original,dup2onto an open pipe end closes it (its reader sees EOF),dup2(fd, fd),EBADFfor negative and closed descriptors, socketdupanddup2(including onto an unused socket number, with latersocketpairnumbers above it, and onto an open socket), and the two cross-numbering throws. Patchedlibkernel.prxexportsiiQjzvfWDq0andwdUufa9g-D8. Both titles run before and after as above.The project's Build workflow on the fork, on this commit (a fork-only branch adds the previous
build.yml, since the current one only runs for pull requests andmain): https://github.com/Recapi/AnyPS5/actions/runs/37983997708: linux 521/521 and windows (MinGW) 512/512 withguest_duppassing, relinker on ubuntu, windows and macos passing.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)