5 Commits
Author SHA1 Message Date
orezraeyandClaude Opus 5.5 284884d40b Merge main into fix/libkernel-cond-destroyed-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 22:12:05 -03:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
orezraeyandClaude Opus 5.5 a431d14efe fix(libkernel): mark a destroyed condition variable with 1 and accept destroying a null one, as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 08:52:48 -03:00
Lindamea1andClaude Opus 5.5 c68ffcfd21 fix(libkernel): fail scePthreadMutexUnlock on a statically initialized mutex with EPERM
scePthreadMutexUnlock resolved the slot with resolveMutex(mutex, false),
which throws "Mutex is not initialized" while the slot still holds the
static initializer (0) or the adaptive static initializer (1), so
unlocking a statically initialized mutex that was never locked ended
the process. FreeBSD 11.4's mutex_unlock_common returns EPERM for both
without initializing the slot, and EINVAL for the destroyed marker.

Load the slot once: the destroyed marker still returns 0x80020016, and
the two initializers now return 0x80020001 and stay in the slot, so a
later lock still creates the mutex.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 19:31:14 +01:00
xXPBSXxandClaude Sonnet 5.5 c664ffbec4 fix(libkernel): return EINVAL for pthread mutex and cond operations on a destroyed object
Locking, trylocking, unlocking a destroyed mutex and signalling, broadcasting,
waiting on or destroying a destroyed condition variable threw a C++ exception
into the guest. FreeBSD 11.4 libthr returns EINVAL for all of them (thr_mutex.c
check_and_init_mutex and mutex_unlock_common compare against THR_MUTEX_DESTROYED,
thr_cond.c CHECK_AND_INIT_COND and _pthread_cond_destroy against
THR_COND_DESTROYED). The condition wait path already reported EINVAL for a
destroyed mutex.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-18 21:23:54 +02:00