mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[PR #1724] [MERGED] thread: Apply alternate signal stack to created threads. #2262
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#2262
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/1724
Author: @squidbus
Created: 12/10/2024
Status: ✅ Merged
Merged: 12/10/2024
Merged by: @raphaelthegreat
Base:
main← Head:sigstack📝 Commits (1)
c99c764thread: Apply alternate signal stack to created threads.📊 Changes
2 files changed (+28 additions, -3 deletions)
View changed files
📝
src/core/thread.cpp(+27 -3)📝
src/core/thread.h(+1 -0)📄 Description
With guest stacks in place, if the guest asks for a very small stack size we may overflow the stack in our signal handling. Notably this can happen to more threads on macOS, since we use signal handlers more heavily for patching a few instructions not supported by Rosetta 2.
To solve this, apply an alternate signal stack to each thread created. When signal handlers execute they will switch to this alternate stack instead of executing on the thread stack.
Fixes crashes launching CUSA04551 (NieR:Automata) on macOS, probably helps Linux and some other games as well.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.