Repository navigation
Conversation
sigprocmask with a mask and a how other than SIG_BLOCK, SIG_UNBLOCK or SIG_SETMASK threw std::invalid_argument into the guest. FreeBSD 11.4 kern_sigprocmask copies the old mask out first and then returns EINVAL from the default case of the switch on how; the call now returns -1 with errno EINVAL in the same order. pthread_sigmask already rejected the value. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…fails with EINVAL FreeBSD 11.4 sys_sigprocmask copies the old mask out only when kern_sigprocmask returns 0 (if (osetp && !error) copyout), so a guest sees its output buffer unchanged after an invalid how. _sigprocmask now writes the previous mask after the how switch. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Collaborator
|
Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line. |
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
sigprocmask(and_sigprocmask) with a mask and ahowother thanSIG_BLOCK(1),SIG_UNBLOCK(2) orSIG_SETMASK(3) threwstd::invalid_argumentinto the guest, which ends the title. FreeBSD 11.4'skern_sigprocmaskruns the switch onhowonly when a new set was given, and itsdefault:case setserror = EINVALand leaves the mask unchanged. The system callsys_sigprocmaskcopies the old mask out to the caller only whenkern_sigprocmaskreturned 0 (if (osetp && !error) copyout(...)), so a caller that passed an invalidhowfinds its output buffer unchanged.The
default:case of_sigprocmask_nid_postfix(core/libs/prx/libkernel/System/src/Signals.cpp) now setserrnotoEINVAL(22) and returns -1 without writing the previous mask to the caller's buffer; on success the previous mask is written after the switch, as before. With no new set (set == NULL) the switch is skipped, so an invalidhowis not an error there, as in FreeBSD.pthread_sigmaskalready rejected an invalidhowwith 22 and is not changed.No title evidence. This is FreeBSD conformance.
Overlap (
git merge-treeagainstmaind1670009f, and against the heads of #5261, #5312, #5306, #5241, #5272 and #4383): no conflict. #3986 ("keep the signal mask per thread") conflicts with this change, and it already conflicts withmainon its own.Tested
python tools/check_conventions.py --base upstream/main --title ... --body ...passes for this text. The new checks are incore/libs/tests/GuestSignals.cpp(registered asguest_signals):how0, 4 and -1 with a mask return -1 withEINVALand leave the previous-mask buffer unchanged, andhow0 with no new set returns 0. The branch is two commits (the fix and the follow-up that stops writing the previous mask onEINVAL).-j4), the heada7c6f606cmerged ontomain7a0c838ca:guest_signalspasses (2.00 s, ctest); withSignals.cpptaken back tomainand the new test kept it fails ([libc] unhandled exception 'St16invalid_argument', exit code0xc0000409). Second run, head merged ontomaind1670009f, the targets of the group built as well: onmainaloneguest_filesystem,guest_file_vector,guest_memory,guest_kernel_sys,guest_signalsandguest_directory_bufferpass (6 of 6); with the head and its test 6 of 6 pass, 0 failed. This replaces the earlier combined-build figures. Not run: the socket tests, Linux, a console, a title. With only the follow-up commit reverted (the previous mask written before the switch) the corrected test fails as well (exit code0xc0000409; measured earlier onmain8d98e8851, not repeated in this run).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); no silent stub added.mdfiles or images added to the repositoryAI-assisted (Claude Code).