libkernel: held rwlock destruction deletes the host lock; reviewed safeguard available #2836
Loading…
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?
Imported from boykopovar/AnyPS5. Originally posted by zaydzaari on 2026-10-10T16:19:04Z.
scePthreadRwlockDestroycurrently deletesPthreadRwlockPrivatewithout checking whether its hoststd::shared_timed_mutexis held. I have a focused three-file fix that returnsSCE_KERNEL_ERROR_EBUSYfor a stably held reader/writer, leaves the handle intact, and adds SCE/POSIX regression coverage.Code:
github.com/zaydzaari/AnyPS5@55d1d7be9eBranch: https://github.com/zaydzaari/AnyPS5/tree/fix/rwlock-destroy-busy-reviewed
Base:
57f96fd2b36563e8380c603a92b1ef0d9d3a6aa4.Validated on Windows 11 Pro, WinLibs MinGW-w64 GCC 15.2.0 r7, Release:
guest_pthread_rwlockandguest_raise_exception.Rwlock.cpp(0xc0000409) and passes with the fix; 10 consecutive fixed rwlock runs passed. This regression abort does not by itself distinguish a failed assertion from host-destruction failure.e86107d3) passed both suites (2/2). Resolving its acquisition conflicts preserves reader increments after success; its oldwaitStatereferences also need upstream'sWaitState().bound. Those integration changes are excluded from my commit.This is a host robustness safeguard: POSIX leaves held-lock destruction undefined. It does not protect unsynchronized concurrent destruction/acquisition/unlock. Related closed #2679 concerns unlock validation; I found no identical open destruction fix.
AI-assisted: yes. The original coding-agent candidate was recovered exactly, independently reviewed and tested by Codex. No human review is claimed. The commit preserves Zayd Zaari's original author/email/date and contains only the two implementation files and regression test.
I have 0 merged PRs and understand the current 10-PR intake gate, so I have not opened an ineligible PR. If this safeguard is useful, would a maintainer be willing to review/carry the authored commit, or advise the preferred route? No action is expected while intake is paused.