Repository navigation
fix(libSceNgs2.native): clear the buffer info through guest copies in sceNgs2RackDestroy and sceNgs2SystemDestroy - #20970
Merged
oneandonlydean merged 4 commits intoNov 15, 2026
Conversation
… in sceNgs2RackDestroy sceNgs2RackDestroy cleared the optional guest buffer info by writing through its pointer before any other check, so an unmapped output faulted the host. The output is now cleared with WriteGuest before the rack is looked up or destroyed, so an unwritable output returns SCE_NGS2_ERROR_INVALID_OUT_ADDRESS without destroying anything. A writable output is cleared as before, and a null output is still skipped.
…ckDestroy An unwritable buffer info must return SCE_NGS2_ERROR_INVALID_OUT_ADDRESS and leave the rack alive, so a later destroy with a null buffer info still succeeds.
…st in sceNgs2SystemDestroy sceNgs2SystemDestroy cleared the optional guest buffer info by writing through its pointer before any other check, so an unmapped output faulted the host. The output is now cleared with WriteGuest before the system is looked up or destroyed, so an unwritable output returns SCE_NGS2_ERROR_INVALID_OUT_ADDRESS without destroying anything. A writable output is cleared as before, and a null output is still skipped.
…stemDestroy An unwritable buffer info must return SCE_NGS2_ERROR_INVALID_OUT_ADDRESS and leave the system alive, so a later destroy with a null buffer info still succeeds.
ycbuzi
added a commit
to ycbuzi/AnyPS5
that referenced
this pull request
Nov 15, 2026
Contributor
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
Merged
12 tasks done
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sceNgs2RackDestroyandsceNgs2SystemDestroycleared the optional guestNgs2ContextBufferInfoby writing through the caller's pointer, before any other check. An unmapped output faulted the host.WriteGuestbefore the rack is looked up or destroyed. An unwritable output returnsSCE_NGS2_ERROR_INVALID_OUT_ADDRESSand destroys nothing, so the caller can retry with a valid pointer. A null output is still skipped, and a writable output is cleared as before.Commits: one
fixand onetestper function, four in total. Eachfixand eachtestbuilds and passes on its own.No external source is needed: the change only writes the cleared struct, and the error code is the one this library already returns for its other unwritable outputs.
Tested
Host: Linux, kernel 6.1, x86_64. Throwaway archive build of the tree, with the CPU startup gate patched in that build only (no change to HostCpu.cpp in this branch).
948669f491, onupstream/main31a13a37e6: all 49ngs2_*tests Passed (35 test executables built), includingngs2_handleerrors, which covers the new cases.ngs2_handleerrorsrun on its own; all pass.upstream/main'sRack.cppandSystem.cppand this branch's tests,ngs2_handleerrorsstops with SIGSEGV at address0x10, the unwritable output the new cases pass.pr_overlap.pyfailed closed:sceNgs2RackCreateandsceNgs2RackCreateWithAllocatorand adds tests toNgs2HandleErrors.cpp. It calls both destroy functions only with a null output, which this PR does not change. The textual merge may conflict inNgs2HandleErrors.cppnearmain, where both PRs add a check; the resolution is to keep both checks.CheckedRackOption,DefaultRackOptionandsceNgs2SystemSetSampleRate, not the destroy functions.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)