Repository navigation
test(libkernel): pin the module answers of the thread-atexit reference pair - #21091
Merged
oneandonlydean merged 1 commit intoNov 15, 2026
Conversation
PrivacyOnion
approved these changes
Nov 15, 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 962ee0f504:
- Conventions:
tools/check_conventions.pypassed;git diff --checkclean. - Build:
guest_kernel_thread_atexit_testsbuilt cleanly. - CTest (
guest_kernel_thread_atexit):1/1 Test #5298: guest_kernel_thread_atexit ....... Passed 0.01 sec 100% tests passed, 0 tests failed out of 1 - Code reading:
- Verified core/libs/tests/GuestKernelThreadAtexit.cpp tests null, stack, and heap pointers against both sceKernelRtldThreadAtexitIncrement and _sceKernelRtldThreadAtexitIncrement_nid_postfix returning -1.
- Verified core/libs/tests/GuestKernelThreadAtexit.cpp tests null, stack, and heap pointers against sceKernelRtldThreadAtexitDecrement and _sceKernelRtldThreadAtexitDecrement_nid_postfix returning 0.
- Verified core/libs/tests/GuestKernelThreadAtexit.cpp checks a valid loaded module address (&sceKernelRtldThreadAtexitIncrement) for matched increment/decrement (0 then 0) and unmatched decrement (0).
- Verified core/libs/prx/libkernel/CMakeLists.txt properly registers guest_kernel_thread_atexit_tests with libkernel and libc linkage, Windows unwind configuration, 20s timeout, and WIN32 PATH modification.
- Verified strict compliance with AGENTS.md (no comments in code, no extra files, C++20 and LP64/LLP64 portability).
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/libkernel.mdrecords for_sceKernelRtldThreadAtexitIncrement/_sceKernelRtldThreadAtexitDecrementthat "As in a payload process on a PS5 (firmware 13.60), Increment returns -1 for an address outside every module (null, stack, heap) and 0 otherwise, and Decrement never fails on an address outside every module or after a matching Increment; the console's Decrement returns nothing, here 0. An unmatched Decrement on a module's address did not fault there and changes nothing here", and that "The variants without the leading underscore are not exported by firmware 13.60's libkernel_sys; here they match" the underscored ones. The new test pins those recorded answers for both spellings: null, stack and heap addresses answer -1 from Increment and 0 from Decrement, an address inside a loaded image takes and releases cleanly (0 then 0), and an unmatched Decrement on that same module address answers 0. Timeout, refcount and console-return-value semantics are not asserted beyond the recorded text. No console measurement is claimed beyond what the debt file records.Tested
962ee0f504ab52bae608c43dc22f91590e106175on base3e1b183e43:cmake --build build --target guest_kernel_thread_atexit_tests,ctest -R '^guest_kernel_thread_atexit$'— Passed, two consecutive runs.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/libkernel-thread-atexit-module-answers: no overlap among comparable pull requests; the only base-conflicting open PRs sharingcore/libs/prx/libkernel/CMakeLists.txt(fix(libkernel): keep a finished Windows thread's stack until it is joined or detached #4563, fix(libkernel): provide default arguments block for DT_INIT on Linux #6149, feat(libkernel): support SEEK_DATA and SEEK_HOLE in lseek #6936, feat(libkernel): implement four pthread_attr forms #9156, feat(libkernel): implement the named ksem semaphores #9293, feat(libkernel_sys): implement POSIX message queues #9297, feat(libkernel_sys): implement kmq_notify registration #9302) implement other subsystems and none of their diffs mentions the thread-atexit exports or the anchor block.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)