fix(libkernel): report no sender for stream recvfrom calls #3957

Merged
MarcZX10 merged 1 commit from upstream-pr/3957 into main 2026-10-12 03:11:06 +00:00
MarcZX10 commented 2026-10-11 19:51:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T19:51:37Z.


What

Carries Hussein Kadhim's fix for #3942, preserving the original commit author. A stream socket has no sender address for recvfrom; when the host provides no IPv4 or IPv6 address, the guest call now reports an address length of zero and leaves the address buffer untouched. UDP sender-address behavior is unchanged.

Tested

  • Linux x86-64, GCC 12.2.0, Release, BUILD_TESTING=ON, on current main 4be9c255: built guest_tcp_tests; guest_tcp passed 1/1.
  • The issue author reports the new TCP case fails on the unmodified Windows branch and passes with the fix. Their Windows probes cover IPv4/IPv6 TCP and UDP behavior, peek, truncated and zero-length buffers, EOF, and socket pairs.
  • tools/check_conventions.py --base upstream/main and git diff --check passed.
  • No title run reported.

Checklist

  • Based on current main; no other open PR implements this behavior
  • One topic per PR; follow-ups go in a new PR
  • No source comments added
  • Unsupported paths retain explicit errors
  • No investigation notes added
  • No new third-party code
  • Generic behavior, not title-specific
  • Depends on: none
  • AI-assisted: yes; original contributor's commit and attribution preserved
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4821865463 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3957). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T19:51:37Z. --- ### What Carries Hussein Kadhim's fix for #3942, preserving the original commit author. A stream socket has no sender address for `recvfrom`; when the host provides no IPv4 or IPv6 address, the guest call now reports an address length of zero and leaves the address buffer untouched. UDP sender-address behavior is unchanged. ### Tested - Linux x86-64, GCC 12.2.0, Release, `BUILD_TESTING=ON`, on current `main` `4be9c255`: built `guest_tcp_tests`; `guest_tcp` passed 1/1. - The issue author reports the new TCP case fails on the unmodified Windows branch and passes with the fix. Their Windows probes cover IPv4/IPv6 TCP and UDP behavior, peek, truncated and zero-length buffers, EOF, and socket pairs. - `tools/check_conventions.py --base upstream/main` and `git diff --check` passed. - No title run reported. ### Checklist - [x] Based on current `main`; no other open PR implements this behavior - [x] One topic per PR; follow-ups go in a new PR - [x] No source comments added - [x] Unsupported paths retain explicit errors - [x] No investigation notes added - [x] No new third-party code - [x] Generic behavior, not title-specific - [x] Depends on: none - [x] AI-assisted: yes; original contributor's commit and attribution preserved
LeandroLP23 commented 2026-10-11 20:43:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-11T20:43:54Z.


Windows run of this head (87e9c7015, on main 12c226628): Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, full build.

  • guest_tcp, guest_udp, guest_socket_read_write, guest_poll, guest_socket_pair, guest_dup and guest_socket_events: 7/7 pass in 3 runs.
  • With Udp.cpp reverted to main, guest_tcp aborts (0xc0000409) in the new StreamReceiveReportsNoSender test, so on Windows the test catches the bug and the fix is what makes it pass.
  • Merge note: this PR, #3947 and #3958 each add their test call at the top of main() in GuestTcp.cpp, so any two of them conflict there (Udp.cpp merges cleanly). The second and third to land will need a small rebase.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113548963 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3957#issuecomment-6113548963). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-11T20:43:54Z. --- Windows run of this head (`87e9c7015`, on `main` `12c226628`): Windows 11 (26300), WinLibs GCC 15.2.0 r7, Release, full build. - `guest_tcp`, `guest_udp`, `guest_socket_read_write`, `guest_poll`, `guest_socket_pair`, `guest_dup` and `guest_socket_events`: 7/7 pass in 3 runs. - With `Udp.cpp` reverted to `main`, `guest_tcp` aborts (`0xc0000409`) in the new `StreamReceiveReportsNoSender` test, so on Windows the test catches the bug and the fix is what makes it pass. - Merge note: this PR, #3947 and #3958 each add their test call at the top of `main()` in `GuestTcp.cpp`, so any two of them conflict there (`Udp.cpp` merges cleanly). The second and third to land will need a small rebase.
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!3957
No description provided.