test(http2): guard allocation-free handle teardown #9598
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9598"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T03:58:53Z.
What
Keep regression coverage for allocation-free HTTP2 handle teardown on the current transport backend. Main's synchronous transport implementation already replaced the temporary-vector cleanup and removed the old offline completion queue, so this rebased PR changes only the test and its CMake registration. Production
Export.cppis byte-identical to the base.The fixture calls the canonical public header and compiles the current production
Export.cppandCookies.cppwith the real transport dependency, allowing its replacement C++ allocator to observe teardown allocations. It checks request, template and context deletion under budgets 0–15: descendants disappear, neighboring templates and independent contexts survive, cookie boxes retain their separate ownership, and deletion makes no allocation attempt. The one-shot fault disarms before throwing so exception unwinding can allocate.The 192 concurrent cases now race child creation against deletion and check that no created handle escapes its parent's teardown. The removed async completion model is not restored. The new fixture covers unsent handles; existing HTTP2 transport fixtures remain registered and are included in the validation selection.
Tested
Base
ea048ce2c35e1fb65ea3331ed73bba35cb27e584; tested head7a0dfeb79c3d440738cf87762eafe07c96ceb1cf. Windows 11 Pro 10.0.26300, Ryzen 9 7900X, 31.7 GiB RAM, RTX 4070 Ti SUPER; WinLibs MinGW-w64 GCC 15.2.0 r7 UCRT, CMake 4.3.1, Ninja 1.13.2, Release,BUILD_TESTING=ON, pinned bundled dependencies. CPU and local socket fixtures.libs,patched_libraries_tests,guest_http2_tests,guest_http2_cookie_tests,guest_http2_transport_tests,guest_http2_teardown_tests,guest_http_tests,guest_http_response_header_tests,guest_http_options_tests,guest_ssl_tests,guest_ssl_load_tests,guest_ssl_transport_tests,guest_ssl_ps5_readers_testsandguest_sce_net_testswithcmake --build <build> --target <targets> --parallel 8.ctest --test-dir <build> -R '^(guest_http2.*|guest_http(_response_header|_options)?|guest_ssl(_load|_transport_kernel|_transport_net|_ps5_readers)?|guest_sce_net|patched_libraries)$' -V --output-on-failure --no-tests=error --repeat until-fail:3: 16/16 passed in all three repetitions, zero skips, 19.56 s total, outside the sandbox so the local socket fixtures can run. Each library-load check loaded 368 patched libraries, zero failures.Export.cppbyte-for-byte, rebuilt, and reran the complete green selection. This is a deliberate mutation, not a claim that current main still contains the original bug.ctest --test-dir <build> -R '^public_headers($|_compile_)' -j 4 --output-on-failure --no-tests=error: 65/65 passed, zero skips.tools/pr_overlap.pycompleted. Its #9598 entries refer to this existing PR under its old branch head. #6044 is closed. The remaining uncomparable #11470 CMake edit addslibSceHttpto the production library's link dependencies, separately from this PR's new test target; I inspected that edit manually.No full CTest suite, title or console run is claimed. Earlier offline-completion measurements and Linux reports apply to the old implementation and are not evidence for this rewritten fixture.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:07:06Z.
Review: APPROVED
The teardown now erases descendants and queued completions while holding the existing handle-then-completion lock order, without allocating temporary vectors. I checked that submission uses the same lock order and
WaitAsynctakes only the completion lock; the new fault-injection and submission/deletion tests cover the main ownership paths. The PR report is unusually clear about synthetic scope, actual executed counts, the temporary #8310 build overlay, and unverified console/event behavior. The intervening commits since tested based9c99c9are documentation-only, so they do not affect this implementation or the reported focused tests. Hosted conventions, eligibility, intake, labels and report checks pass; hosted product/relinker jobs are skipped. The Windows build/tests are author-reported, with an independent test comment also present. I did not run tests locally.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T04:42:18Z.
Review: COMMENTED
Linux run, since the description lists only Windows 11. The fix passes, but on Linux the test cannot show its red: with the base
Export.cppit hangs until the 30 s ctest timeout instead of printing the failure counts.Machine: Linux x86_64, i7-8700, Ubuntu 26.04 (kernel 7.0.0-38), GCC 15.2, Release,
BUILD_TESTING=ON. Headfdd048978merged--no-commitontomainab347d144(clean).With the PR:
guest_http2_teardownandguest_http2pass, 3 of 3 runs.Base
Export.cppplus this test:guest_http2_teardownis***Timeout 30.04 sec, with no output. The process is single-threaded and parked in a futex. Backtrace (gdb, first lifecycle,DeleteRequestat budget 0):On this build the test executable's throw goes through
libc.prx's unwinder.FindFrameFastallocates while it holds its lock, the replacedoperator newis still at budget 0 and throws again, and the nested throw blocks on the same lock. So any regression that allocates in teardown shows up on Linux as a timeout, not as thethrew=… ownership=…lines.Disarming the budget before the throw fixes that here:
With that change, base
Export.cppprints48 failures(23 withthrew=1), which matches the 23bad_allocin your table. With the PR it prints0 failures(3 of 3 runs). The PR's own result doesn't change, because the fixed teardown never allocates under the budget.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T07:09:16Z.
Review: COMMENTED
Re-ran on Linux after
99d261595(budget disarmed before the throw).Machine: Linux x86_64, i7-8700, Ubuntu 26.04, GCC 15.2, Release. Head
58e6b6b56merged--no-commitontomaind6eafa54d(clean).guest_http2_teardownprints48 allocation-pressure lifecycles, 192 concurrent lifecycles, 0 failures, 3 of 3 runs.guest_http,guest_http2,guest_http_optionsandguest_http_response_headeralso pass.Export.cppplus this test: no more timeout. It exits 1 in 0.02 s with48 failures, 23 of themthrew=1, which matches the Windows table.So the red is now visible on Linux as well.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T09:31:47Z.
Rechecked the current head after the independent Linux follow-up: the approval still stands, and exact-head conventions plus whitespace checks pass. The Linux reviewer now reports 3/3 green runs and a visible 48-failure base control after the injector disarms before throwing. #6044 changes the broad CMake test naming/registration scheme but does not touch the HTTP2 implementation; please resolve/rebase the test-registration overlap and rerun registration/build checks after its merge if needed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T13:21:47Z.
Review: DISMISSED
The failure-atomic teardown fix still has strong Windows evidence and an independent Linux red/green run after the allocator injector was made unwinding-safe. Exact head
58e6b6b5653d888955b39924beaf17f1f1a4dc0fpasses current-main whitespace and conventions checks; the current-main merge tree is clean. I also syntax-compiledExport.cppandHttp2TeardownFailure.cppwith GCC 12.2 (suppressing existing unused-parameter/missing-field warnings inExport.cpp). I did not run the runtime tests locally.The branch is based on
b27924d851696cafcb83152515f1c84d8804e1f3, behind current main3ca07d086d5f44fbe3c00370e7f03953ab46ca1b. Please update to current main and refresh focused tests, conventions, and registration checks. #6044 remains open and its test reorganization overlaps the broad CMake changes; the direct merge reports no conflict in this PR'slibSceHttp2/CMakeLists.txt, but please preserve theguest_http2_teardownregistration and rerun its build/registration checks after either branch is rebased. This request is only for the current-main and test-registration update; the code approval stands and the obsolete intake hold is withdrawn.