fix(libkernel): honor all guest signal mask words #5669
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5669"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T05:44:51Z.
What
Honor all four words of
GuestSignalSet(signals 1–128) in the process blocked mask andsigpending. Previously, block/unblock/set-mask operations only changed word 0, andsigpendingonly reported pending blocked signals from word 0. High-numbered signals could therefore be raised while blocked and delivered immediately instead of staying pending.Keep the existing
blockedMasklow-word atomic and add storage for words 1–3. This remains source-compatible with open PR #5666, whosesigsuspendimplementation currently swaps only word 0; that path will need a follow-up to save, replace, and restore the additional words.Tested
Linux Release build with Ninja:
guest_signal_testsbuilt and passed, including new block/raise/pending/unblock checks for signals 40, 73, and 128.python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpassed.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by AlexOfTheForest on 2026-10-14T06:06:32Z.
Logic looks right, and the test covers block, pending and delivery for signals in words 1–3.
Structure suggestion: blockedMask plus blockedMaskExtra[3] makes word 0 a special case everywhere (SignalBlocked, _sigprocmask, sigpending). A single std::atomicstd::uint32_t blockedMask[4] would remove the special case and the word - 1 indexing.
Pre-existing, not from this PR: FreeBSD's sigprocmask silently drops SIGKILL (9) and SIGSTOP (17) from the new mask (SIG_CANTMASK), but _sigprocmask stores word 0 as given, so both can be blocked here. Could be a follow-up, now that the mask is being touched.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T06:08:17Z.
Thanks for the review. I kept
blockedMaskas the word-0 scalar because open PR #5666 currently exchanges and restores that symbol insigsuspend; replacing it before that branch is updated would break its current head. I agree a four-word atomic array is cleaner once #5666 moves to the full mask. The SIGKILL/SIGSTOP filtering is a separate existing behavior; I’ll verify its exact FreeBSD contract and handle it as a distinct follow-up rather than broaden this width fix without a regression case.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T11:56:49Z.
Checked on Linux (merged onto main): build and ctest green, and
guest_signalsfails without theSignals.cppchange.One problem, which we fixed in a commit on your branch:
sigsuspend(now on main) saved and restored only word 0, so with this PR it reset the blocked state of signals 33-128 to unblocked after every call, and the argument's words 1-3 were not applied during the wait. It now exchanges and restores all four words, with a test that blocks signal 73 across asigsuspend(fails without the fix), and the debt entry no longer says the mask is limited to 32 signals.The
blockedMaskarray and the SIGKILL/SIGSTOP filtering stay as follow-ups, as discussed above.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:08:30Z.
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.
core/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/prx/libkernel/System/src/Signals.cppcore/libs/tests/GuestSignals.cppcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.mddocs/dev/debt/libkernel.mdcore/libs/tests/GuestSignals.cppdocs/dev/debt/libkernel.md