fix(libc): route exception deleting destructors through guest heap #19864
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19864"
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 DonRyuzaki on 2026-11-14T04:06:47Z.
What
Use the existing guest operator delete for guest exception object storage. Plain/message exception D0 helpers, future_error's delete slot and filesystem_error's delete slot currently call host free, bypassing the application allocator used by guest operator new.
Keep shared message headers on their existing host heap, preserve RTTI/layout and nondeleting D1/D2 behavior, and leave runtime-owned thrown exception cleanup nondeleting. Update existing fixtures to allocate D0-owned objects through guest operator new and trim only the obsolete allocator-mismatch debt.
Tested
Linux, Ubuntu 24.04 under WSL2, GCC 13.3, Release; base
f83d7e1f5444bb813393c10af8422b4c33de31f9, headbf44da84ca968d640a18d60bbcef5d7bc5431b11, treef696829ac9332b90cb3436e0f09783f6b5b013ae.guest_libc_internal_deleting_destructorswithdirect D0 uses guest operator delete; normal filesystem, future-category and overflow controls pass.cmake --build build --target libs guest_libc_internal_deleting_destructors_tests guest_overflow_error_tests guest_future_category_tests guest_filesystem_error_tests --parallel 8passes.ctest --test-dir build --no-tests=error --output-on-failure -R '^guest_(libc_internal_deleting_destructors|overflow_error|future_category|filesystem_error)$': 4/4 pass, zero skips.fe3ca946f18bbf5c0087d58e03f419412ba18845; reproduce by taking this head's configured changed test/CMake fixture files onto the base, without its production changes. Runtime cache usesBUILD_TESTING=ON,FT_ENABLE_ERROR_STRINGS=OFF,CMAKE_LINK_DEPENDS_NO_SHARED=ONand pinned dependencies.git diff --checkandpython -B tools/check_conventions.py --base upstream/mainpass. The full checker required manual comparison of #13778, #13782, #14834, #15822, #17300, #18135, #19602 and #19609. All331 reported shared-file diff lines were read and heads/hashes verified. No same physical allocator fix or dependency was found. #14834 adds compatible sibling wrappers, but its old host-free debt sentence should be updated if merged after this PR. #17300 renames a time_put declaration/test symbol; retain that rename alongside these added checks. This is a manual overlap assessment, not a clean checker exit.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T05:53:21Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
bf44da84ca:tools/check_conventions.pypassed;git diff --checkclean.guest_libc_internal_deleting_destructors_tests,guest_overflow_error_testsbuilt cleanly.guest_overflow_error,guest_libc_internal_deleting_destructors):core/libs/prx/libc/src/exception/StandardExceptions.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T03:43:00Z.
Review: COMMENTED
Reviewed — no blocking findings
The code changes match the stated allocator fix; author-reported checks passed, but I did not run them independently.
What I ran
Reviewed head
bf44da84ca968d640a18d60bbcef5d7bc5431b11. No commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test results, Windows runtime behavior, console ABI behavior, and hardware behavior were not independently verified. Read all five files listed as reviewed in the manifest:
core/libs/prx/libc/src/exception/StandardExceptions.cpp,core/libs/tests/GuestLibcInternalDeletingDestructors.cpp,core/libs/tests/GuestMessageDestructorAbi.cpp,core/libs/tests/GuestOverflowError.cpp, anddocs/dev/debt/libSceLibcInternal.md. No changed files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T05:48:48Z.
Review: APPROVED
Reviewed — looks good
The changed exception deleting destructors route object release through the guest heap, and the inspected code and reported test evidence support merging.
What I ran
Inspected the prepared diff and changed files at head
d48521cad7eff09595de959e5435ee2979bd1248usingrepo_read.pyread tools. No tests or build commands were run in this review. Read all changed lines inStandardExceptions.cpp,GuestLibcInternalDeletingDestructors.cpp,GuestMessageDestructorAbi.cpp,GuestOverflowError.cpp, andfix-libc-internal-exception-delete-heap.md. The manifest lists all five changed files as included; none were excluded.Results
Negative control
Not run during this review. The author reports that the baseline plus final fixture fails the guest-delete assertion while the named control tests pass.
Findings
Blocking
None.
Non-blocking
None.
Sources
operator delete: StandardExceptions.cpp at the reviewed head, future_error and filesystem_error paths.Not verified
The reported Linux build and test runs, Windows compile-only evidence, baseline negative control, and manual overlap assessment were supplied in the PR description and were not rerun here. Windows runtime, console ABI/status, and game behavior were not verified. The review bundle contained all changed files; no changed file was excluded.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T04:39:44Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
457f0f25b0c08305f5b26eec38dbc081e7cd9829usingrepo_read.pyto read the prepared diff, changed lines, and targeted source context. I did not run build, test, or precheck commands. The description reports Linux test runs and Windows compile-only checks; those are author-reported results.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I did not independently run the reported Linux tests, Windows compilation, convention checks, or baseline negative control. Physical console behavior was not tested. I read all six changed files at their changed lines and read targeted context in
StdioExtras.cppandApplicationHeap.cpp. No changed files were excluded; the review bundle did not providefiles.json.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:48:10Z.
Review: COMMENTED
I ran
guest_libc_internal_deleting_destructors,guest_overflow_error, andguest_underflow_errorwith the patch applied on Linux. All three passed, exercising the guest heap release path in the patched deleting destructors.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.