Skip to content

fix(libSceNKWebKit): copy JSObjectMakeDeferredPromise outputs through GuestCopyOut - #22276

Closed
Gruzzberry wants to merge 1 commit into
boykopovar:mainfrom
Gruzzberry:nkjsc
Closed

Gruzzberry wants to merge 1 commit into
boykopovar:mainfrom
Gruzzberry:nkjsc

Conversation

@Gruzzberry

Copy link
Copy Markdown
Contributor

What

JSObjectMakeDeferredPromise in libSceNKWebKit wrote the resolve and reject handles straight through the title-supplied JSObjectRef* pointers. It now copies them out with GuestCopyOut_nid_no_patch. Valid pointers behave exactly as before.

Tested

Not compiled: there is no C++ compiler on this machine. tools/check_conventions.py --base upstream/main passes. I checked for duplicates with a script that compares this file against the changed files of every open PR; it found none, both before the commit and before the push.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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

🤖 Generated with Claude Code

… GuestCopyOut

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the prx label Nov 17, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

The copy-out result is ignored in both calls, so an unwritable resolve or reject pointer is dropped silently and the handle is leaked. The checked-copy pattern in DateParsing.cpp (parseDateFromNullTerminatedCharacters) throws std::invalid_argument when GuestCopyOut_nid_no_patch returns false. Please do the same here: check both return values, throw std::invalid_argument(std::string(func) + ": unwritable guest resolve pointer faults in WebKit") (and the reject equivalent), and release funcs[1] and the promise before throwing. A test in core/libs/prx/libSceNKWebKit/tests/Jsc.cpp that passes an unwritable pointer and expects the throw would pin it.

This was referenced Nov 21, 2026
@kiwe147

kiwe147 commented Nov 21, 2026

Copy link
Copy Markdown

Tested head 23c82bd92d, applied with git apply on main fd4aeed483 together with the other 28 PRs of one batch (#22366, #22943, #23994, #24150, #24483, #14625, #16796, #17425, #20528, #22589, #22887, #14505, #16792, #17900, #18484, #20048, #20099, #20517, #21636, #22886, #23659, #23880, #24047, #24100, #24248, #16353, #21683, #21714). All applied without conflicts and the whole tree built.

Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. GPUs: NVIDIA GeForce RTX 3080 (driver 621.24) and the AMD Radeon iGPU of the CPU (gfx1036, driver 32.0.21036.18). No validation layer. iGPU run: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ANYPS5_GPU="AMD Radeon", agc_/video tests only.

tests RTX 3080 iGPU
none: no test of its own in this PR - -

Whole batch: the full ctest -j 12 (6522 tests) on the RTX 3080 has 5 failing tests; the 4 that also fail on main fd4aeed483 are agc_driver_stencil_plane_memory, agc_driver_msaa_dcc_unwatch, agc_storage_write_back_host_retile, and pr_overlap_names, which needs a newer Python than my 3.10. Intermittent in this run (pass when rerun alone, or known flaky): agc_driver_store_over_untracked. Failing tests I could not trace to a single PR (reverting the likely candidates did not clear them): public_headers. The 2125 agc_/video tests on the iGPU have 2 failing: agc_driver_stencil_plane_memory, agc_driver_store_over_untracked (agc_driver_stencil_plane_memory also fails on main).

This is one combined tree, not a run of this PR alone.

AI-assisted: yes (Claude Code)

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

The change routes the two optional deferred-promise outputs through the checked guest-memory copy helper; I found no verified blocking defect in the reviewed path.

What I ran

Reviewed head 23c82bd92d0a3893e6b23d3761c693985315aa2c. I used the pinned repo_read.py reader interface to inspect the prepared diff and targeted code. No build or tests were run.

Results

Check Result Note
Diff and changed code passed One changed source file reviewed
Build and tests not run No execution performed

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author reports the conventions check passed and compilation was unavailable; neither was run or independently confirmed in this review. No runtime test was run. The changed file was read at the affected function and in relevant surrounding context; files.json was unavailable through the reader interface, so the reviewed-file inventory could not be cross-checked against it. The changed file is core/libs/prx/libSceNKWebKit/src/JscObject.cpp; no files were excluded by the manifest.

To get this to a good state

Nothing is required.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing as announced in the earlier comment on the combined-PR plan: this is one of several small same-library singles, and the combined PRs did not arrive within the 3 days given. Reviewers left it at changes requested and it has had no update since. Please reopen it as part of one combined PR per library if you still want it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants