macOS: a listen backlog of 0 does not bound the pending accept queue, so guest_sce_net's connect-expiry case cannot pass #22443

Closed
opened 2026-11-17 16:19:52 +00:00 by 011010 · 0 comments
011010 commented 2026-11-17 16:19:52 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by 011010 on 2026-11-17T16:19:52Z.


What happens

On macOS, guest_sce_net fails in CheckConnectTimeoutExpiry (line 1212):

connect timeout expiry: no connect stayed pending after 64 completed connects (last result 0x0, threw 0, 0 ms)
guest_sce_net check failed at line 1212, sceNet errno 61

The case creates a listener with sceNetListen(listener, 0) and connects repeatedly until one connect stays pending, because the console stops completing them once the queue is full. On macOS the queue is never full at that depth.

Measured with a host socket, x86-64 under Rosetta 2: a listener created with listen(0) completed 64 of 64 connects with none refused and none pending. XNU does not treat 0 as a queue of 0, so the check's premise does not hold there.

This is separate from #22317, which stops the same test earlier at line 1188; fixing that one is what makes the test reach this case.

Title, test or build step

guest_sce_net (ctest), CheckConnectTimeoutExpiry

AnyPS5 commit

main 1adc0e2f4b, with the fix for #22317 applied to reach this case.

System

macOS 27.0.1 (26A434), Apple M4 (Mac mini), Apple clang 21.0.0, x86-64 Release under Rosetta 2.

Steps to reproduce

ctest -R '^guest_sce_net$' --output-on-failure

What was checked

  • The failure is the same on every run.
  • The queue depth is host-side, not guest-side: a host listener with listen(0) accepts 64 connections without any accept, so sceNetConnect succeeds every time and never waits.
  • What the console does for a backlog of 0, and how it counts connections that completed but were never accepted, is not something I can measure here.
  • Not covered by any open pull request.

Possible directions

  • Model the pending queue in sceNetListen/sceNetConnect: count guest connects that the host completed but the guest never accepted, and stop completing them past the console's depth. The console's depth for a backlog of 0 is unmeasured, so it needs a console reading first.
  • If the console's depth cannot be established, the test's expiry case would have to be aimed at a state the host does recreate, which is weaker.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6448998501 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/22443). Originally posted by [011010](https://github.com/011010) on 2026-11-17T16:19:52Z. --- ### What happens On macOS, `guest_sce_net` fails in `CheckConnectTimeoutExpiry` (line 1212): ``` connect timeout expiry: no connect stayed pending after 64 completed connects (last result 0x0, threw 0, 0 ms) guest_sce_net check failed at line 1212, sceNet errno 61 ``` The case creates a listener with `sceNetListen(listener, 0)` and connects repeatedly until one connect stays pending, because the console stops completing them once the queue is full. On macOS the queue is never full at that depth. Measured with a host socket, x86-64 under Rosetta 2: a listener created with `listen(0)` completed **64 of 64** connects with none refused and none pending. XNU does not treat 0 as a queue of 0, so the check's premise does not hold there. This is separate from #22317, which stops the same test earlier at line 1188; fixing that one is what makes the test reach this case. ### Title, test or build step `guest_sce_net` (ctest), `CheckConnectTimeoutExpiry` ### AnyPS5 commit `main` `1adc0e2f4b`, with the fix for #22317 applied to reach this case. ### System macOS 27.0.1 (26A434), Apple M4 (Mac mini), Apple clang 21.0.0, x86-64 Release under Rosetta 2. ### Steps to reproduce ``` ctest -R '^guest_sce_net$' --output-on-failure ``` ### What was checked - The failure is the same on every run. - The queue depth is host-side, not guest-side: a host listener with `listen(0)` accepts 64 connections without any `accept`, so `sceNetConnect` succeeds every time and never waits. - What the console does for a backlog of 0, and how it counts connections that completed but were never accepted, is not something I can measure here. - Not covered by any open pull request. ### Possible directions - Model the pending queue in `sceNetListen`/`sceNetConnect`: count guest connects that the host completed but the guest never accepted, and stop completing them past the console's depth. The console's depth for a backlog of 0 is unmeasured, so it needs a console reading first. - If the console's depth cannot be established, the test's expiry case would have to be aimed at a state the host does recreate, which is weaker. AI-assisted: yes
Sign in to join this conversation.
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#22443
No description provided.