Files
AnyPS5/docs/dev/debt/changes/fix-libkernel-pthread-objects-in-guest-memory.md
B-HowellandClaude Opus 5.5 9ceb8ecf07 fix(libkernel): allocate thread objects in guest memory
scePthreadSelf, scePthreadCreate and pthread_self return the address of
the thread object. It came from the host heap, which on Windows can lie
above 2^40 once the guest arena has reserved the range below 0xfc00000000.
Titles keep that address in 40-bit fields: Bloodborne's adaptive mutex
stores the owner in the low 40 bits of its lock word, so a thread whose
object is above 2^40 never matches itself and waits on its own lock.

Allocate PthreadPrivate from the guest heap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:37:58 -05:00

503 B

libkernel

add Functional

  • Thread objects (libkernel) - the objects whose addresses scePthreadSelf, scePthreadCreate and pthread_self give the title come from the guest heap, so they lie in the guest address range below 2^40 that titles assume: CUSA00900 keeps scePthreadSelf() in the low 40 bits of its adaptive mutex word and compares it with the full value. Where the console's libkernel places these objects is not measured.