AnyPS5/core/libs/prx/libkernel
NevesHenry faf983ae01 fix(libkernel): give Linux guest threads the stack size they request
scePthreadCreate on Linux started guest threads with std::thread, so every
thread got the host default stack (RLIMIT_STACK, usually 8 MiB) whatever the
title asked for. A thread that asks for more than that and uses it crashes
with SIGSEGV. Once the thread ran, scePthreadAttrGet also reported the host
size instead of the requested one.

Create the thread with pthread_create and a stack of the requested size plus
what glibc keeps at its top (static TLS, the thread control block and the
start_thread frame). That reserve is measured once with a probe thread.
The thread reports [top - reserve - size, top - reserve) as its stack, as
Windows reports [top - size, top), and the creator waits until the range is
set, as on Windows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 08:57:00 +02:00
..
Aio/src fix(kernel): keep the file offset in Windows AIO reads and writes 2026-10-10 00:22:22 +02:00
AppMetadata fix(kernel): skip the download0 mount when param.json cannot be read 2026-10-08 16:07:18 +02:00
Apr Merge pull request #2357 from NahuelGenchi/fix/apr-submit-unconstructed-buffer 2026-10-10 17:47:18 +13:00
DirectMemory fix(libkernel): reject malformed ranges in sceKernelReleaseDirectMemory 2026-10-10 08:22:59 +02:00
Equeue fix(libkernel): report AMPR completion events with the AMPR filter 2026-10-07 19:37:40 -04:00
EventFlag/src feat(runtime): timed waits, sync primitive fixes, heap and RTC fixes, unattended-run switches 2026-09-26 19:00:39 -07:00
File Merge pull request #2300 from AchrafReyani/fix/libkernel-stat-trailing-slash 2026-10-10 08:27:27 +02:00
Module Merge pull request #2028 from overlordxrz-source/feat/libkernel-get-module-list 2026-10-10 03:15:01 +02:00
Pthread fix(libkernel): give Linux guest threads the stack size they request 2026-10-10 08:57:00 +02:00
Semaphore Merge pull request #315 from RomainROCH/codex/fix-semaphore-overflow 2026-10-04 14:01:19 +13:00
Socket Merge pull request #1786 from Zurisen/fix/windows-socket-shutdown-epipe 2026-10-10 17:41:18 +13:00
SyncOnAddress/src feat(libkernel): implement sceKernelSyncOnAddressWait8 and sceKernelSyncOnAddressWait16 2026-10-06 04:30:12 +05:30
System/src Merge pull request #2090 from LeandroLP23/feat/libkernel-environ 2026-10-10 17:43:44 +13:00
Time Merge pull request #2157 from authurtabo-byte/fix/kernel-localtime-state 2026-10-10 17:44:39 +13:00
CMakeLists.txt fix(libkernel): give Linux guest threads the stack size they request 2026-10-10 08:57:00 +02:00
KernelErrors.hpp refactor(kernel): share SCE kernel error codes through KernelErrors.hpp 2026-09-27 13:32:28 +07:00
Unimplemented.cpp feat(libkernel): implement sceKernelReleaseFlexibleMemory (#952) 2026-10-07 10:20:07 +13:00