fix(libkernel): translate pending connection errors #2080

Closed
STUPIDCONTEM wants to merge 1 commit from upstream-pr/2080 into main
STUPIDCONTEM commented 2026-10-09 07:10:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by STUPIDCONTEM on 2026-10-09T07:10:05Z.


Evidence review (2026-10-09)

Game/title evidence has not been established. Validation below is host regression/build evidence only; it does not establish title compatibility. Older checked items and test results describe their stated revisions, not current merge readiness.

Game/title ID: none verified. No PS5 title execution is claimed.

What

Nonblocking connect now translates a pending host connection to guest EINPROGRESS (36), and a repeated pending connection to EALREADY (37). Previously Windows WSAEWOULDBLOCK became EAGAIN (35), while POSIX EINPROGRESS/EALREADY fell through to EIO (5). Applications checking the expected pending status could incorrectly treat an ordinary connection attempt as failure.

Translation is specific to connect, preserving ordinary send/receive would-block behavior and existing fallback errors. The contracts are FreeBSD stable/11 connect(2) and Microsoft Winsock connect. Windows WSAEINPROGRESS describes a separate blocking Winsock operation; it is not reclassified as a pending nonblocking connect.

Tested

Windows 10 Pro 19045, WinLibs GCC 15.2.0 UCRT posix SEH r7, Release, BUILD_TESTING=ON; independent branch from main f145139676.

  • GuestTcp calls the actual nonblocking connect wrapper over loopback, accepts immediate success or requires EINPROGRESS, waits with bounded polls for client/listener readiness, and transfers data. It fails on unchanged upstream at the pending-error assertion and passes with this change.
  • The deterministic guest_connect_error test covers initial pending, repeated pending and fallback selection for platform error constants.
  • Both focused tests passed 50 repetitions each. Default and explicit libs builds passed; full CTest passed 489/489 in 26.28 seconds.
  • Parent independently reviewed the mapping and rejected an overbroad Windows error translation and unnecessary test abstraction before verification. Conventions, whitespace and test registration passed.

An earlier fourteen-proposal integration passed full Linux verification with SPIRV Tools and lavapipe enabled: run 37898813460, exact head 8740893d8db1f13169cb0923d0445dec0a21ba42, 479 tests passed three times and 25 graphics feature tests were skipped (504 registered tests, zero failures). Two unrelated graphics tests exceeded the project 30-second target on their cold run; no timeout occurred. No title run was performed. The repeated-pending case is covered at the mapper level; loopback timing is not used to force a second connection attempt to remain pending.

Open #2079 fixes accepted socket mode in the same runtime and test file; both TCP regression blocks are retained in the integration. #1091 implements readiness events and #1832 descriptor polling. No duplicate pending-connect fix was found.

Current Windows integration, based on upstream d70b89989473ba1f6ae13e44e079e67f1f8a44b0, contains the 19 still-open proposals and excludes the three declined changes and the superseded build fix. Default and explicit libs builds passed at 8f0190c793c6dfa2b7a3a3f33f3d2cbe2509937c; 513 tests passed and one was skipped (514 registered, 52.66 seconds). Five affected I/O and socket tests each passed ten repetitions. Removing only the production ConnectError call reproduced the public TCP pending-error failure on this Windows host; restoring it gave ten passes. Loopback may complete immediately on other hosts, so this is Windows call-site evidence rather than a guarantee that every Linux run exercises the pending path.

The complete external #1091 (f94f0300 and exact tip 7f5f456585e9a112ac468726c43df636d711a1d8), #1832 (f782e4ad17), and #1676 (942a105c39) were also combined locally, preserving their authors. With the separate local SCE clock bridge and retained interaction fixtures, default/libs builds and 515 tests passed with one skip (516 registered, 38.46 seconds), at e44f3ca62d9ae7c34df5e988e1fe981be79c4806. Seven affected socket, polling, timer, and clock tests passed five repetitions each. This is integration evidence for the named tests; no title execution is claimed.

Checklist

  • Based on current main; no other open PR implements the same change (historical base; current readiness not asserted)
  • One topic per PR; follow-ups go in a new PR
  • No comments added to code
  • No silent stubs added
  • No investigation notes, reports or images added to the repository
  • No third-party code added
  • Generic behavior, not specific to one title
  • Depends on: none
  • AI-assisted: yes; parent independently reviewed and tested the final change
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4797284693 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2080). Originally posted by [STUPIDCONTEM](https://github.com/STUPIDCONTEM) on 2026-10-09T07:10:05Z. --- ### Evidence review (2026-10-09) Game/title evidence has not been established. Validation below is host regression/build evidence only; it does not establish title compatibility. Older checked items and test results describe their stated revisions, not current merge readiness. Game/title ID: **none verified**. No PS5 title execution is claimed. ### What Nonblocking connect now translates a pending host connection to guest EINPROGRESS (36), and a repeated pending connection to EALREADY (37). Previously Windows WSAEWOULDBLOCK became EAGAIN (35), while POSIX EINPROGRESS/EALREADY fell through to EIO (5). Applications checking the expected pending status could incorrectly treat an ordinary connection attempt as failure. Translation is specific to connect, preserving ordinary send/receive would-block behavior and existing fallback errors. The contracts are [FreeBSD stable/11 connect(2)](https://github.com/freebsd/freebsd-src/blob/stable/11/lib/libc/sys/connect.2) and [Microsoft Winsock connect](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-connect). Windows WSAEINPROGRESS describes a separate blocking Winsock operation; it is not reclassified as a pending nonblocking connect. ### Tested Windows 10 Pro 19045, WinLibs GCC 15.2.0 UCRT posix SEH r7, Release, BUILD_TESTING=ON; independent branch from main f145139676a48306681d3a4d5fabf83938759daf. - GuestTcp calls the actual nonblocking connect wrapper over loopback, accepts immediate success or requires EINPROGRESS, waits with bounded polls for client/listener readiness, and transfers data. It fails on unchanged upstream at the pending-error assertion and passes with this change. - The deterministic guest_connect_error test covers initial pending, repeated pending and fallback selection for platform error constants. - Both focused tests passed 50 repetitions each. Default and explicit libs builds passed; full CTest passed 489/489 in 26.28 seconds. - Parent independently reviewed the mapping and rejected an overbroad Windows error translation and unnecessary test abstraction before verification. Conventions, whitespace and test registration passed. An earlier fourteen-proposal integration passed full Linux verification with SPIRV Tools and lavapipe enabled: [run 37898813460](https://github.com/STUPIDCONTEM/AnyPS5/actions/runs/37898813460), exact head 8740893d8db1f13169cb0923d0445dec0a21ba42, 479 tests passed three times and 25 graphics feature tests were skipped (504 registered tests, zero failures). Two unrelated graphics tests exceeded the project 30-second target on their cold run; no timeout occurred. No title run was performed. The repeated-pending case is covered at the mapper level; loopback timing is not used to force a second connection attempt to remain pending. Open #2079 fixes accepted socket mode in the same runtime and test file; both TCP regression blocks are retained in the integration. #1091 implements readiness events and #1832 descriptor polling. No duplicate pending-connect fix was found. Current Windows integration, based on upstream `d70b89989473ba1f6ae13e44e079e67f1f8a44b0`, contains the 19 still-open proposals and excludes the three declined changes and the superseded build fix. Default and explicit libs builds passed at `8f0190c793c6dfa2b7a3a3f33f3d2cbe2509937c`; 513 tests passed and one was skipped (514 registered, 52.66 seconds). Five affected I/O and socket tests each passed ten repetitions. Removing only the production ConnectError call reproduced the public TCP pending-error failure on this Windows host; restoring it gave ten passes. Loopback may complete immediately on other hosts, so this is Windows call-site evidence rather than a guarantee that every Linux run exercises the pending path. The complete external #1091 (f94f0300 and exact tip 7f5f456585e9a112ac468726c43df636d711a1d8), #1832 (f782e4ad175527cb1ca63ee0c0d0fbe58024db5d), and #1676 (942a105c396828f5ab734cfad68cee1c07ca49ef) were also combined locally, preserving their authors. With the separate local SCE clock bridge and retained interaction fixtures, default/libs builds and 515 tests passed with one skip (516 registered, 38.46 seconds), at `e44f3ca62d9ae7c34df5e988e1fe981be79c4806`. Seven affected socket, polling, timer, and clock tests passed five repetitions each. This is integration evidence for the named tests; no title execution is claimed. ### Checklist - [ ] Based on current main; no other open PR implements the same change (historical base; current readiness not asserted) - [x] One topic per PR; follow-ups go in a new PR - [x] No comments added to code - [x] No silent stubs added - [x] No investigation notes, reports or images added to the repository - [x] No third-party code added - [x] Generic behavior, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes; parent independently reviewed and tested the final change

Pull request closed

Sign in to join this conversation.
No reviewers
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!2080
No description provided.