fix(libc): lock-order cycle between the app0 archive mutex and the path resolver mutex #10099
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 xXPBSXx on 2026-10-23T09:01:30Z.
Opened()in core/libs/prx/libc/src/AppArchive.cpp resolves/app0withResolveDiskPath_nid_no_patchwhile holding the archive mutex (AppArchive.cpp:38-40), andResolveLocked(General.cpp:670) takes the resolver'sDirectories().mutexfor that. The resolver in turn callsAppArchiveHasDirectory_nid_no_patchfor a..component while holding its mutex (General.cpp:356), which reachesOpened()and the archive mutex. The two orders form a cycle: ThreadSanitizer reports "lock-order-inversion (potential deadlock)" 16 times across 16 guest tests (guest_kernel_sys, guest_app_archive_present, guest_access, guest_filesystem, ...) on a Linux ThreadSanitizer build of main.I could not build an interleaving that actually deadlocks: an archived path calls
AppArchiveReady_nid_no_patch(that isOpened()) before it takes the resolver mutex, so the first opening finishes before another thread can hold the resolver mutex and wait for the archive mutex. The cycle exists in the lock graph, the fix removes it.AI-assisted (Claude Code).