docs(debt): note how a title uses the sceNetGetsockopt error value #10097

Merged
xXPBSXx merged 3 commits from upstream-pr/10097 into main 2026-10-26 14:08:21 +00:00
xXPBSXx commented 2026-10-23 08:58:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-23T08:58:34Z.


What

The changed entry now reads:

sceNetGetsockopt (libSceNet) reads SO_ERROR from the host socket. Winsock does not clear a socket's pending error when it is read, so on Windows the library reports a pending error once and shows it again only after a new sceNetConnect; a second failure with the same code on the same socket without a sceNetConnect in between would be hidden. One title (PPSA02225) disassembled for this entry has one call site (0x1056d34), with level 0xffff, option 0x1007 (the FreeBSD values of SOL_SOCKET and SO_ERROR; the title holds only the numbers) and a length variable set to 4 beforehand, reached only after a helper called with the value 2 returned true. For a negative result it takes the thread's error code as the value; for a result of 0 or more with a value of 0 it reports the connection as made, and otherwise it turns the value into an error code of its own. The call does not show how often the title reads it per connection attempt or whether it keeps using the socket after an error.

Changed: docs/dev/debt/libSceNet.md. No code change.

Method: Ghidra 12.1.4 headless on the unwrapped executable of the title named; the addresses are the call sites in that executable as Ghidra maps it, read from the instruction listing (static reading only, nothing run on a console). The listing and decompiled code are game code and are not attached.

Fixes: #10096

Tested

Documentation only. tools/check_conventions.py --base upstream/main passes; git merge-tree against main is clean. #9523 and #9931, which edited the same file, are merged; this branch was refreshed from main after that. #9542, which also edited docs/dev/debt/libSceNet.md, is merged; this branch was refreshed from main after that (head 10624a6ad1ae9ec1efc026e4415e6d114f522f94). Every number in the sentence was recounted against the instruction listing. Not built, not run, no title run.

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 (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes #10096
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4980345812 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10097). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-23T08:58:34Z. --- ### What The changed entry now reads: > [sceNetGetsockopt](../../../core/libs/prx/libSceNet/Export.cpp) (libSceNet) reads `SO_ERROR` from the host socket. Winsock does not clear a socket's pending error when it is read, so on Windows the library reports a pending error once and shows it again only after a new `sceNetConnect`; a second failure with the same code on the same socket without a `sceNetConnect` in between would be hidden. One title (PPSA02225) disassembled for this entry has one call site (0x1056d34), with level 0xffff, option 0x1007 (the FreeBSD values of `SOL_SOCKET` and `SO_ERROR`; the title holds only the numbers) and a length variable set to 4 beforehand, reached only after a helper called with the value 2 returned true. For a negative result it takes the thread's error code as the value; for a result of 0 or more with a value of 0 it reports the connection as made, and otherwise it turns the value into an error code of its own. The call does not show how often the title reads it per connection attempt or whether it keeps using the socket after an error. Changed: `docs/dev/debt/libSceNet.md`. No code change. Method: Ghidra 12.1.4 headless on the unwrapped executable of the title named; the addresses are the call sites in that executable as Ghidra maps it, read from the instruction listing (static reading only, nothing run on a console). The listing and decompiled code are game code and are not attached. Fixes: #10096 ### Tested Documentation only. `tools/check_conventions.py --base upstream/main` passes; `git merge-tree` against `main` is clean. #9523 and #9931, which edited the same file, are merged; this branch was refreshed from `main` after that. #9542, which also edited `docs/dev/debt/libSceNet.md`, is merged; this branch was refreshed from `main` after that (head `10624a6ad1ae9ec1efc026e4415e6d114f522f94`). Every number in the sentence was recounted against the instruction listing. Not built, not run, no title run. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes #10096 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-23 10:38:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T10:38:23Z.

Review: DISMISSED


The shortened entry now stays within the checker’s debt-length guidance and distinguishes the call-site’s visible argument/result handling from behavior that cannot be inferred. The exact-head conventions checker and git diff --check pass; hosted eligibility, conventions and labels pass. This is documentation-only, so runtime tests do not apply; hosted product build jobs are skipped by path policy.

Please refresh this branch from current main and coordinate the debt-file order with #9523, #9542 and #9931. The exact-head sync check reports 2 ahead/111 behind, with docs/dev/debt/libSceNet.md changed on both sides since #9060. Pairwise merges of these three PR heads with this head each conflict in that file. Please agree an order with those authors, add Depends on where appropriate, and re-run the overlap/conventions checks after resolving it. I also checked the uncomparable overlap reports: #9578 merges cleanly with this head; #5836's diff is in peer-socket/setsockopt paths, but its stale pairwise merge conflicts in Export.cpp, GuestSceNet.cpp and the debt file, so please recheck that comparison after refreshing.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5627095752 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10097#pullrequestreview-5627095752). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T10:38:23Z. **Review:** DISMISSED --- The shortened entry now stays within the checker’s debt-length guidance and distinguishes the call-site’s visible argument/result handling from behavior that cannot be inferred. The exact-head conventions checker and `git diff --check` pass; hosted eligibility, conventions and labels pass. This is documentation-only, so runtime tests do not apply; hosted product build jobs are skipped by path policy. Please refresh this branch from current `main` and coordinate the debt-file order with #9523, #9542 and #9931. The exact-head sync check reports 2 ahead/111 behind, with `docs/dev/debt/libSceNet.md` changed on both sides since #9060. Pairwise merges of these three PR heads with this head each conflict in that file. Please agree an order with those authors, add `Depends on` where appropriate, and re-run the overlap/conventions checks after resolving it. I also checked the uncomparable overlap reports: #9578 merges cleanly with this head; #5836's diff is in peer-socket/setsockopt paths, but its stale pairwise merge conflicts in `Export.cpp`, `GuestSceNet.cpp` and the debt file, so please recheck that comparison after refreshing.
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!10097
No description provided.