Repository navigation
Conversation
…r a null thread and a null buffer Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… and EFAULT for a null buffer as the console does Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ead_getname_np for bad arguments Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
What
scePthreadGetnameanswered a null thread and a null buffer withSCE_KERNEL_ERROR_EINVAL(core/libs/prx/libkernel/Pthread/src/Thread.cpp:1646on the baseffc6f26b0786). A PS5 (firmware 11.60, payload process; a title process may differ) returned0x80020003(ESRCH) for a null thread and0x8002000e(EFAULT, errno 14) for a null buffer, in two runs whose outputs are equal line for line except thePROBEline (cases e.1 and e.2, lines 14 and 15 of the raw output in the first comment). On the same consolepthread_getname_npreturned 3 for a null thread and 14 for a null buffer (cases e.3 and e.4, lines 16 and 17), andpthread_getname_np_nid_postfixhere already answers those two cases that way (core/libs/prx/libkernel/Pthread/Posix/Thread.cpp:488and:489on the base).The fix commit (
0b4a4c6fd9c,Thread.cpp, 2 lines added and 1 removed) answers a null thread withSCE_KERNEL_ERROR_ESRCHand, after it, a null buffer withSCE_KERNEL_ERROR_EFAULT(Thread.cpp:1646and:1647); a thread that is not null is handled as before. The test commit (db305311061,GuestPthreadGetname.cpp, 2 lines added and 2 removed) expectsESRCHandEFAULTwhere it expectedEINVAL(GuestPthreadGetname.cpp:62and:70). The debt commit (91876d5c22b,fix-libkernel-getname-null-console.md, 5 lines added and 0 removed) adds the fragment that changes the entryscePthreadGetname, pthread_getname_np bufferto the measured results; the entry is 902 characters with its list marker.Not measured and not claimed: the order of the checks when the thread and the buffer are both null (here the thread is checked first; neither order was measured), a title process, and a partial write before a failure. 39 of 56 local title run folders import
scePthreadGetname, in the executable or in a bundled module (3 of them in the executable itself), and 1 importspthread_getname_np; an import is not a call, so title use is not established. Counted on 2026-11-29 at 03:56 UTC from the import registries in the newest local run folder of each of the 56 titles.Tested
Windows 10 Pro (10.0.19045), MinGW-W64 GCC 15.2.0 (WinLibs), CMake with Ninja, Release,
BUILD_TESTING=ON, ccache, one machine, both arms onmainffc6f26. Red: with the test commit alone (db30531),guest_pthread_getname_testsended withFATAL: abort() (SIGABRT)(exit 127). Green: with the fix and the debt commit (91876d5c22bc, the head of this branch) the same test returned 0 in three of three runs. The five neighbouring testsguest_pthread_handle_after_exit_tests,guest_pthread_rename_tests,guest_kernel_sys_thread_defaults_tests,guest_pthread_second_join_testsandguest_posix_thread_name_testsreturned 0 in both arms. The red arm ran once (the abort comes from the two changedRequirelines). Against a freshmainea39f12 (fetched on 2026-11-29):tools/debt_fold.py --checkexits with 0;tools/check_conventions.py --base upstream/mainreports no findings;git merge-treeof the head with thatmainis clean. The builds ran onmainffc6f26, not on ea39f12. Not tested: other operating systems, a run of this code on a PS5, a title.Overlap: counted on 2026-11-29 from the 2133 open pull requests (file lists from the GitHub API, the pull requests with 100 or more files read in full through the files API; the 1345 pull requests that change a file under
docs/dev/debt/,core/libs/prx/libkernel/Pthread/,GuestPthreadGetname.cpporlibkernel.md, or have pthread, getname, thread name or libkernel in the title or branch name, had their patches of the files underdocs/dev/debt/and of the files with libkernel or Pthread in the path searched forscePthreadGetname,pthread_getname_np,PthreadGetname, the fragment name and the textgetname, from 04:10 to 05:40 UTC,mainatea39f127f401at the start). No open pull request changes the fragmentdocs/dev/debt/changes/fix-libkernel-getname-null-console.mdor the entryscePthreadGetname, pthread_getname_np bufferatdocs/dev/debt/libkernel.md:445, and of the 175 commits onmainsinceffc6f26b0786(the base of this branch; up to859a238b8c73) only one, boykopovar#27554, changed a file undercore/libs/prx/libkernel/Pthread/(Posix/Sem.cpp); none changedPthread/src/Thread.cpp,core/libs/tests/GuestPthreadGetname.cpporlibkernel.md. 24 of the open pull requests change a file namedThread.cppor the test fileGuestPthreadGetname.cpp: 8 of them merge cleanly with this head, and the other 16 conflict withmainalone in as many files, so none because of this change. boykopovar#21571 (fix(libkernel): look the thread up before the name in pthread renames) is the closest: it changesscePthreadRenamein the sameThread.cpp(a hunk at about line 1608; this change is at:1646and:1647), the rename checks inGuestPthreadGetname.cpp(about line 81; this change is at:62and:70) and its own fragment, which has other entries; it merges cleanly with this head. boykopovar#18190 (feat(libs): mirror libkernel exports through libkernel_sys) addsscePthreadGetname_nid_no_patchto provider files and removespthread_getname_np_nid_postfixfromPosix/Thread.cpp, the function whose lines:488and:489this text cites for the base; it conflicts with this head in 1 file and withmainalone in 1 file, so not because of this change, and boykopovar#18112 (... libkernel_web) only declarespthread_getname_np_nid_no_patchand merges cleanly. Other patches only call the functions: boykopovar#21464, boykopovar#12642 and boykopovar#12130 (scePthreadGetnameinGuestPthreadSuspend.cpp) and boykopovar#28064 and boykopovar#23953 (pthread_getname_np_nid_postfixin tests); the other hits ofgetnameare other functions (getnameinfo,ucnv_getName,uloc_getName,getNamedItem,GetNamedPipeHandleStateand similar). The merges of this head with each of the 95 pull requests that change a file undercore/libs/prx/libkernel/Pthread/,GuestPthreadGetname.cpporlibkernel.mdor have a searched name were made withgit merge-treefrom 04:10 to 05:40 UTC: 42 are clean; the other 53 already conflict withmainalone, in at least as many files as with this head, so none of them conflicts because of this change. The count was repeated for the 36 pull requests that were opened or updated since 04:10 UTC (of the 2135 open pull requests, from 06:08 to 06:11 UTC; 29 of them were patch-scanned for the same names): one hit, boykopovar#21464 (a call ofscePthreadGetname), which now merges cleanly with this head. A merge of this head intomainat859a238b8c73was checked at 06:09 UTC and is clean. This pull request does not depend on any of them (Depends on: none).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)Summary by CodeRabbit