[PR #1028] [MERGED] Add nullptr check in scePthreadSetprio function #1887

Closed
opened 2026-02-27 21:14:20 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1028
Author: @tGecko
Created: 9/22/2024
Status: Merged
Merged: 9/25/2024
Merged by: @georgemoralis

Base: mainHead: safeguard-set-prio-nullptr


📝 Commits (1)

  • d49b0ba Add nullptr check in scePthreadSetprio function

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 src/core/libraries/kernel/thread_management.cpp (+4 -0)

📄 Description

Apparently sometimes scePthreadSetprio gets called with 0 as thread. Guard against that.

With this, I can get past first menu and up until intro cutscene in CUSA03365 (Dark Souls III).
Before this, it crashed within a few seconds of starting up.

DS3 tries to set prio to nullptr-threads 7 times

image

image

Log with this: now crashes with vk::Device::waitForFences: ErrorDeviceLost in intro cutscene
shad_log.txt


🔄 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/1028 **Author:** [@tGecko](https://github.com/tGecko) **Created:** 9/22/2024 **Status:** ✅ Merged **Merged:** 9/25/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `safeguard-set-prio-nullptr` --- ### 📝 Commits (1) - [`d49b0ba`](https://github.com/shadps4-emu/shadPS4/commit/d49b0ba4f2bc78482e8e609628d3364b5711fb80) Add nullptr check in scePthreadSetprio function ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/thread_management.cpp` (+4 -0) </details> ### 📄 Description Apparently sometimes scePthreadSetprio gets called with 0 as thread. Guard against that. With this, I can get past first menu and up until intro cutscene in CUSA03365 (Dark Souls III). Before this, it crashed within a few seconds of starting up. DS3 tries to set prio to nullptr-threads 7 times ![image](https://github.com/user-attachments/assets/1358e49f-2345-43c1-95e4-cfd2622094c9) ![image](https://github.com/user-attachments/assets/0b0b0981-2420-4795-a585-2842a678d12d) Log with this: now crashes with `vk::Device::waitForFences: ErrorDeviceLost` in intro cutscene [shad_log.txt](https://github.com/user-attachments/files/17091219/shad_log.txt) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:14:20 +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#1887
No description provided.