fix(libSceNKWebKit): implement WTF StringImpl destruction #14917
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14917"
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 w4rc0n on 2026-11-02T01:31:21Z.
What
WTF::StringImpl::destroy(StringImpl*)(_ZN3WTF10StringImpl7destroyEPS0_) was a parameterless throwing stub, so a guestderefthat dropped the last reference to any string threw. It now frees the string as the pinned PS5 WebKit 11.xStringImpl::~StringImplanddestroydo for internal, owned and substring buffers, through the same path the hostReleasealready used, so there is one implementation.s_refCountFlagIsStaticString) throwsstd::invalid_argument.std::runtime_errornaming them, because their tables and callbacks aren't modelled yet; the debt entry records it.WtfExports.hppand leaves the inventory.tools/pr_overlap.pyon this head, withmainat0eba5db30d: no other open PR changes this export orWtfAbi::Releaseor adds the same files. For the PRs it couldn't compare because they no longer merge withmain, GitHub's file lists show none of them changing this export orWtfAbi::Releaseeither. #14172 and #15241 change nearby lines in the same files; whichever merges later keeps both sides. The only exports it shares are with #14918, #14919 and #14920, in the same stack.Tested
Debian 12, GCC 12.2, Linux 6.18, Release, at the head
95dfdd5f7ea918208115e660db29009d06db3174, no local changes:guest_nkwebkit_dates,guest_nkwebkit_numbers,nkwebkit_base,nkwebkit_config,nkwebkit_constants,nkwebkit_fastbitvector,nkwebkit_jsc,nkwebkit_palsessionid,nkwebkit_preferences,nkwebkit_resourceresponse,nkwebkit_webcoregeometry,nkwebkit_wtf,guest_nkwebkit_urlsandpublic_headerspass. The newnkwebkit_wtfcases destroy, through the export, 8-bit and 16-bit internal strings, owned buffers on the host and guest paths, a string borrowing a literal (left untouched), and 8-bit and 16-bit substrings, whose owner gets its reference back.tools/progress.py: libSceNKWebKit 1313 implemented (1312 onmain),StringImpl::destroyamong them.tools/check_conventions.pypasses.feat/nkwebkit-external-stringsat its previous head393806839235d0b091a64e87b0245cd757bd924a, which contains this PR's commit. It is AnyPS5'sBuildworkflow, dispatched in the author's fork withselect=true: the branch merged intomainat93dbd0f82aea684e95f15f06e7d42c0064af18cf, built onwindows-latestwith WinLibs GCC 15.2 (MinGW-w64, UCRT). None of the 672 selected tests failed; 6 AGC tests were skipped, whichcheck_skips.pyaccepts. That includes the nine NKWebKit tests,public_headersandpatched_libraries. The later rebases ontomain(now0eba5db30d8a3d03789e52e5c1a9ff853e4e33e4, after #14479, #15228, #13766, #14925 and #15911) changed onlydocs/dev/debt/libSceNKWebKit.md, sogit range-diffshows the code and tests under test are the same as at that run. A fork-internal pull request existed only to give the workflow a number.Not built or run: macOS. No title or homebrew was run.
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 BunnyFl on 2026-11-02T03:36:11Z.
Review: APPROVED
Windows 11, WinLibs GCC 15.2.0 r7, Release. Head 18bf8fbc39 merged into upstream/main
93dbd0f82a:nkwebkit_wtf,nkwebkit_base,nkwebkit_config,nkwebkit_jsc,nkwebkit_preferences,nkwebkit_webcoregeometry,guest_nkwebkit_dates,guest_nkwebkit_numbers,nkwebkit_constantsandpublic_headers: 10/10 pass.Destroyno longer releasing a substring's owner (case 2),nkwebkit_wtffails. It fails at line 685, an existing substring check, before it reaches the newTestDestroy. That is because the hostReleaseand the export now shareDestroy, which is the point of the change.Read against the WebKit 11.x
~StringImpl/destroyyou pin:The tests check what's added without pinning those refusals.
Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-11-05T03:10:35Z.
Review: APPROVED
@w4rc0n re-checked after the force-push.
95dfdd5f7eis a rebase of18bf8fbc39, the head I approved:git range-diffshows no change to any code or test line. The only differences are hunk context and the dropped edit of the "Additional callable exports" count line indocs/dev/debt/libSceNKWebKit.md, whichmainhas since reworded.On
95dfdd5f7emerged ontomain0540ef0ef2(Windows 11, WinLibs GCC 15.2.0, Release,nkwebkit_wtf_testsrebuilt),nkwebkit_wtfpassed, 1 of 1. Withmain'score/libs/prx/libSceNKWebKit/src/WtfString.cppput back,nkwebkit_wtf_testsdoesn't link: the test calls exports that only this PR defines. That shows the test needs the change, not what it checks; the behavioural check is the mutation from my earlier review, on the old head.check_conventions.pypasses.pr_overlap.py --branch: the rows with the same exports are your own #14918, #14919 and #14920 (stacked on this one throughDepends on). The other comparable rows share lines inExport.cpp, the export headers or the debt file but no exports; I haven't checked each of them against this PR. The tool couldn't compare about 50 more PRs, which conflict withmain.Approving again at
95dfdd5f7e.AI-assisted: yes (Claude Code)
Pull request closed