Skip to content

test(libkernel): check msync over a page unmapped inside a mapping - #3195

Closed
hikazey wants to merge 1 commit into
boykopovar:mainfrom
hikazey:fix/msync-hole-docs
Closed

hikazey wants to merge 1 commit into
boykopovar:mainfrom
hikazey:fix/msync-hole-docs

Conversation

@hikazey

@hikazey hikazey commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

What

Since #1929, sceKernelVirtualQuery reports a mapping's live extents after a partial munmap (#1894). msync asks it about every page in its range, so a page unmapped from inside a larger mapping is now ENOMEM, as FreeBSD's vm_map_sync gives for an unmapped range. The TechnicalDebt line for msync, added in #1857 before #1929, still says the hole counts as mapped. This drops that clause and adds checks to guest_msync: with the middle of three pages unmapped, the outer pages still sync, and the hole, a zero-length call at the hole, and a range spanning it are ENOMEM. No code change.

The checks unmap the remaining pages one at a time, because munmap over a range with a hole fails (#3196).

Tested

Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release with CI's configure flags, on main f1ae427b (nothing under DirectMemory/ changed up to 06da1176):

build guest_msync
this branch 5/5 passed
msync checking only the first page failed (spanning-range check)

Linux not run (the test has no platform-specific code). tools/check_conventions.py passes.

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
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • 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
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

sceKernelVirtualQuery reports live extents since boykopovar#1929, so msync now
fails with ENOMEM for a hole punched by a partial munmap. Cover it and
drop the TechnicalDebt clause that said the hole still counts as mapped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the intake paused Closed while PR intake is limited to authors with at least 10 PRs merged into main label Oct 11, 2026
@github-actions

Copy link
Copy Markdown

Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

@github-actions github-actions Bot closed this Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

intake paused Closed while PR intake is limited to authors with at least 10 PRs merged into main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants