test(libSceIcu): check the closed mapping with msync so the test builds on macOS #23659
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23659"
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 Romannachwievor on 2026-11-19T11:56:36Z.
What
core/libs/prx/libSceIcu/tests/DataMemoryClose.cpp(from #23487) checks thatudata_closeunmapped the page by callingmincore(mapping, pageSize, &residency)with anunsigned charvector. The macOS SDK declaresint mincore(const void*, size_t, char*), so the file fails to compile on macOS ("no matching function for call to 'mincore'") and the full macOS build stops there. CI only builds the relinker on macOS, so this did not show up in the PR checks.Changing the vector type alone is not enough. On macOS,
mincoreon a page that was just unmapped returns 0 instead of failing withENOMEM, so the test then aborts at theRequire(mincore(...) == -1)line. A standalone C program on this machine (mmap one page, munmap it, call each function) gave:mincoremsync(MS_ASYNC)ENOMEMBoth checks now use
msync(mapping, pageSize, MS_ASYNC), which fails withENOMEMfor an unmapped range on Linux and macOS (both man pages) and returns 0 while the page is still mapped. Windows keeps itsVirtualQuerycheck.Tested
macOS 26.5 on an M1, x86_64 Release build under Rosetta 2, Apple clang 21.0.0, main
4fa81a86fbplus #17425 and #11049 (needed to build on macOS). The full build completes with this change.guest_icu_recovered_signaturespassed 3 of 3 runs. With only the vector type changed tochar, it failed at themincorecheck in 3 of 3 runs. The probe above gave the same results built for x86_64 and arm64.tools/check_conventions.py --base origin/mainpasses.Linux: PrivacyOnion built
guest_icu_recovered_signatures_testsand ranguest_icu_recovered_signatureson Ubuntu 24.04, GCC 13.3, Ninja, Release against this head; it passed.I did not run it on Windows.
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)AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T12:03:12Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
98707dd01e:tools/check_conventions.pyfailed.guest_icu_recovered_signatures_testsbuilt cleanly.guest_icu_recovered_signatures):Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T12:52:47Z.
Review: APPROVED
Reviewed — looks good
The changed assertions now check that
msyncrejects the unmapped range on POSIX, and the reviewed change has no verified blocking defects.What I ran
Reviewed head
98707dd01e0da81fec98c32b96181a3901c724d4usingrepo_read.pytools. No build or test commands were run.Read:
description.md,commits.md,manifest.json,diff.patch, and the full changed filecore/libs/prx/libSceIcu/tests/DataMemoryClose.cpp. The bundle listed one changed file, and its full text was included.files.jsonwas not available as a review document.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Builds and tests were not run by this review. Windows behavior was not verified; the author also reports not testing Windows.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Jazeupoi on 2026-11-20T10:45:52Z.
Review: COMMENTED
Ran it on a second Mac: Apple M4, macOS 27.0.1, Apple clang (Command Line Tools), x86_64 Release build under Rosetta 2. Head
98707dd01eapplied ontomaine825fa1492with #17425 and #11049 (needed for the macOS build); clean apply.guest_icu_recovered_signatures_testsmainDataMemoryClose.cpp:124and:164,no matching function for call to 'mincore'guest_icu_recovered_signaturespasses 3 of 3 (ICU recovered signature tests passed)AI-assisted: yes (Claude Code)
Pull request closed