Repository navigation
fix(libkernel): return EINVAL from the scePthreadAttr stack and guard size calls - #7026
Merged
oneandonlydean merged 1 commit intoOct 17, 2026
Conversation
… size calls scePthreadAttrGetstack, Getstackaddr, Getguardsize, Setguardsize, Setstack and Setstackaddr threw for a null attribute, a null pointer argument or a stack below the 16 KiB minimum. FreeBSD's libthr returns EINVAL for those, as the pthread_attr_* wrappers here and the other scePthreadAttr calls already do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
11 tasks done
Contributor
|
Windows cross-validation of the whole series (stacked on main 5f61879) is in #7023 (comment): this PR's test passes 3/3, and with only this PR's source reverted it fails with main's throw. Suite, conventions and two title runs show no regression. Written with Claude Code assistance (validation by a subagent, reviewed in this session). |
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
Six
scePthreadAttrcalls threwstd::runtime_errorfor arguments that FreeBSD's libthr rejects withEINVAL:scePthreadAttrGetstack_pthread_attr_getstackscePthreadAttrGetstackaddr_pthread_attr_getstackaddrscePthreadAttrGetguardsize_pthread_attr_getguardsizescePthreadAttrSetguardsize_pthread_attr_setguardsizescePthreadAttrSetstack_pthread_attr_setstackscePthreadAttrSetstackaddr_pthread_attr_setstackaddrThey now return
SCE_KERNEL_ERROR_EINVAL(0x80020016) and leave the attribute unchanged. The otherscePthreadAttrcalls inAttr.cppalready do this, and so do thepthread_attr_*wrappers inPosix/Attr.cpp. The stack minimum stays 16 KiB, the onescePthreadAttrSetstacksizeandpthread_attr_setstackuse here.I don't know of a title that hits this. I found it while going through the argument throws in libkernel.
Tested
Ubuntu 24.04, GCC 13.3, Release, on
main6a32550.guest_pthread_attr_stack(new): every rejected argument above returns0x80020016, a rejectedSetstackleaves the default stack, and the accepted values read back. Withmain'sAttr.cppthe test aborts on the first rejected call (the throw). With this change it passes 3 of 3.ctest -R '^guest_|libc': 403 of 403 pass, with this and my other small libkernel argument fixes from today applied together.tools/check_conventions.pypasses.tools/pr_overlap.pyfinds no conflicting lines. fix(libkernel): report thread guard size from attribute queries #6893 also editsAttr.cpp, but inscePthreadAttrGet, which this PR doesn't touch, and the new test is registered away from fix(libkernel): report thread guard size from attribute queries #6893's and fix(libkernel): keep a finished Windows thread's stack until it is joined or detached #4563's;git merge-treemerges this branch with each of them cleanly. The tool couldn't compare against seven PRs that conflict withmainand touchCMakeLists.txt.main's behaviour. (series run by @screamm)Not checked: macOS, a console.
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)🤖 Generated with Claude Code