mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-24 23:36:00 +03:00
[PR #2872] [MERGED] Core: Memory Fixes #3044
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#3044
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/2872
Author: @StevenMiller123
Created: 5/2/2025
Status: ✅ Merged
Merged: 5/9/2025
Merged by: @squidbus
Base:
main← Head:memory-fixes-again📝 Commits (10+)
3ce991fFix VirtualQuery behavior on low addresses.eb63db8Fix VirtualQuery struct725cfdcDefault name to anon66c4dedPlace an upper bound on returns from SearchFree3eb01e0More anons161a92fClang5c0f712Fix name in sceKernelMapNamedDirectMemoryf960896strncpy instead of strcpy0dcd372Fix name behavior4f45b05Error logging📊 Changes
4 files changed (+179 additions, -76 deletions)
View changed files
📝
src/core/libraries/kernel/memory.cpp(+30 -24)📝
src/core/libraries/kernel/memory.h(+8 -8)📝
src/core/memory.cpp(+134 -43)📝
src/core/memory.h(+7 -1)📄 Description
This PR makes our memory code more robust, preventing a variety of exceptions and strange behavior I observed when using my recently shared memory stress test homebrew on shadPS4.
OrbisVirtualQueryInfostruct. My homebrew was reading garbage data with the BitFields and array in place. I've replaced the BitField class use with C-style bitfields, and the std::array with a primitive char array instead.sceKernelVirtualQuery. Our previous code didn't check if the inputted address was below our vma map, which led to OOB memory accesses. My edge case error returns are based on hardware tests here.SearchFree. Our previous code encountered unpredictable behavior if the inputted address was too high, or if there were no free memory areas to map.FindVMAandFindDmemAreabehave.MapMemorywould assert when the area to map was only partially reserved.With these fixes, my memory homebrew now executes all tests on shadPS4. Many of the returned results are still inaccurate, but these are due to deeper issues that I believe are out of scope for this PR.
Currently:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.