fix(libkernel): return EPIPE for writes to closed pipes #5265

Closed
MarcZX10 wants to merge 2 commits from upstream-pr/5265 into main
MarcZX10 commented 2026-10-13 16:00:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T16:00:27Z.


What

Map Windows writes to a pipe with no readers to EPIPE in both the native write path and vectored stdio transfer path. Add a guest regression test for the closed-pipe write behavior.

Tested

Linux: built guest_pipe_closed_write_tests; guest_pipe_closed_write passed (1/1). python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main passed. Windows-specific error mapping was not executed locally.

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; silent stubs listed under technical debt
  • No notes, investigation .md files or images added to repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
  • Tested on Windows: no
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4845961894 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5265). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T16:00:27Z. --- ### What Map Windows writes to a pipe with no readers to `EPIPE` in both the native write path and vectored stdio transfer path. Add a guest regression test for the closed-pipe write behavior. ### Tested Linux: built `guest_pipe_closed_write_tests`; `guest_pipe_closed_write` passed (1/1). `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main` passed. Windows-specific error mapping was not executed locally. ### 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; silent stubs listed under technical debt - [x] No notes, investigation `.md` files or images added to repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes - [x] Tested on Windows: no
github-actions[bot] commented 2026-10-13 16:35:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T16:35:06Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#5008 core/libs/prx/libkernel/CMakeLists.txt L1250
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6150350002 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5265#issuecomment-6150350002). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T16:35:06Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #5008 | `core/libs/prx/libkernel/CMakeLists.txt` [L1250](https://github.com/boykopovar/AnyPS5/blob/0df6e295c52e7cd6afa394ed35513bd252045c74/core/libs/prx/libkernel/CMakeLists.txt#L1250) | | |
LeandroLP23 commented 2026-10-13 22:56:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-13T22:56:16Z.


Windows check, since this is a Windows-only remap. Setup: Windows 11 (26300), WinLibs GCC 15.2.0, Release, head e0f0350a5 merged onto main 30f961266.

  • With the PR: guest_pipe_closed_write passes.
  • With main's File/src/Open.cpp and File/src/Stdio.cpp and the PR's test: it fails. The test's Require aborts (FATAL: abort() (SIGABRT), exit 0xc0000409), so a write to a pipe whose reader is closed does not give EPIPE there.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6156953768 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5265#issuecomment-6156953768). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-13T22:56:16Z. --- Windows check, since this is a Windows-only remap. Setup: Windows 11 (26300), WinLibs GCC 15.2.0, Release, head `e0f0350a5` merged onto `main` `30f961266`. - With the PR: `guest_pipe_closed_write` passes. - With `main`'s `File/src/Open.cpp` and `File/src/Stdio.cpp` and the PR's test: it fails. The test's `Require` aborts (`FATAL: abort() (SIGABRT)`, exit `0xc0000409`), so a write to a pipe whose reader is closed does not give `EPIPE` there. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-13 23:27:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T23:27:04Z.


Thanks for the Windows control run. The focused test passes with this change and fails with the main source files, which gives useful independent confirmation of the EPIPE path on Windows.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157356087 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5265#issuecomment-6157356087). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T23:27:04Z. --- Thanks for the Windows control run. The focused test passes with this change and fails with the main source files, which gives useful independent confirmation of the EPIPE path on Windows.
oneandonlydean commented 2026-10-14 02:30:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:30:30Z.


Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159559280 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5265#issuecomment-6159559280). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T02:30:30Z. --- Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

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!5265
No description provided.