feat(libSceNKWebKit): implement 47 exports whose module body is only a trap as std::terminate #23860
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23860"
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 RiverWhy on 2026-11-19T19:54:46Z.
What
Implements 47
libSceNKWebKitexports whose module body is only a trap (ud2; ud2, orint3; ud2for one). All 47 throwNotImplementedonmaintoday. Each now ends the process throughstd::terminate(), which is what the module does: the whole symbol is the trap and has no other bytes.Source: the
libSceNKWebKit.sprxwith SHA-2563af992253665387feeb5df90ff27dff683e3aa270cc4d92a0535b46ab18fa20d(the module the existing Constant-return exports debt entry reads as 11.00). Every export in the set was disassembled and its full symbol extent checked: 46 are 4 bytes0f0b0f0b, one is 3 bytescc0f0b.D0/D1, plus fourD0thunks forInspectorAuditAgent,InspectorRuntimeAgentandInspectorDebuggerAgent). The pinned WebKit source declares these destructors; it has no explicit trap in them, so the trap is compiler-emitted and this is corroborated only by the module.JSC::Identifier::checkCurrentAtomStringTable. The pinned WebKit source's non-debug body isNO_RETURN_DUE_TO_CRASH ... { CRASH(); }.The declarations are
[[noreturn]] voidwith no parameters, as the module reads none.Left out: 27 other trap-only exports that open PRs already change (#22680, #22682, #21979), and every body that has instructions besides the trap (4 candidates).
Debt: the fragment
docs/dev/debt/changes/feat-nkwebkit-module-trap-bodies.mdadds the Functional entry and removes the 43 inventory rows. 4 of the 47 (FrameLoaderClientD0/D1,ResourceHandleClientD0,InspectorTargetD0) have no inventory row, so only their declaration is removed.Overlap: I diffed the first 1000 listed open PRs against the 74 trap-only names. Only #22680, #22682 and #21979 remove stubs among them (excluded above). #23482 only references some destructors as vtable slots and does not touch their stubs.
How it was checked
Offline, against the module's own code (none of it is in the repository):
objdumpof each export's whole symbol, accepting onlyud2/int3instructions.In the repository, the new
nkwebkit_trapbodiestest:/dev/null), calls it, and requires death bySIGABRT. A call that throws instead of terminating (the oldNotImplementedstub) is distinguishable and fails.NotImplementedcall counter does not move.Tested
Linux Mint 22.3, GCC 13.3, Release:
nkwebkit_trapbodiespasses.tools/check_conventions.pypasses.core/libs/tests/test_public_headers.py --audit-only: 413 libraries, 34736 exports verified.git merge-treeagainst currentorigin/mainis clean.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-19T20:08:54Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
135c7111c5:tools/check_conventions.pypassed.nkwebkit_trapbodies_testsbuilt cleanly.nkwebkit_trapbodies):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/Api.hpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/TrapBodies.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-20T12:11:17Z.
Review: COMMENTED
Reviewed — no blocking findings
The implementation and integration changes look internally consistent, but I could not run the reported checks or independently verify the external module disassembly.
What I ran
Reviewed head
135c7111c5e5e0b32864eeb9cc458d2df2716f9c. No commands or tests were run; the reader interface allowed source inspection only.Results
Negative control
Not run; the PR description also says no negative control was run.
Findings
Blocking
None verified.
Non-blocking
None.
Sources
Reviewed
description.md,commits.md,manifest.json,diff.patch, and these changed repository files:include/Api.hpp,include/LegacyExports.hpp,include/TrapBodyExports.hpp,libSceNKWebKit.hpp,src/TrapBodies.cpp,tests/TrapBodies.cpp, anddocs/dev/debt/changes/feat-nkwebkit-module-trap-bodies.md. The changed regions inExport.cppandinclude/InventoryExports.hppwere inspected indiff.patch; their full source text was excluded from the review folder and was not independently read through the reader.Not verified
The PR's claims about the 47 symbol byte sequences, their complete symbol extents, and the module SHA-256 were not independently verified. Build, test, convention, and public-header audit results were not run by this reviewer. Windows behavior was not run or confirmed.
To get this to a good state
Nothing is required. Optional: independently confirm the binary audit and run the reported checks on this head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T13:47:36Z.
Review: APPROVED
Reviewed — looks good
Nothing in the reviewed code blocks merge; the change consistently replaces the selected stubs with terminating exports, though the reported checks and module disassembly were not independently run.
What I ran
Reviewed head
1628394d620a5689cae324bc989d8a40e2f46898. No build or test commands were run. I read the prepared description, commits, diff and manifest, then usedrepo_read.pyto inspect the changed implementation, test, export declarations, build configuration and debt entry. The two large changed files,Export.cppandInventoryExports.hpp, were not read in full; their relevant removals were inspected in the diff.Results
Findings
Blocking
None.
Non-blocking
SIGABRTas success (core/libs/prx/libSceNKWebKit/tests/TrapBodies.cpp:102). This matches the author-reported Linux run, but the test does not establish this behavior on other supported non-Windows systems; on Windows the death assertion is skipped (core/libs/prx/libSceNKWebKit/tests/TrapBodies.cpp:114-116). Consider documenting the tested platform scope or checking other supported platforms.Not verified
nkwebkit_trapbodies, convention checks or public-header audit; their reported results are from the PR description.Export.cppandInventoryExports.hppwere excluded from full-text review because of size; I inspected their changed hunks indiff.patch. Other changed files inspected:Api.hpp,LegacyExports.hpp,TrapBodyExports.hpp,libSceNKWebKit.hpp,src/TrapBodies.cpp,tests/TrapBodies.cpp, and the debt change entry.To get this to a good state
Nothing is required. The platform coverage note above is optional.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T03:55:51Z.
Review: COMMENTED
Actionable comments posted: 2
Architecture findings (1)
Advisory architecture findings (1)
010d3bdd-a77d-4b91-a5f3-a49828c8d989Reviewing files that changed from the base of the PR and between
aecfbf79b1and8401a68892.core/libs/prx/libSceNKWebKit/Export.cppcore/libs/prx/libSceNKWebKit/include/Api.hppcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppcore/libs/prx/libSceNKWebKit/include/LegacyExports.hppcore/libs/prx/libSceNKWebKit/include/TrapBodyExports.hppcore/libs/prx/libSceNKWebKit/libSceNKWebKit.hppcore/libs/prx/libSceNKWebKit/src/TrapBodies.cppcore/libs/prx/libSceNKWebKit/tests/TrapBodies.cppdocs/dev/debt/changes/feat-nkwebkit-module-trap-bodies.mdLimit details: You’ve used all 10 included reviews currently available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T07:57:25Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks merging; the inspected implementation and test wiring support the stated change.
What I ran
Reviewed head
8401a68892278bb461bb58f96ce3dde963b40e1busing the prepared diff and pinnedrepo_read.pyreader. No tests or build commands were run; the checks in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full
Export.cppwas excluded from the review bundle; its touched hunks were inspected indiff.patch, and the file’s include region was read through the repository reader. Full contents of the 5,458-lineInventoryExports.hppand 1,968-lineLegacyExports.hppwere not read; the relevant changed regions were inspected in the diff and at the pinned head. Binary symbol extents, platform-specific behavior, and the PR-reported Linux Mint, GCC, convention, header-audit, and merge-tree checks were not independently verified. Files reviewed from the manifest:Export.cpp,Api.hpp,InventoryExports.hpp,LegacyExports.hpp,TrapBodyExports.hpp,libSceNKWebKit.hpp,TrapBodies.cpp,tests/TrapBodies.cpp, anddocs/dev/debt/changes/feat-nkwebkit-module-trap-bodies.md. No manifest files were marked excluded by rule beyondExport.cppbeing too large for the review folder.To get this to a good state
Nothing is required. Optional: run the new test on Windows to exercise the platform’s non-fork checks.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:52:04Z.
Review: COMMENTED
Built the branch’s changed sources and ran TrapBodies on Linux against the existing runtime libraries. The test run passed and covered the fixture’s checks that the listed guest entry points terminate.
AI-assisted: yes.
Pull request closed