fix(main): poll reports a descriptor closed mid-call as POLLNVAL #16626

Merged
adriadam10 merged 1 commit from upstream-pr/16626 into main 2026-11-07 10:26:27 +00:00
adriadam10 commented 2026-11-07 10:26:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-07T10:26:20Z.


What

guest_poll aborted on main (run 42357718011): poll: descriptor 7 is neither a socket, a pipe, ... thrown from PollDescriptors. PollsAPipeClosedDuringTheWait closes the pipe while the waiter thread enters poll: the descriptor passed DescriptorIsOpen, was closed by the other thread, then failed IsPipe and hit the throw. The throw branch now rechecks DescriptorIsOpen and reports POLLNVAL, the same recheck select already has. A genuinely unsupported open descriptor still throws.

Tested

Not reproducible deterministically (timing race, 1 of 233 main builds); worktree could not configure here (submodule pins unavailable), so not built locally. Fix mirrors the existing recheck in Socket.cpp select. Main's push build is the proof.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5200668961 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16626). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-11-07T10:26:20Z. --- ### What `guest_poll` aborted on main (run 42357718011): `poll: descriptor 7 is neither a socket, a pipe, ...` thrown from `PollDescriptors`. `PollsAPipeClosedDuringTheWait` closes the pipe while the waiter thread enters poll: the descriptor passed `DescriptorIsOpen`, was closed by the other thread, then failed `IsPipe` and hit the throw. The throw branch now rechecks `DescriptorIsOpen` and reports `POLLNVAL`, the same recheck `select` already has. A genuinely unsupported open descriptor still throws. ### Tested Not reproducible deterministically (timing race, 1 of 233 main builds); worktree could not configure here (submodule pins unavailable), so not built locally. Fix mirrors the existing recheck in `Socket.cpp` select. Main's push build is the proof. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
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!16626
No description provided.