kernel_file_system test fails on main: guest PEEK and WAITALL preserve the wake bytes #505

Closed
opened 2026-11-26 09:24:13 +00:00 by github-bot · 1 comment
Owner

@⁠francoisatt on GitHub · 2026-09-07 19:23 UTC · original

On a clean checkout of main (6aa6e39), Windows x64, clang-cl 19.1.5, Ninja:

16/36 Test #16: kernel_file_system ... Exit code 0xc0000409
KernelFileSystemTests: failed: guest PEEK and WAITALL preserve the wake bytes

Reproducible on every run, no local changes. The other 35 tests pass.

Found while rebasing #490 — unrelated to that PR, it reproduces on main alone.

**@⁠francoisatt** on GitHub · 2026-09-07 19:23 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/505) On a clean checkout of main (6aa6e39), Windows x64, clang-cl 19.1.5, Ninja: 16/36 Test #16: kernel_file_system ... Exit code 0xc0000409 KernelFileSystemTests: failed: guest PEEK and WAITALL preserve the wake bytes Reproducible on every run, no local changes. The other 35 tests pass. Found while rebasing #490 — unrelated to that PR, it reproduces on main alone.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:24:13 +00:00
Author
Owner

@⁠NaN-Error on GitHub · 2026-09-07 20:42 UTC · original

Hi! I used ChatGPT's Astra Pro to investigate this issue and wanted to share a possible cause for review.

The AI-assisted analysis points to the receive path in src/libs/network.cpp at the reported commit, 6aa6e39. The guest's PEEK | WAITALL flags appear to be translated into MSG_PEEK | MSG_WAITALL and passed through to Winsock. Microsoft's recv documentation states that this combination fails with WSAEOPNOTSUPP, which seems consistent with the Windows failure reported here.

Reference:
https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recv

Checking WSAGetLastError() immediately after the failing native receive would help confirm whether this is the cause.

One possible approach to evaluate would be a Windows-only adjustment in Libs::Network::Net::Recvfrom that preserves MSG_PEEK but clears MSG_WAITALL when both are present. This would leave ordinary WAITALL-only receives unchanged and avoid modifying the shared flag-conversion function. However, someone familiar with the expected guest socket behavior would need to evaluate whether that is appropriate, particularly for partial reads and blocking behavior.

To be transparent, this investigation was AI-assisted and did not include native Windows execution or the complete emulator test suite. Please treat this as a possible explanation and proposed direction, not a confirmed or regression-tested fix.

Would this kind of AI-assisted investigation be helpful to the project? I'd be interested in continuing to examine selected issues with AI and sharing focused findings, supporting references, and possible solutions for a maintainer or contributor to evaluate and implement when appropriate.

My goal would be to help narrow down problems, not assume that AI-generated conclusions are correct or shift a large amount of verification work onto the maintainers. Before continuing, I'd appreciate your guidance on whether you welcome this kind of contribution and what level of validation or format you would expect.

Thanks for your work on the project!

**@⁠NaN-Error** on GitHub · 2026-09-07 20:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/issues/505#issuecomment-5575465539) Hi! I used ChatGPT's Astra Pro to investigate this issue and wanted to share a possible cause for review. The AI-assisted analysis points to the receive path in `src/libs/network.cpp` at the reported commit, `6aa6e39`. The guest's `PEEK | WAITALL` flags appear to be translated into `MSG_PEEK | MSG_WAITALL` and passed through to Winsock. Microsoft's `recv` documentation states that this combination fails with `WSAEOPNOTSUPP`, which seems consistent with the Windows failure reported here. Reference: https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-recv Checking `WSAGetLastError()` immediately after the failing native receive would help confirm whether this is the cause. One possible approach to evaluate would be a Windows-only adjustment in `Libs::Network::Net::Recvfrom` that preserves `MSG_PEEK` but clears `MSG_WAITALL` when both are present. This would leave ordinary `WAITALL`-only receives unchanged and avoid modifying the shared flag-conversion function. However, someone familiar with the expected guest socket behavior would need to evaluate whether that is appropriate, particularly for partial reads and blocking behavior. To be transparent, this investigation was AI-assisted and did not include native Windows execution or the complete emulator test suite. Please treat this as a possible explanation and proposed direction, not a confirmed or regression-tested fix. Would this kind of AI-assisted investigation be helpful to the project? I'd be interested in continuing to examine selected issues with AI and sharing focused findings, supporting references, and possible solutions for a maintainer or contributor to evaluate and implement when appropriate. My goal would be to help narrow down problems, not assume that AI-generated conclusions are correct or shift a large amount of verification work onto the maintainers. Before continuing, I'd appreciate your guidance on whether you welcome this kind of contribution and what level of validation or format you would expect. Thanks for your work on the project!
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/KytyPS5--KytyPS5#505
No description provided.