[PR #3246] [MERGED] Core: Fix read-only file unmaps on Windows #3332

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3246
Author: @StevenMiller123
Created: 7/15/2025
Status: Merged
Merged: 7/15/2025
Merged by: @georgemoralis

Base: mainHead: mem-fix


📝 Commits (2)

📊 Changes

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

View changed files

📝 src/core/memory.cpp (+3 -3)

📄 Description

By using the created post_merge_vma to check protections, readonly_file would always be false since the created VMA has prot MemoryProt::NoAccess. In games that try unmapping a read-only file, this would cause a crash for Windows users since we don't have a proper file mapping at that address.

Fixes Genshin Impact (CUSA23681) crashing on a memory error on boot. It doesn't get much further though, since it needs alertable event flag waits.


🔄 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/3246 **Author:** [@StevenMiller123](https://github.com/StevenMiller123) **Created:** 7/15/2025 **Status:** ✅ Merged **Merged:** 7/15/2025 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `mem-fix` --- ### 📝 Commits (2) - [`63bbe08`](https://github.com/shadps4-emu/shadPS4/commit/63bbe08631c4542008f8add31a80a03a5848bc28) Fix read-only file unmaps - [`6d8bdb8`](https://github.com/shadps4-emu/shadPS4/commit/6d8bdb808a901520cbe4172cf0a3e3dacfb304b1) Slight cleanup ### 📊 Changes **1 file changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/core/memory.cpp` (+3 -3) </details> ### 📄 Description By using the created `post_merge_vma` to check protections, `readonly_file` would always be false since the created VMA has prot `MemoryProt::NoAccess`. In games that try unmapping a read-only file, this would cause a crash for Windows users since we don't have a proper file mapping at that address. Fixes Genshin Impact (CUSA23681) crashing on a memory error on boot. It doesn't get much further though, since it needs alertable event flag waits. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:19 +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#3332
No description provided.