fix(libkernel): accept flag 0x8000 in sceKernelMapNamedFlexibleMemory #4896
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4896"
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 nabilfp on 2026-10-13T02:37:55Z.
What
sceKernelMapNamedFlexibleMemorypassed itsflagsstraight to the shared flexible-mapper, so the SDK 9 heap flag0x8000reachedMapPlaced, which rejects any bit outside its supported mask and throws:The two sibling entry points already ignore it:
sceKernelMapFlexibleMemorymasks it off before_mapFlexible, andsceKernelMapNamedFlexibleMemoryInternalis defined as the named call with the flag stripped. So the same caller succeeds through one export and throws through another, which is the inconsistency this fixes.The named variant now drops
0x8000too, and the Internal variant keeps delegating to it without its own copy of the mask. The libkernel debt entry that records flag0x8000as accepted-and-ignored now lists the named variant alongside the other two.Tested
Not tested on a console. The added
GuestMemorycase maps through the named export with0x8000set and checks the mapping and its range name; the existing cases for the unnamed and Internal variants (including the0x20000rejection) are unchanged.g++ -std=c++20 -fsyntax-onlyon the changed C++ files andtools/check_conventions.py --base upstream/mainpass.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 xXPBSXx on 2026-10-13T08:20:47Z.
Windows test of this PR.
Environment: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
BUILD_TESTING=ON,-j2,libusb-cmakefrom a local checkout. Built frommainc2565f014with this PR and ten other open PRs (#4972, #4967, #4966, #4945, #4938, #4936, #4933, #4898, #4896, #4888) merged together; the merges had no conflict.Result: guest_memory (1 of 1) pass.
Not checked: whether the test fails without the change in the library code; the PR was not tested alone, only in the combined merge; no title run; Linux not tested.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by coltken95 on 2026-10-13T12:04:07Z.
Tested on Linux x86-64 (Release build), with
c464c1216cherry-picked onto main5d50886ee:guest_memorypasses.DirectMemory/Export.cppand the PR's test:guest_memoryaborts withstd::invalid_argument: Unsupported memory mapping flags 0x8000Imported from boykopovar/AnyPS5. Originally posted by nabilfp on 2026-10-13T12:15:20Z.
Thanks for the Linux verification. The tested head
c464c1216is the current head of this branch, so the result stands:guest_memorypasses with the change and aborts onmainwith the PR's test (Unsupported memory mapping flags 0x8000). That is the fail-on-main / pass-with-fix evidence the PR was missing. Appreciated.Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:36:38Z.
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.
Pull request closed