mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[PR #3418] [MERGED] Memory: Align size and address in posix_munmap #3450
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/3418
Author: @StevenMiller123
Created: 8/15/2025
Status: ✅ Merged
Merged: 8/15/2025
Merged by: @georgemoralis
Base:
main← Head:munmap-fix📝 Commits (3)
c190c69Properly align address and size in munmapb8a02efFormat len and phys_addr in mmap1f1b742Update memory.cpp📊 Changes
2 files changed (+6 additions, -3 deletions)
View changed files
📝
src/core/libraries/kernel/memory.cpp(+4 -3)📝
src/core/memory.cpp(+2 -0)📄 Description
From looking at the FreeBSD source code, munmap aligns down the address, and aligns up the size (like what's done for mprotect).
Fixing this resolves the a case of the following unreachable, which was encountered by War Thunder (CUSA00224) because we aligned size during a file mmap, but didn't perform the same alignment for the unmap.
CUSA00224 Main.log
CUSA00224 PR.log
I've also added parameter formatting to
posix_mmaplogging, since it's the only memory function where we didn't have any formatting for length, phys_addr, flags, or prot values.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.