Repository navigation
test(libSceLibcInternal): pin _Mtx_current_owns across slot states - #22334
Merged
oneandonlydean merged 1 commit intoNov 17, 2026
Merged
oneandonlydean merged 1 commit into
oneandonlydean merged 1 commit into
Conversation
PrivacyOnion
approved these changes
Nov 17, 2026
PrivacyOnion
left a comment
Contributor
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 83bcb46b3e:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_libc_threads_testsbuilt cleanly. - CTest (
guest_libc_threads):1/1 Test #1197: guest_libc_threads ............... Passed 0.29 sec 100% tests passed, 0 tests failed out of 1 - Code reading:
- Verified that CurrentOwnsAnswersForEverySlotState() in core/libs/tests/GuestLibcThreads.cpp exercises _Mtx_current_owns across all intended states: unlocked, locked by caller, unlocked again, locked by another thread, null/unused slot, and post-destruction.
- Confirmed thread synchronization and lifetime safety: the spawned std::thread in CurrentOwnsAnswersForEverySlotState observes the locked mutex and is joined before unlocking and destruction.
- Verified AGENTS.md compliance: no forbidden comments, no new files outside allowed rules, clean convention gate, and proper Conventional Commits format.
- Verified cross-platform portability and clean destruction lifecycle with _Mtx_destroy_nid_postfix(&mutex).
Looks Good To Me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
docs/dev/debt/changes/docs-libc-mtx-current-owns-console-1160.mdrecords that_Mtx_current_owns"returns 1 and ignores its argument" and that "A payload process on PS5 firmware 11.60 measured 1 as well in six calls: before locking, locked by the caller, after unlocking, held by another thread, for a zeroed unused slot and after_Mtx_destroy". The existing test pinned only the null-slot call added with the forward table; the new function pins the other five states of that matrix on one mutex — unlocked, locked by the caller, unlocked again, locked while observed from a second thread, and destroyed — plus the zeroed unused slot. No console measurement is claimed beyond what the debt file records.Tested
83bcb46b3e93d8d33d5782e3b94cec89c87d9179on basecb28e72762:cmake --build build --target guest_libc_threads_tests,ctest -R '^guest_libc_threads$'— Passed, two consecutive runs, plus three direct runs of the binary (exit 0 each).x86_64-w64-mingw32-g++-posix -fsyntax-only, GCC 12 posix): clean.python tools/check_conventions.py --base origin/main: passed.git diff --check: clean.python tools/pr_overlap.py --branch test/libscelibcinternal-mtx-current-owns-states: the only shared file is feat(libc): add the std::__sce_v2 thread start, timed wait, clock and processor count calls #9447, and the overlap is positional — that PR appends__sce_v2declarations after line 54 and new functions afterForwardedCalls, while this adds one function directly beforeint main()and one call line afterDefaultNameOverrideMutex(); neither touches_Mtx_current_ownsbehavior.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)