[PR #2629] [MERGED] Handle error behavior in sceSysmoduleGetModuleInfoForUnwind stub #2872

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

📋 Pull Request Information

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

Base: mainHead: unwind-stuff


📝 Commits (3)

  • 3251433 Stubby implementation of sceSysmoduleGetModuleInfoForUnwind
  • ca4380e Update sysmodule.cpp
  • b0e3297 Minor cleanup

📊 Changes

4 files changed (+23 additions, -16 deletions)

View changed files

📝 src/core/libraries/kernel/process.cpp (+1 -13)
📝 src/core/libraries/kernel/process.h (+15 -0)
📝 src/core/libraries/system/sysmodule.cpp (+6 -2)
📝 src/core/libraries/system/sysmodule.h (+1 -1)

📄 Description

This PR partially implements sceSysmoduleGetModuleInfoForUnwind by calling sceKernelGetModuleInfoForUnwind and returning any errors that throws. I've avoided handling whatever internal struct libSceSysmodule uses here, since the struct seems to be somewhat different from the kernel's module info struct based on what I've decompiled, and the old return 0 behavior was working fine enough before.

Allowing this function to pass along errors fixes libc spamming sceKernelGetModuleInfoForUnwind calls with invalid addresses, fixing random crashes in Unity games caused by libc accessing invalid memory during exceptions.


🔄 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/2629 **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:** `unwind-stuff` --- ### 📝 Commits (3) - [`3251433`](https://github.com/shadps4-emu/shadPS4/commit/325143360ae27803bb0f73a861d76fe044c6bab6) Stubby implementation of sceSysmoduleGetModuleInfoForUnwind - [`ca4380e`](https://github.com/shadps4-emu/shadPS4/commit/ca4380ea1c649f4ce4522da291dc2e5b69c1d3de) Update sysmodule.cpp - [`b0e3297`](https://github.com/shadps4-emu/shadPS4/commit/b0e3297f4077b011f0ea7d3d53181366196deffd) Minor cleanup ### 📊 Changes **4 files changed** (+23 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/process.cpp` (+1 -13) 📝 `src/core/libraries/kernel/process.h` (+15 -0) 📝 `src/core/libraries/system/sysmodule.cpp` (+6 -2) 📝 `src/core/libraries/system/sysmodule.h` (+1 -1) </details> ### 📄 Description This PR partially implements `sceSysmoduleGetModuleInfoForUnwind` by calling `sceKernelGetModuleInfoForUnwind` and returning any errors that throws. I've avoided handling whatever internal struct libSceSysmodule uses here, since the struct seems to be somewhat different from the kernel's module info struct based on what I've decompiled, and the old return 0 behavior was working fine enough before. Allowing this function to pass along errors fixes libc spamming `sceKernelGetModuleInfoForUnwind` calls with invalid addresses, fixing random crashes in Unity games caused by libc accessing invalid memory during exceptions. --- <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:34 +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#2872
No description provided.