fix(libSceHttp2): return invalid value from sceHttp2Init for a maximum of 0 requests as measured in a PS5 payload #11730

Merged
ionut27001 merged 2 commits from upstream-pr/11730 into main 2026-10-28 16:45:02 +00:00
ionut27001 commented 2026-10-27 06:14:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ionut27001 on 2026-10-27T06:14:52Z.


What

sceHttp2Init threw for any maximum concurrent request count of 0 or below.

In a payload process on a PS5 (firmware 12.70), sceHttp2Init from /system/common/lib/libSceHttp2.sprx returned 0x817B11FE (invalid value) for a count of 0. The call used a valid libnet pool, a valid libssl context and a 64 KiB pool; a count of 1 with those same arguments returned 0x817B121D (pool too small).

This change returns 0x817B11FE for a count of 0. A negative count still throws: -1 with the 64 KiB pool produced no result before the runner's 60-second timeout, so it either hung or ended the process. In a second run, a count of 1 with a 1 MiB pool also produced no result, and the later counts in that run were not reached, so the accepted path and the smallest accepted pool are not measured either. In both runs the module's start routine returned 8, not 0, which may be related. The debt entry records these gaps.

Measured log (case lines, first run, 64 KiB pool, payload process, firmware 12.70):

case load path=/system/common/lib/libSceSsl.sprx ret_ok=1 start_result=0
case load path=/system/common/lib/libSceHttp2.sprx ret_ok=1 start_result=8
case resolve pool=1 pool_destroy=1 ssl_init=1 ssl_term=1 init=1 term=1
case net_pool ret_ok=1
case ssl_init ret_ok=1
case init max=1 ret=0x817b121d ok=0
case init max=0 ret=0x817b11fe ok=0

The next call, with a count of -1, produced no further output.

Overlaps: no open PR changes sceHttp2Init. The 0x817B11FE value is written inline, as the pool-size check in the same file does, so this PR adds no constant that #10536 or #11470 also define. git merge-tree shows no conflict between this head and #10536, #11630, #11627, #11617, #11616, #11611, #11586, #11575 or #11145. #11470 already conflicts with main in all three files this PR touches, and #11134 and #9598 already conflict with main; this PR does not change which of their files conflict.

Tested

Windows 11, WinLibs GCC 15.2.0, Release, on main 4291b04daf:

  • With this change: guest_http2 passes twice. It now checks that a count of 0 returns 0x817B11FE and that -1 throws.
  • Revert check: with Export.cpp from main, the test aborts (0xc0000409), because a count of 0 throws.

Not tested on Linux, nor with a title.

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: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5029504763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11730). Originally posted by [ionut27001](https://github.com/ionut27001) on 2026-10-27T06:14:52Z. --- ### What `sceHttp2Init` threw for any maximum concurrent request count of 0 or below. In a payload process on a PS5 (firmware 12.70), `sceHttp2Init` from `/system/common/lib/libSceHttp2.sprx` returned `0x817B11FE` (invalid value) for a count of 0. The call used a valid libnet pool, a valid libssl context and a 64 KiB pool; a count of 1 with those same arguments returned `0x817B121D` (pool too small). This change returns `0x817B11FE` for a count of 0. A negative count still throws: -1 with the 64 KiB pool produced no result before the runner's 60-second timeout, so it either hung or ended the process. In a second run, a count of 1 with a 1 MiB pool also produced no result, and the later counts in that run were not reached, so the accepted path and the smallest accepted pool are not measured either. In both runs the module's start routine returned 8, not 0, which may be related. The debt entry records these gaps. Measured log (case lines, first run, 64 KiB pool, payload process, firmware 12.70): ``` case load path=/system/common/lib/libSceSsl.sprx ret_ok=1 start_result=0 case load path=/system/common/lib/libSceHttp2.sprx ret_ok=1 start_result=8 case resolve pool=1 pool_destroy=1 ssl_init=1 ssl_term=1 init=1 term=1 case net_pool ret_ok=1 case ssl_init ret_ok=1 case init max=1 ret=0x817b121d ok=0 case init max=0 ret=0x817b11fe ok=0 ``` The next call, with a count of -1, produced no further output. Overlaps: no open PR changes `sceHttp2Init`. The 0x817B11FE value is written inline, as the pool-size check in the same file does, so this PR adds no constant that #10536 or #11470 also define. `git merge-tree` shows no conflict between this head and #10536, #11630, #11627, #11617, #11616, #11611, #11586, #11575 or #11145. #11470 already conflicts with `main` in all three files this PR touches, and #11134 and #9598 already conflict with `main`; this PR does not change which of their files conflict. ### Tested Windows 11, WinLibs GCC 15.2.0, Release, on `main` 4291b04daf: - **With this change:** `guest_http2` passes twice. It now checks that a count of 0 returns `0x817B11FE` and that -1 throws. - **Revert check:** with `Export.cpp` from `main`, the test aborts (0xc0000409), because a count of 0 throws. Not tested on Linux, nor with a title. ### 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: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 06:21:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T06:21:01Z.

Review: DISMISSED


The measured zero-count result and the code change are clearly scoped, and the debt entry records the unmeasured negative-count and valid-pool cases. There is one repository-policy blocker: #11470 and #10536 are still open and each has a content conflict with this head (git merge-tree confirms #11470 conflicts in Export.cpp and CMakeLists.txt, and #10536 conflicts in Export.cpp and the debt file). The PR description identifies the overlaps but does not record an agreed merge order or a Depends on entry. CONTRIBUTING requires that coordination. Please agree with the affected authors on the order and update the checklist; I did not find another code blocker in this pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5663014437 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11730#pullrequestreview-5663014437). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T06:21:01Z. **Review:** DISMISSED --- The measured zero-count result and the code change are clearly scoped, and the debt entry records the unmeasured negative-count and valid-pool cases. There is one repository-policy blocker: #11470 and #10536 are still open and each has a content conflict with this head (`git merge-tree` confirms #11470 conflicts in `Export.cpp` and `CMakeLists.txt`, and #10536 conflicts in `Export.cpp` and the debt file). The PR description identifies the overlaps but does not record an agreed merge order or a `Depends on` entry. CONTRIBUTING requires that coordination. Please agree with the affected authors on the order and update the checklist; I did not find another code blocker in this pass.
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!11730
No description provided.