fix(http): preserve context and epoll state on allocation failure #9630

Merged
Ondra97 merged 10 commits from upstream-pr/9630 into main 2026-11-08 04:19:10 +00:00
Ondra97 commented 2026-10-22 05:11:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T05:11:44Z.


What

Allocation failure can leave HTTP context or epoll ownership partly published. Initialization now treats main's pool-size registry, registered net/SSL IDs, context set and option initialization as one transaction: if any insertion fails, the unpublished context's entries are removed and existing contexts remain usable. Epoll handles are written only after registry insertion succeeds. Last-context termination detaches the existing epoll map with swap, avoiding an allocating teardown list after context removal.

The public-header review is addressed by including prx/libSceHttp/include/Http.hpp in HttpStateAllocation.cpp and removing all seven local export redeclarations. The one-shot allocation injector remains disarmed before throwing, so exception unwinding cannot reinject the same synthetic fault.

The current-main refresh also closes the rollback gap introduced by the two newer registries. The live-context regression queries both public registry APIs for the unpublished ID and checks that the existing context's pool stats and registered IDs remain valid. The fixture derives the attempted ID from this implementation's monotonic initializer; it makes no PS5 handle-layout claim. PS5 OOM errors and failed-call outputs remain unmeasured in debt, and creation may still throw std::bad_alloc.

The agreed order remains #9630 before cookie-store #10535 and draft transport #9834. #11134 depends on #9834 and carries its transport integration. None is a prerequisite for this standalone bookkeeping fix. Future composition must retain rollback across all registries and preserve both test blocks. The cookie/transport source and link additions discussed in the thread remain required for their combined allocation target; no new combined-stack run is claimed here.

Tested

Revalidated on 2026-10-30: base 556547da71c5e25b742f17b1ed9b27253b6e9d4d, submitted head cff855f72618fbee7bde0b866609854017ca5f9b. Main was merged into the existing branch, retaining the original allocator and epoll patches.

Windows 11 Pro 10.0.26300, AMD Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER (unused by these CPU tests); WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT; Release, BUILD_TESTING=ON, ANYPS5_ENABLE_SPIRV_TOOLS=ON, pinned bundled dependencies.

  • The full production relinker/libs, patched-library checker and all selected HTTP/HTTP2 test executables built successfully on the submitted sources.
  • 86/86 selected CTests passed, zero failures or skips: 65 public-header audit/compilation tests and 21 HTTP/HTTP2/library checks. All 374 patched libraries loaded, zero failures. The header audit verified 374 libraries and 23669 exports with unique declarations and umbrella coverage.
  • All seven allocation cases passed three consecutive repetitions, including init with/without a live context, failed epoll output preservation and termination budgets 0-3.
  • Before the include cleanup, the current-main merge reproduced all seven duplicate-declaration errors from the review. Afterward the standalone audit and all 65 header tests pass.
  • The extended live-context regression initially failed with failed init retained its pool-size registration on the header-fixed tree with the old rollback. Moving all three main-side registrations into the transaction and erasing them on failure makes the same test pass. The options registry insertion has the container's strong failure guarantee. The full suite and repeated allocation cases were then rerun on the final sources.
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
cmake --build build --target guest_http2_cookie_tests guest_http2_options_tests guest_http2_teardown_tests guest_http2_tests guest_http2_transport_tests guest_http_cache_tests guest_http_options_tests guest_http_response_header_tests guest_http_state_allocation_tests guest_http_tests libs patched_libraries_tests relinker --parallel 8
ctest --test-dir build -R '^(guest_http.*|public_headers.*|patched_libraries)$' -j 4 -V --output-on-failure --no-tests=error
ctest --test-dir build -R '^guest_http_state_.*$' -j 4 -V --repeat until-fail:3 --output-on-failure --no-tests=error
python tools/check_conventions.py --base origin/main
python tools/check_main_sync.py --base origin/main --strict
python tools/check_test_registration.py build
python tools/pr_overlap.py --branch codex/pr9630-header-fix-20261030 --repo boykopovar/AnyPS5 --jobs 4
git diff origin/main...HEAD --check

Conventions, strict main synchronization, whitespace and registration checks pass. The overlap report identifies #9834/#11134's transport transaction and #10535's adjacent CMake registration; the shared hunks were inspected and the existing dependency direction is retained. The transport variants already carry their own additional registry rollback, which must be combined with this standalone fix. No peer implementation was copied into this branch and no transport/cookie combined runtime validation is claimed.

No title, console, complete CTest suite or native Linux run of this refreshed head is claimed. The reviewer's Linux header/build/red-control results concern the stated earlier head and local header patch. Earlier author validation below remains historical.

Earlier submitted-revision validation (historical)

Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 31.66 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER. WinLibs GCC 15.2.0, Ninja Release, BUILD_TESTING=ON, ANYPS5_RELINKER_ONLY=OFF, bundled dependencies.

Current main base: b7d1d47a5f9f32c9c388ad8d47a0055a90ae6e33. Tested head: f66f955da716869c32b74a0d822e4ddea71ca43e. The regression executable compiles production Export.cpp and Options.cpp directly so its replacement C++ allocator reaches the real bookkeeping code. The red control and the Before values below were measured on the earlier base d6eafa54d0464258574fd2f71889754d05a5bc93; I did not rerun that control on the new base. The HTTP implementation and regression source were unchanged by the main merges. The original HTTP tests separately exercise the shared library.

Metric Before (base) After (fix)
New lifecycle regressions passed 1/7 7/7
Epoll creation budgets changing output after failure 2/8 0/8

With the one-shot injector, the unchanged base failed 6/7 new lifecycle tests in 0.25 s: initialization left partial state at budget 2 without an existing context and at budget 1 with one; epoll insertion changed the output in two failed calls; termination lost the context at budgets 0-2. The fix passed all 7 new tests and 28 budget scenarios: 8 for each initialization mode, 8 for epoll creation and 4 for termination. The base initialization probes stop at their first invalid state, so they do not complete all 28 scenarios. Successful epolls support polling/deletion, existing contexts survive failed creation, failed outputs remain untouched, and a fresh context cannot use epolls from a completed termination. No title or console was run.

The full all-target Windows build passed on the final head with BUILD_TESTING=ON, bundled dependencies and the complete default AGC execution-test set. #8310 is merged in the base; no source overlay was used. An initial sandboxed build stopped in the libusb version generator because Git Bash/MSYS could not create a named object (0xC0000022); the same incremental build completed outside that sandbox.

Final selected runtime tests: 12/12 passed, 0 skipped; 367 patched libraries loaded, 0 failed. Both changed translation units compile; conventions, registration (1,176 test executables, none built and unregistered), main-sync and whitespace checks pass. Registration is an executable count, not an executed-test count.

Commands, with the supported WinLibs toolchain on PATH and the full Release build configured in a sibling ../build directory:

cmake --build ../build --target guest_http_state_allocation_tests guest_http_tests guest_http_response_header_tests guest_http_options_tests --parallel 10
cmake --build ../build --parallel 10
ctest --test-dir ../build -R "^(guest_http2$|guest_http$|guest_http_(response_header|options|state_.*)$|patched_libraries$)" --parallel 4 -V
python tools/check_conventions.py --base origin/main
python tools/check_test_registration.py ../build
python tools/check_main_sync.py --base origin/main --strict
python tools/pr_overlap.py --branch codex/pr9630-final-sync-20261022 --repo boykopovar/AnyPS5 --jobs 8
git diff origin/main...HEAD --check

All commands above used the final submitted sources. The earlier red control temporarily compiled the regression target with unchanged earlier-base Export.cpp, then restored the source before the final build.

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:4962452924 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9630). Originally posted by [Ondra97](https://github.com/Ondra97) on 2026-10-22T05:11:44Z. --- ### What Allocation failure can leave HTTP context or epoll ownership partly published. Initialization now treats main's pool-size registry, registered net/SSL IDs, context set and option initialization as one transaction: if any insertion fails, the unpublished context's entries are removed and existing contexts remain usable. Epoll handles are written only after registry insertion succeeds. Last-context termination detaches the existing epoll map with `swap`, avoiding an allocating teardown list after context removal. The [public-header review](https://github.com/boykopovar/AnyPS5/pull/9630#pullrequestreview-5713471140) is addressed by including `prx/libSceHttp/include/Http.hpp` in `HttpStateAllocation.cpp` and removing all seven local export redeclarations. The one-shot allocation injector remains disarmed before throwing, so exception unwinding cannot reinject the same synthetic fault. The current-main refresh also closes the rollback gap introduced by the two newer registries. The live-context regression queries both public registry APIs for the unpublished ID and checks that the existing context's pool stats and registered IDs remain valid. The fixture derives the attempted ID from this implementation's monotonic initializer; it makes no PS5 handle-layout claim. PS5 OOM errors and failed-call outputs remain unmeasured in debt, and creation may still throw `std::bad_alloc`. The agreed order remains #9630 before cookie-store #10535 and draft transport #9834. #11134 depends on #9834 and carries its transport integration. None is a prerequisite for this standalone bookkeeping fix. Future composition must retain rollback across all registries and preserve both test blocks. The cookie/transport source and link additions discussed in the thread remain required for their combined allocation target; no new combined-stack run is claimed here. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Revalidated on 2026-10-30: base `556547da71c5e25b742f17b1ed9b27253b6e9d4d`, submitted head `cff855f72618fbee7bde0b866609854017ca5f9b`. Main was merged into the existing branch, retaining the original allocator and epoll patches. Windows 11 Pro 10.0.26300, AMD Ryzen 9 7900X, 31.7 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER (unused by these CPU tests); WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT; Release, `BUILD_TESTING=ON`, `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, pinned bundled dependencies. - The full production `relinker`/`libs`, patched-library checker and all selected HTTP/HTTP2 test executables built successfully on the submitted sources. - **86/86 selected CTests passed, zero failures or skips**: 65 public-header audit/compilation tests and 21 HTTP/HTTP2/library checks. All 374 patched libraries loaded, zero failures. The header audit verified 374 libraries and 23669 exports with unique declarations and umbrella coverage. - All **seven allocation cases passed three consecutive repetitions**, including init with/without a live context, failed epoll output preservation and termination budgets 0-3. - Before the include cleanup, the current-main merge reproduced all seven duplicate-declaration errors from the review. Afterward the standalone audit and all 65 header tests pass. - The extended live-context regression initially failed with `failed init retained its pool-size registration` on the header-fixed tree with the old rollback. Moving all three main-side registrations into the transaction and erasing them on failure makes the same test pass. The options registry insertion has the container's strong failure guarantee. The full suite and repeated allocation cases were then rerun on the final sources. ```powershell cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ cmake --build build --target guest_http2_cookie_tests guest_http2_options_tests guest_http2_teardown_tests guest_http2_tests guest_http2_transport_tests guest_http_cache_tests guest_http_options_tests guest_http_response_header_tests guest_http_state_allocation_tests guest_http_tests libs patched_libraries_tests relinker --parallel 8 ctest --test-dir build -R '^(guest_http.*|public_headers.*|patched_libraries)$' -j 4 -V --output-on-failure --no-tests=error ctest --test-dir build -R '^guest_http_state_.*$' -j 4 -V --repeat until-fail:3 --output-on-failure --no-tests=error python tools/check_conventions.py --base origin/main python tools/check_main_sync.py --base origin/main --strict python tools/check_test_registration.py build python tools/pr_overlap.py --branch codex/pr9630-header-fix-20261030 --repo boykopovar/AnyPS5 --jobs 4 git diff origin/main...HEAD --check ``` Conventions, strict main synchronization, whitespace and registration checks pass. The overlap report identifies #9834/#11134's transport transaction and #10535's adjacent CMake registration; the shared hunks were inspected and the existing dependency direction is retained. The transport variants already carry their own additional registry rollback, which must be combined with this standalone fix. No peer implementation was copied into this branch and no transport/cookie combined runtime validation is claimed. No title, console, complete CTest suite or native Linux run of this refreshed head is claimed. The reviewer's Linux header/build/red-control results concern the stated earlier head and local header patch. Earlier author validation below remains historical. <details> <summary>Earlier submitted-revision validation (historical)</summary> <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 Pro 10.0.26300; AMD Ryzen 9 7900X, 31.66 GiB RAM, NVIDIA GeForce RTX 4070 Ti SUPER. WinLibs GCC 15.2.0, Ninja Release, `BUILD_TESTING=ON`, `ANYPS5_RELINKER_ONLY=OFF`, bundled dependencies. Current main base: `b7d1d47a5f9f32c9c388ad8d47a0055a90ae6e33`. Tested head: `f66f955da716869c32b74a0d822e4ddea71ca43e`. The regression executable compiles production `Export.cpp` and `Options.cpp` directly so its replacement C++ allocator reaches the real bookkeeping code. The red control and the Before values below were measured on the earlier base `d6eafa54d0464258574fd2f71889754d05a5bc93`; I did not rerun that control on the new base. The HTTP implementation and regression source were unchanged by the main merges. The original HTTP tests separately exercise the shared library. | Metric | Before (base) | After (fix) | | --- | ---: | ---: | | New lifecycle regressions passed | 1/7 | 7/7 | | Epoll creation budgets changing output after failure | 2/8 | 0/8 | With the one-shot injector, the unchanged base failed 6/7 new lifecycle tests in 0.25 s: initialization left partial state at budget 2 without an existing context and at budget 1 with one; epoll insertion changed the output in two failed calls; termination lost the context at budgets 0-2. The fix passed all 7 new tests and 28 budget scenarios: 8 for each initialization mode, 8 for epoll creation and 4 for termination. The base initialization probes stop at their first invalid state, so they do not complete all 28 scenarios. Successful epolls support polling/deletion, existing contexts survive failed creation, failed outputs remain untouched, and a fresh context cannot use epolls from a completed termination. No title or console was run. The full all-target Windows build passed on the final head with `BUILD_TESTING=ON`, bundled dependencies and the complete default AGC execution-test set. #8310 is merged in the base; no source overlay was used. An initial sandboxed build stopped in the libusb version generator because Git Bash/MSYS could not create a named object (`0xC0000022`); the same incremental build completed outside that sandbox. **Final selected runtime tests: 12/12 passed, 0 skipped**; **367 patched libraries loaded, 0 failed**. Both changed translation units compile; conventions, registration (1,176 test executables, none built and unregistered), main-sync and whitespace checks pass. Registration is an executable count, not an executed-test count. Commands, with the supported WinLibs toolchain on `PATH` and the full Release build configured in a sibling `../build` directory: ```text cmake --build ../build --target guest_http_state_allocation_tests guest_http_tests guest_http_response_header_tests guest_http_options_tests --parallel 10 cmake --build ../build --parallel 10 ctest --test-dir ../build -R "^(guest_http2$|guest_http$|guest_http_(response_header|options|state_.*)$|patched_libraries$)" --parallel 4 -V python tools/check_conventions.py --base origin/main python tools/check_test_registration.py ../build python tools/check_main_sync.py --base origin/main --strict python tools/pr_overlap.py --branch codex/pr9630-final-sync-20261022 --repo boykopovar/AnyPS5 --jobs 8 git diff origin/main...HEAD --check ``` All commands above used the final submitted sources. The earlier red control temporarily compiled the regression target with unchanged earlier-base `Export.cpp`, then restored the source before the final build. </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
fogydes commented 2026-10-22 08:13:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:13:31Z.


The two failure paths are fixed the right way, verified against the diff: sceHttpCreateEpoll only writes *eh after the map insert succeeds (so nothing is published and the caller's value survives a throw), sceHttpTerm_nid_postfix swaps the whole map out under the lock instead of a move-out loop (no half-moved epolls left behind by a throw), and a failed AddHttpContext in sceHttpInit rolls back the context id it just registered. The injected bad_alloc tests cover both directions (rejected and shrinking-budget success), including the output invariants.

Two nits, neither blocking:

  1. CMakeLists.txt now carries two if(BUILD_TESTING) blocks whose tail duplicates the Windows PATH fixup for the same test directory; one block would be simpler.

  2. The term test walks budgets 0..3 while the init/create tests walk 0..7, so the term path sees fewer allocation-fault positions than its siblings do.

No conventions problems: no comments added, the debt entry records exactly what remains unverified (console OOM error values and failed-call outputs), and the inline // No network is emulated... comment predates the PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336045074 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9630#issuecomment-6336045074). Originally posted by [fogydes](https://github.com/fogydes) on 2026-10-22T08:13:31Z. --- The two failure paths are fixed the right way, verified against the diff: `sceHttpCreateEpoll` only writes `*eh` after the map insert succeeds (so nothing is published and the caller's value survives a throw), `sceHttpTerm_nid_postfix` swaps the whole map out under the lock instead of a move-out loop (no half-moved epolls left behind by a throw), and a failed `AddHttpContext` in `sceHttpInit` rolls back the context id it just registered. The injected `bad_alloc` tests cover both directions (rejected and shrinking-budget success), including the output invariants. Two nits, neither blocking: 1. `CMakeLists.txt` now carries two `if(BUILD_TESTING)` blocks whose tail duplicates the Windows `PATH` fixup for the same test directory; one block would be simpler. 2. The term test walks budgets 0..3 while the init/create tests walk 0..7, so the term path sees fewer allocation-fault positions than its siblings do. No conventions problems: no comments added, the debt entry records exactly what remains unverified (console OOM error values and failed-call outputs), and the inline `// No network is emulated...` comment predates the PR.
MarcZX10 commented 2026-10-22 09:22:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T09:22:48Z.

Review: CHANGES_REQUESTED


The allocation-failure fixes match the ownership invariants: init rolls back the inserted context, epoll output is published only after registry insertion, and termination swaps the existing map instead of allocating a teardown vector. The one-shot allocator avoids recursive fault injection during unwinding. The author reports 7/7 regressions on the fix versus 1/7 on base, plus 0/8 output changes after failed epoll creation, 11/11 selected runtime tests and a full Windows build. An independent review agrees with the key failure paths. I ran exact-head git diff --check and current-main conventions; both pass. Full hosted product jobs are skipped on this head, so the Windows results are author-reported; I did not rerun them locally. Minor test coverage note: termination explores budgets 0–3 while init/create explore 0–7, and CMake has duplicated Windows PATH setup; neither changes the core disposition. The change is generic with Unblocks: none. Coordinate merge order with #8357 as stated in the description.

I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611989894 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9630#pullrequestreview-5611989894). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T09:22:48Z. **Review:** CHANGES_REQUESTED --- The allocation-failure fixes match the ownership invariants: init rolls back the inserted context, epoll output is published only after registry insertion, and termination swaps the existing map instead of allocating a teardown vector. The one-shot allocator avoids recursive fault injection during unwinding. The author reports 7/7 regressions on the fix versus 1/7 on base, plus 0/8 output changes after failed epoll creation, 11/11 selected runtime tests and a full Windows build. An independent review agrees with the key failure paths. I ran exact-head `git diff --check` and current-main conventions; both pass. Full hosted product jobs are skipped on this head, so the Windows results are author-reported; I did not rerun them locally. Minor test coverage note: termination explores budgets 0–3 while init/create explore 0–7, and CMake has duplicated Windows PATH setup; neither changes the core disposition. The change is generic with `Unblocks: none`. Coordinate merge order with #8357 as stated in the description. I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
MarcZX10 commented 2026-10-22 12:57:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:57:24Z.

Review: CHANGES_REQUESTED


The allocation-failure fixes and regression results remain convincing. I independently ran exact-head whitespace/conventions checks, test registration (171 scripts), and Linux syntax checks for the changed HTTP implementation, options unit, and allocation test; all passed. The author reports 7/7 allocation regressions, 0/8 failed-create output mutations, 11/11 selected runtime tests, and a full Windows build. Product jobs are path-skipped in hosted CI, so those runtime results remain author-reported here.

I am withdrawing my earlier #5239 intake hold as a reason to defer this PR. The remaining repository requirement is a current-main base: this targets d6eafa5, while main is 15 commits ahead at 8b3a6ba. The intervening commits do not touch the HTTP files changed here, so the update should be low risk; please rebase and refresh conventions/overlap checks before merge. The ordering with #8357 is already agreed by both authors: this fix first, then #8357 rebases and carries rollback through its pool registry.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614517537 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9630#pullrequestreview-5614517537). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T12:57:24Z. **Review:** CHANGES_REQUESTED --- The allocation-failure fixes and regression results remain convincing. I independently ran exact-head whitespace/conventions checks, test registration (171 scripts), and Linux syntax checks for the changed HTTP implementation, options unit, and allocation test; all passed. The author reports 7/7 allocation regressions, 0/8 failed-create output mutations, 11/11 selected runtime tests, and a full Windows build. Product jobs are path-skipped in hosted CI, so those runtime results remain author-reported here. I am withdrawing my earlier #5239 intake hold as a reason to defer this PR. The remaining repository requirement is a current-main base: this targets `d6eafa5`, while `main` is 15 commits ahead at `8b3a6ba`. The intervening commits do not touch the HTTP files changed here, so the update should be low risk; please rebase and refresh conventions/overlap checks before merge. The ordering with #8357 is already agreed by both authors: this fix first, then #8357 rebases and carries rollback through its pool registry.
MarcZX10 commented 2026-10-28 22:24:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T22:24:16Z.

Review: APPROVED


The exact head f66f955da716869c32b74a0d822e4ddea71ca43e preserves the intended rollback invariants: failed initialization removes the unpublished context, epoll output is not published before registry insertion succeeds, and termination swaps the existing map instead of allocating during teardown. The author reports 7/7 lifecycle regressions on the fix versus 1/7 on the base, plus 11/11 selected HTTP tests and a full Windows build. An independent Windows run of the same head merged onto current main reports all 10 libSceHttp tests passing. The earlier Linux syntax, conventions, overlap, and test-registration checks also passed; hosted product jobs remain path-skipped, and I did not rerun a local build.

The order with #8357 and #10535 is documented, and the dependent #9834 author has been told its allocation test target needs source/link changes when stacked. No blocking correctness issue remains in this PR. Approved.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5690483115 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9630#pullrequestreview-5690483115). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T22:24:16Z. **Review:** APPROVED --- The exact head `f66f955da716869c32b74a0d822e4ddea71ca43e` preserves the intended rollback invariants: failed initialization removes the unpublished context, epoll output is not published before registry insertion succeeds, and termination swaps the existing map instead of allocating during teardown. The author reports 7/7 lifecycle regressions on the fix versus 1/7 on the base, plus 11/11 selected HTTP tests and a full Windows build. An independent Windows run of the same head merged onto current `main` reports all 10 libSceHttp tests passing. The earlier Linux syntax, conventions, overlap, and test-registration checks also passed; hosted product jobs remain path-skipped, and I did not rerun a local build. The order with #8357 and #10535 is documented, and the dependent #9834 author has been told its allocation test target needs source/link changes when stacked. No blocking correctness issue remains in this PR. Approved.
jotitadev commented 2026-10-30 14:05:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T14:05:46Z.

Review: COMMENTED


Merging this head into current main breaks public_headers.

Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. Head f66f955da7 merged (--no-commit) onto main f91137142e. The merge is clean, and the 7 guest_http_state_* tests pass 3/3.

public_headers fails. The PR's base b7d1d47a5f predates #10706, which requires each export to be declared once, in its library's public header. The extern "C" block in HttpStateAllocation.cpp declares 7 exports again that prx/libSceHttp/include/Http.hpp already declares:

sceHttpCreateEpoll: expected exactly one header declaration; found 2: core/libs/prx/libSceHttp/include/Http.hpp:48, core/libs/tests/HttpStateAllocation.cpp:17

The same happens for sceHttpInit_nid_postfix, sceHttpTerm_nid_postfix, sceHttpAuthCacheFlush, sceHttpGetNonblock, sceHttpDestroyEpoll and sceHttpWaitRequest. The build CI doesn't run on PRs, so it didn't show up here.

Including the header instead of the block fixes it:

 #include "prx/libc/include/general/VabiMacros.hpp"
+#include "prx/libSceHttp/include/Http.hpp"
 #include "prx/libSceHttp/src/HttpErrors.hpp"
...
-extern "C" {
-int APS5_VABI sceHttpInit_nid_postfix(int, int, std::uint64_t);
-...
-int APS5_VABI sceHttpWaitRequest(HttpEpollHandle, HttpNBEvent*, int, int);
-}
-

With that change, on the same merge:

  • The audit reports 0 errors; public_headers and the 64 public_headers_compile_* tests pass (65/65).
  • Full build OK. The 7 guest_http_state_* tests pass 3/3, and all HTTP/HTTP2 tests pass (19/19).
  • Control: with Export.cpp from main, 6 of 7 fail 3/3 (init, init_live, create_epoll, term_0 to term_2), the same as your red control.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5713471140 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9630#pullrequestreview-5713471140). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-30T14:05:46Z. **Review:** COMMENTED --- Merging this head into current `main` breaks `public_headers`. Ubuntu 26.04, i7-8700, GCC 15.2, Release, `BUILD_TESTING=ON`. Head `f66f955da7` merged (`--no-commit`) onto `main` `f91137142e`. The merge is clean, and the 7 `guest_http_state_*` tests pass 3/3. `public_headers` fails. The PR's base `b7d1d47a5f` predates #10706, which requires each export to be declared once, in its library's public header. The `extern "C"` block in `HttpStateAllocation.cpp` declares 7 exports again that `prx/libSceHttp/include/Http.hpp` already declares: ``` sceHttpCreateEpoll: expected exactly one header declaration; found 2: core/libs/prx/libSceHttp/include/Http.hpp:48, core/libs/tests/HttpStateAllocation.cpp:17 ``` The same happens for `sceHttpInit_nid_postfix`, `sceHttpTerm_nid_postfix`, `sceHttpAuthCacheFlush`, `sceHttpGetNonblock`, `sceHttpDestroyEpoll` and `sceHttpWaitRequest`. The build CI doesn't run on PRs, so it didn't show up here. Including the header instead of the block fixes it: ```diff #include "prx/libc/include/general/VabiMacros.hpp" +#include "prx/libSceHttp/include/Http.hpp" #include "prx/libSceHttp/src/HttpErrors.hpp" ... -extern "C" { -int APS5_VABI sceHttpInit_nid_postfix(int, int, std::uint64_t); -... -int APS5_VABI sceHttpWaitRequest(HttpEpollHandle, HttpNBEvent*, int, int); -} - ``` With that change, on the same merge: - The audit reports 0 errors; `public_headers` and the 64 `public_headers_compile_*` tests pass (65/65). - Full build OK. The 7 `guest_http_state_*` tests pass 3/3, and all HTTP/HTTP2 tests pass (19/19). - Control: with `Export.cpp` from `main`, 6 of 7 fail 3/3 (`init`, `init_live`, `create_epoll`, `term_0` to `term_2`), the same as your red control. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
jotitadev commented 2026-10-30 20:18:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T20:18:06Z.

Review: COMMENTED


Re-checked cff855f726 on Linux: public_headers passes now.

Ubuntu 26.04, i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. Head merged (--no-commit) onto current main 16345cad6a; clean merge, full build OK.

  • public_headers, the 64 public_headers_compile_* tests and the 7 guest_http_state_* tests: 72/72, 3 of 3 runs.
  • All HTTP tests: 20/20.
  • Red control: with Export.cpp from main, 6 of 7 guest_http_state_* still fail 3/3 (init, init_live, create_epoll, term_0 to term_2), same as before.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5718177963 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9630#pullrequestreview-5718177963). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-30T20:18:06Z. **Review:** COMMENTED --- Re-checked `cff855f726` on Linux: `public_headers` passes now. Ubuntu 26.04, i7-8700, GCC 15.2, Release, `BUILD_TESTING=ON`. Head merged (`--no-commit`) onto current `main` `16345cad6a`; clean merge, full build OK. - `public_headers`, the 64 `public_headers_compile_*` tests and the 7 `guest_http_state_*` tests: 72/72, 3 of 3 runs. - All HTTP tests: 20/20. - Red control: with `Export.cpp` from `main`, 6 of 7 `guest_http_state_*` still fail 3/3 (`init`, `init_live`, `create_epoll`, `term_0` to `term_2`), same as before. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
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!9630
No description provided.