[PR #2623] [MERGED] sceKernelReleaseDirectMemory fix #2869

Closed
opened 2026-02-27 22:01:33 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2623
Author: @StevenMiller123
Created: 3/8/2025
Status: Merged
Merged: 3/9/2025
Merged by: @georgemoralis

Base: mainHead: memory-fixes


📝 Commits (3)

  • 01ad225 Fix error return on sceKernelMunmap
  • b5a1abb Early return on ReleaseDirectMemory with len = 0
  • 49bda18 Remove check for negative length in munmap

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 src/core/libraries/kernel/memory.cpp (+7 -1)

📄 Description

This addresses an issue with the ReleaseDirectMemory functions, where some games would hit an assert by calling them with len = 0. I also fixed an inaccurate error return in sceKernelMunmap (based on FreeBSD documentation), though I don't have any games that were hitting that error return.

This should fix some cases of [Debug] <Critical> memory.cpp:766 operator(): Assertion Failed!

This brings TerraTech (CUSA11362) ingame.
image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2623 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 3/8/2025 **Status:** ✅ Merged **Merged:** 3/9/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `memory-fixes` --- ### 📝 Commits (3) - [`01ad225`](https://github.com/shadps4-emu/shadPS4/commit/01ad225639deed2445b7b1f9f2d40259e9220a13) Fix error return on sceKernelMunmap - [`b5a1abb`](https://github.com/shadps4-emu/shadPS4/commit/b5a1abb7398eeb5e65fa11357d64541b48274f16) Early return on ReleaseDirectMemory with len = 0 - [`49bda18`](https://github.com/shadps4-emu/shadPS4/commit/49bda181c4bb80af471635c1ad05a09259a98e5e) Remove check for negative length in munmap ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/memory.cpp` (+7 -1) </details> ### 📄 Description This addresses an issue with the `ReleaseDirectMemory` functions, where some games would hit an assert by calling them with `len = 0`. I also fixed an inaccurate error return in `sceKernelMunmap` (based on FreeBSD documentation), though I don't have any games that were hitting that error return. This should fix some cases of `[Debug] <Critical> memory.cpp:766 operator(): Assertion Failed!` This brings TerraTech (CUSA11362) ingame. ![image](https://github.com/user-attachments/assets/49144ab2-14f4-4cf9-a792-9e344cbb551a) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:01:33 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2869
No description provided.