fix(libkernel): return EBUSY when destroying a locked mutex #1483
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1483"
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?
Imported from boykopovar/AnyPS5. Originally posted by Aryansh1520 on 2026-10-08T08:55:22Z.
What
scePthreadMutexDestroythrewCannot destroy a locked mutexwhen the mutex was held. FreeBSD libthr, which the console's libkernel follows, returnsEBUSYin that case and leaves the mutex intact. PPSA28997 (God of War Sons of Sparta) destroys a locked mutex during its intro and was aborted by the exception. The function now returnsSCE_KERNEL_ERROR_EBUSY;pthread_mutex_destroymaps it toEBUSYthrough the existing conversion.Tested
guest_kernel_errorspasses with a new check that destroying a locked mutex returnsEBUSYand that the mutex can then be unlocked and destroyed.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-08T10:35:25Z.
Tested on Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, Intel Core i7-12700H, merged onto
maine28fa01ctogether with #1501 and #1483 to share one build.guest_kernel_errors: 10 of 10 runs pass.Mutex.cppput back tomain, test kept): 3 of 3 runs abort withCannot destroy a locked mutex.agc_driver_srgb8_color_target, an NVIDIA import flake (#1434).Tested with AI assistance (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-09T23:32:30Z.
Checked on Linux/GCC:
guest_kernel_errorspasses with the change and fails without it; the extra check (destroy while locked returnsEBUSY, then unlock and destroy succeed) matches FreeBSD libthr_pthread_mutex_destroy. CI is green and popcoder565 confirmed it on Windows/MinGW. Merging.