fix(libkernel): keep the signal mask per thread #3986

Merged
Silverash-i8 merged 1 commit from upstream-pr/3986 into main 2026-11-06 22:23:32 +00:00
Silverash-i8 commented 2026-10-11 20:39:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T20:39:12Z.


What

Fixes #2879. sigprocmask, _sigprocmask, pthread_sigmask and sigsuspend share one process-wide blocked mask: a thread changing its mask changes every thread's, and scePthreadCreate does not hand the creating thread's mask to the new thread. Rebased onto current main and reduced to that, as asked in the reviews of 13 and 22 October. The 128-bit mask, SIGKILL and SIGSTOP never blocked, EINVAL for an unknown how and the process-wide pending set are already on main and are not touched.

  • Each guest thread has its own blocked mask and handler holds (ThreadSignals in Signals.cpp); sigprocmask, _sigprocmask, pthread_sigmask, sigsuspend, sigpending and the delivery checks (raise, Dispatch, pause, the unblock path) read the calling thread's.
  • scePthreadCreate starts the new thread with its creator's mask.
  • The pending set stays on main's structure (MarkPending, TakePending, PendingInSet). A signal that raise leaves pending is still seen by sigwait, sigtimedwait and sigwaitinfo on any thread, and is delivered by the first thread that unblocks it, as a process-directed signal is in FreeBSD.
  • Which mask is consulted where the caller is not the signalled thread: the SIGALRM expiry runs on the timer thread, which is not a guest thread, so it checks the mask of the thread that armed the timer (alarm, setitimer); a host signal from outside the guest (Ctrl+C, SIGTERM from another process) is checked against the host thread that receives it. FreeBSD would deliver either to any thread that does not block it. Both are recorded in docs/dev/debt/libkernel.md with the pthread_sigmask, sigpending, sigsuspend and setitimer entries.
  • A thread's mask state is not freed when the thread exits (a thread-local object with a destructor is avoided because of the MinGW TLS teardown problem in #3171). Only the arming thread's state is read from another thread, so an expiry for a timer armed by a thread that exited with SIGALRM blocked stays pending.

Tests: guest_signals now checks a child inheriting its creator's mask and changing its own without touching the creator's, a signal raised while blocked being taken by sigtimedwait on a child thread, and a child that unblocks a signal the creator still blocks running the handler. The three CheckOtherThread*Kept checks in guest_signal_handler_mask asserted the process-wide behaviour (another thread's change showing up in this thread's mask); they now assert that the other thread's change leaves this thread's mask alone.

Tested

On main 03cfa4c067:

  • Windows 11 Home 26300, WinLibs GCC 15.2.0 r7, Release: guest_signals, guest_signal_sets, guest_signal_handler_mask, guest_signal_interrupt, guest_signal_list, guest_sigtimedwait, guest_itimer (with _pending_default and _short_expiry), guest_getitimer, guest_legacy_signal_mask (and _forwarding), guest_user_context (and _exit), guest_sigaltstack, guest_kernel_sys_pselect and guest_sigvec pass 18 of 18 five times in a row (--repeat until-fail:5).
  • Full suite except agc_driver*: everything passes except test_registration and select_tests_MissingCommandTests (both need the Windows symlink privilege, WinError 1314) and guest_video_out_high_frame_rate, which skips when run alone and failed once under -j8 load; none touches signals.
  • Linux (Ubuntu 24.04 under WSL2, GCC 13.3.0, Release): guest_signals, guest_signal_sets, guest_signal_handler_mask, guest_signal_interrupt, guest_sigtimedwait, guest_itimer (with _pending_default and _short_expiry), guest_getitimer, guest_legacy_signal_mask (and _forwarding), guest_user_context (and _exit) and guest_kernel_sys_pselect pass 14 of 14. Not run on native Linux, and the control run against main's sources was done on Windows only.
  • Against main's Signals.cpp and Thread.cpp, with this PR's tests kept, guest_signals and guest_signal_handler_mask fail on this machine (exit 0xc0000409).
  • tools/check_conventions.py --base upstream/main: 0 errors (two debt-length warnings on existing entries).
  • Not tested: titles.

Overlaps: #4138 touches the same sigprocmask lines, and draft #11273 (signal calls EFAULT) the neighbouring ones; whichever lands first decides the order.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Fixes #2879
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)

https://claude.ai/code/session_012SLQbhAiexxW6TtjYToW8a

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4822178241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3986). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-11T20:39:12Z. --- ### What Fixes #2879. `sigprocmask`, `_sigprocmask`, `pthread_sigmask` and `sigsuspend` share one process-wide blocked mask: a thread changing its mask changes every thread's, and `scePthreadCreate` does not hand the creating thread's mask to the new thread. Rebased onto current `main` and reduced to that, as asked in the reviews of 13 and 22 October. The 128-bit mask, SIGKILL and SIGSTOP never blocked, `EINVAL` for an unknown `how` and the process-wide pending set are already on `main` and are not touched. - Each guest thread has its own blocked mask and handler holds (`ThreadSignals` in `Signals.cpp`); `sigprocmask`, `_sigprocmask`, `pthread_sigmask`, `sigsuspend`, `sigpending` and the delivery checks (`raise`, `Dispatch`, `pause`, the unblock path) read the calling thread's. - `scePthreadCreate` starts the new thread with its creator's mask. - The pending set stays on `main`'s structure (`MarkPending`, `TakePending`, `PendingInSet`). A signal that `raise` leaves pending is still seen by `sigwait`, `sigtimedwait` and `sigwaitinfo` on any thread, and is delivered by the first thread that unblocks it, as a process-directed signal is in FreeBSD. - Which mask is consulted where the caller is not the signalled thread: the `SIGALRM` expiry runs on the timer thread, which is not a guest thread, so it checks the mask of the thread that armed the timer (`alarm`, `setitimer`); a host signal from outside the guest (Ctrl+C, `SIGTERM` from another process) is checked against the host thread that receives it. FreeBSD would deliver either to any thread that does not block it. Both are recorded in `docs/dev/debt/libkernel.md` with the `pthread_sigmask`, `sigpending`, `sigsuspend` and `setitimer` entries. - A thread's mask state is not freed when the thread exits (a thread-local object with a destructor is avoided because of the MinGW TLS teardown problem in #3171). Only the arming thread's state is read from another thread, so an expiry for a timer armed by a thread that exited with `SIGALRM` blocked stays pending. Tests: `guest_signals` now checks a child inheriting its creator's mask and changing its own without touching the creator's, a signal raised while blocked being taken by `sigtimedwait` on a child thread, and a child that unblocks a signal the creator still blocks running the handler. The three `CheckOtherThread*Kept` checks in `guest_signal_handler_mask` asserted the process-wide behaviour (another thread's change showing up in this thread's mask); they now assert that the other thread's change leaves this thread's mask alone. ### Tested On `main` `03cfa4c067`: - Windows 11 Home 26300, WinLibs GCC 15.2.0 r7, Release: `guest_signals`, `guest_signal_sets`, `guest_signal_handler_mask`, `guest_signal_interrupt`, `guest_signal_list`, `guest_sigtimedwait`, `guest_itimer` (with `_pending_default` and `_short_expiry`), `guest_getitimer`, `guest_legacy_signal_mask` (and `_forwarding`), `guest_user_context` (and `_exit`), `guest_sigaltstack`, `guest_kernel_sys_pselect` and `guest_sigvec` pass 18 of 18 five times in a row (`--repeat until-fail:5`). - Full suite except `agc_driver*`: everything passes except `test_registration` and `select_tests_MissingCommandTests` (both need the Windows symlink privilege, `WinError 1314`) and `guest_video_out_high_frame_rate`, which skips when run alone and failed once under `-j8` load; none touches signals. - Linux (Ubuntu 24.04 under WSL2, GCC 13.3.0, Release): `guest_signals`, `guest_signal_sets`, `guest_signal_handler_mask`, `guest_signal_interrupt`, `guest_sigtimedwait`, `guest_itimer` (with `_pending_default` and `_short_expiry`), `guest_getitimer`, `guest_legacy_signal_mask` (and `_forwarding`), `guest_user_context` (and `_exit`) and `guest_kernel_sys_pselect` pass 14 of 14. Not run on native Linux, and the control run against `main`'s sources was done on Windows only. - Against `main`'s `Signals.cpp` and `Thread.cpp`, with this PR's tests kept, `guest_signals` and `guest_signal_handler_mask` fail on this machine (exit `0xc0000409`). - `tools/check_conventions.py --base upstream/main`: 0 errors (two `debt-length` warnings on existing entries). - Not tested: titles. Overlaps: #4138 touches the same `sigprocmask` lines, and draft #11273 (signal calls `EFAULT`) the neighbouring ones; whichever lands first decides the order. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: Fixes #2879 - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code) https://claude.ai/code/session_012SLQbhAiexxW6TtjYToW8a
Kikoarl commented 2026-10-11 21:21:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-11T21:21:04Z.


Tested on native Linux (CachyOS x86_64, GCC) with an NVIDIA GeForce RTX 5060 Ti:

  • guest_signals: ran 10 consecutive stress runs (--repeat until-fail:10) — 10/10 passed (15.05s total).
  • guest_signal_sets & guest_user_context_exit pass clean.
  • Verified in live title execution (Astro Bot PPSA21567): 70+ worker threads spawned via scePthreadCreate correctly inherit masks with zero deadlocks or regressions.
  • tools/check_conventions.py passes clean.

Validates the fix on native Linux and title execution as requested in the description. LGTM!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113898584 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3986#issuecomment-6113898584). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-11T21:21:04Z. --- Tested on native **Linux (CachyOS x86_64, GCC)** with an **NVIDIA GeForce RTX 5060 Ti**: - `guest_signals`: ran 10 consecutive stress runs (`--repeat until-fail:10`) — **10/10 passed** (15.05s total). - `guest_signal_sets` & `guest_user_context_exit` pass clean. - Verified in live title execution (*Astro Bot* PPSA21567): 70+ worker threads spawned via `scePthreadCreate` correctly inherit masks with zero deadlocks or regressions. - `tools/check_conventions.py` passes clean. Validates the fix on native Linux and title execution as requested in the description. LGTM!
oneandonlydean commented 2026-10-11 23:20:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:20:07Z.


One thing before merging: please drop the comment at core/libs/prx/libkernel/System/src/Signals.cpp:47-48. Code comments aren't allowed apart from technical-debt markers; the TechnicalDebt entry already says it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115034841 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3986#issuecomment-6115034841). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:20:07Z. --- One thing before merging: please drop the comment at `core/libs/prx/libkernel/System/src/Signals.cpp:47-48`. Code comments aren't allowed apart from technical-debt markers; the TechnicalDebt entry already says it.
Dextroid17 commented 2026-10-12 16:00:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T16:00:48Z.

Review: COMMENTED


The control is what the record above does not have, and the overlap the bot lists is a text conflict rather than a same-file warning. Head 066b18da0, parent 0a8b1d32b, in a worktree:

head      guest_signal + guest_signal_sets → 100% tests passed out of 2, exit 0
control   parent's Pthread/src/Thread.cpp + System/src/Signals.cpp, the PR's tests kept
          → the test process exits 134 (SIGABRT, "Aborted (core dumped)"),
            ctest: 691 - guest_signals (Subprocess aborted), 50% passed, 1 failed out of 2 (ctest exit 8)

The abort is deterministic and comes from the parent's own bookkeeping: it wrote previousSet->bits[1..3] = 0, while the new test asserts the previous mask above bit 31 comes back set (previous.bits[1] == 0x1, with bit 32 reaching bits[2] and bits[3]). That is the half a green head cannot show.

Two checks on the change itself:

  • The mechanism fits this port. GuestSignalSet has held std::uint32_t bits[4] (Signals.cpp:24) since before this change; what was wrong is the mask bookkeeping — a single std::atomic<std::uint32_t> blockedMask, the operation applied to set->bits[0] only, and bits[1..3] returned as zero, so a mask above 32 was dropped and never read back. The change keeps the blocked and pending sets per thread and applies the operation to all four words. Per-thread storage is meaningful here because each guest thread runs on its own host thread: pthread_create(&p->hostThread, …, StartNativeThread, …) on the POSIX path (Thread.cpp:586), _beginthreadex on the Windows path (Thread.cpp:549), the entered thread adopted through pthread_self() (Thread.cpp:692).
  • On the overlap, the bot's table is a same-file, same-line-range warning computed against main and says nothing about whether the two branches can merge; the measured state is that they cannot be merged without a decision. git merge-tree --write-tree pr-3986 pr-4138 exits 1 with CONFLICT (content) in core/libs/prx/libkernel/System/src/Signals.cpp, in three regions — the blocked check in Dispatch, raise_nid_postfix, and _sigprocmask_nid_postfix — where both branches add the same three how values under differently capitalised names (GuestSigBlock/GuestSigUnblock/GuestSigSetmask against GuestSigblock/GuestSigunblock/GuestSigsetmask, the second side also adding GuestEintr, GuestEagain and GuestSiuser) and both add pending-set handling. pr-3986 with pr-4383 and pr-4138 with pr-4383 produce trees with no textual conflict (exit 0; neither result was built or run, so that is all it shows). #4138's body already says it will keep this PR's per-thread masks and drop its own duplicate pending handling, so the conflict makes that rebase required rather than optional, and #4383 can go either side of the pair without cost. A line recording that would spare the next reader the experiment.

The comment oneandonlydean asked to be dropped sits at Signals.cpp:46-47 on this head (his range says 47-48); nothing above depends on it — and if the overlap is worth recording in the repository, docs/dev/TechnicalDebt.md in the same pull request is the place for it.

Written with AI assistance.

Hermes Agent 🤖 at your service

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5493237416 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3986#pullrequestreview-5493237416). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T16:00:48Z. **Review:** COMMENTED --- **The control is what the record above does not have, and the overlap the bot lists is a text conflict rather than a same-file warning.** Head `066b18da0`, parent `0a8b1d32b`, in a worktree: ``` head guest_signal + guest_signal_sets → 100% tests passed out of 2, exit 0 control parent's Pthread/src/Thread.cpp + System/src/Signals.cpp, the PR's tests kept → the test process exits 134 (SIGABRT, "Aborted (core dumped)"), ctest: 691 - guest_signals (Subprocess aborted), 50% passed, 1 failed out of 2 (ctest exit 8) ``` The abort is deterministic and comes from the parent's own bookkeeping: it wrote `previousSet->bits[1..3] = 0`, while the new test asserts the previous mask above bit 31 comes back set (`previous.bits[1] == 0x1`, with bit 32 reaching `bits[2]` and `bits[3]`). That is the half a green head cannot show. Two checks on the change itself: - The mechanism fits this port. `GuestSignalSet` has held `std::uint32_t bits[4]` (`Signals.cpp:24`) since before this change; what was wrong is the mask bookkeeping — a single `std::atomic<std::uint32_t> blockedMask`, the operation applied to `set->bits[0]` only, and `bits[1..3]` returned as zero, so a mask above 32 was dropped and never read back. The change keeps the blocked and pending sets per thread and applies the operation to all four words. Per-thread storage is meaningful here because each guest thread runs on its own host thread: `pthread_create(&p->hostThread, …, StartNativeThread, …)` on the POSIX path (`Thread.cpp:586`), `_beginthreadex` on the Windows path (`Thread.cpp:549`), the entered thread adopted through `pthread_self()` (`Thread.cpp:692`). - On the overlap, the bot's table is a same-file, same-line-range warning computed against `main` and says nothing about whether the two branches can merge; the measured state is that they cannot be merged without a decision. `git merge-tree --write-tree pr-3986 pr-4138` exits 1 with `CONFLICT (content)` in `core/libs/prx/libkernel/System/src/Signals.cpp`, in three regions — the blocked check in `Dispatch`, `raise_nid_postfix`, and `_sigprocmask_nid_postfix` — where both branches add the same three `how` values under differently capitalised names (`GuestSigBlock`/`GuestSigUnblock`/`GuestSigSetmask` against `GuestSigblock`/`GuestSigunblock`/`GuestSigsetmask`, the second side also adding `GuestEintr`, `GuestEagain` and `GuestSiuser`) and both add pending-set handling. `pr-3986` with `pr-4383` and `pr-4138` with `pr-4383` produce trees with **no textual conflict** (exit 0; neither result was built or run, so that is all it shows). #4138's body already says it will keep this PR's per-thread masks and drop its own duplicate pending handling, so the conflict makes that rebase required rather than optional, and #4383 can go either side of the pair without cost. A line recording that would spare the next reader the experiment. The comment oneandonlydean asked to be dropped sits at `Signals.cpp:46-47` on this head (his range says 47-48); nothing above depends on it — and if the overlap is worth recording in the repository, `docs/dev/TechnicalDebt.md` in the same pull request is the place for it. Written with AI assistance. Hermes Agent 🤖 at your service
xXPBSXx commented 2026-10-13 07:07:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T07:07:49Z.


A small observation on the how handling in sigprocmask / _sigprocmask: the PR keeps throw std::invalid_argument for a how other than SIG_BLOCK, SIG_UNBLOCK and SIG_SETMASK. A throw out of a guest call ends the process, while FreeBSD 11.4's kern_sigprocmask writes the old mask first and then fails the unknown how with EINVAL (22). Returning EINVAL there would match it. On current main I checked this on Windows: sigprocmask with how 0, 4 and -1 and a non-null set aborts with the uncaught exception. I have a small test for it (guest_signals, how 0/4/-1) but did not open a PR, because this one rewrites the same lines; feel free to take it.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140257848 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3986#issuecomment-6140257848). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-13T07:07:49Z. --- A small observation on the `how` handling in `sigprocmask` / `_sigprocmask`: the PR keeps `throw std::invalid_argument` for a `how` other than `SIG_BLOCK`, `SIG_UNBLOCK` and `SIG_SETMASK`. A throw out of a guest call ends the process, while FreeBSD 11.4's [`kern_sigprocmask`](https://github.com/freebsd/freebsd-src/blob/release/11.4.0/sys/kern/kern_sig.c) writes the old mask first and then fails the unknown `how` with `EINVAL` (22). Returning `EINVAL` there would match it. On current `main` I checked this on Windows: `sigprocmask` with `how` 0, 4 and -1 and a non-null set aborts with the uncaught exception. I have a small test for it (`guest_signals`, `how` 0/4/-1) but did not open a PR, because this one rewrites the same lines; feel free to take it. AI-assisted (Claude Code).
adriadam10 commented 2026-10-13 10:14:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T10:14:11Z.

Review: DISMISSED


Thanks for this, the per-thread mask is the right model. It no longer applies to main, and the conflict is not only textual:

  • main now keeps a process-wide pending set in Signals.cpp (MarkPending/TakePending/PendingInSet, added with sigtimedwait in #3430, used by sigwait, sigwaitinfo, pause and killpg). The per-thread pendingSignals here is a second store for the same thing: a signal that raise leaves in it is never seen by sigwait/sigtimedwait. Please rebase and decide how the two relate (for example blocked mask per thread, pending set kept on main's structure), then cover the interaction with a test.
  • ExpireAlarm (setitimer/alarm, #3800) reads blockedMask for SIGALRM and SignalBlocked only looks at the first 32 signals. Both need to use the new per-thread mask, and the alarm thread is not a guest thread, so say which mask it checks.
  • docs/dev/TechnicalDebt.md was split per library: the entry now lives in docs/dev/debt/libkernel.md, where the old pthread_sigmask line (line 123) and the sigtimedwait line (149, which describes the process-wide pending set) both need updating.
  • @oneandonlydean's request is still open: drop the comment at Signals.cpp:47-48.
  • @xXPBSXx's point about an unknown how (write the old mask, return EINVAL instead of throw, per FreeBSD 11.4 kern_sigprocmask) touches the same lines you rewrite, so it fits in this PR.

After the rebase, guest_signals, guest_signal_sets, the sigtimedwait tests and guest_itimer should pass together, with the new guest_signals still failing on main's Signals.cpp/Thread.cpp.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5502006263 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3986#pullrequestreview-5502006263). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T10:14:11Z. **Review:** DISMISSED --- Thanks for this, the per-thread mask is the right model. It no longer applies to `main`, and the conflict is not only textual: - `main` now keeps a process-wide pending set in `Signals.cpp` (`MarkPending`/`TakePending`/`PendingInSet`, added with `sigtimedwait` in #3430, used by `sigwait`, `sigwaitinfo`, `pause` and `killpg`). The per-thread `pendingSignals` here is a second store for the same thing: a signal that `raise` leaves in it is never seen by `sigwait`/`sigtimedwait`. Please rebase and decide how the two relate (for example blocked mask per thread, pending set kept on `main`'s structure), then cover the interaction with a test. - `ExpireAlarm` (`setitimer`/`alarm`, #3800) reads `blockedMask` for `SIGALRM` and `SignalBlocked` only looks at the first 32 signals. Both need to use the new per-thread mask, and the alarm thread is not a guest thread, so say which mask it checks. - `docs/dev/TechnicalDebt.md` was split per library: the entry now lives in `docs/dev/debt/libkernel.md`, where the old `pthread_sigmask` line (line 123) and the `sigtimedwait` line (149, which describes the process-wide pending set) both need updating. - @oneandonlydean's request is still open: drop the comment at `Signals.cpp:47-48`. - @xXPBSXx's point about an unknown `how` (write the old mask, return `EINVAL` instead of `throw`, per FreeBSD 11.4 `kern_sigprocmask`) touches the same lines you rewrite, so it fits in this PR. After the rebase, `guest_signals`, `guest_signal_sets`, the `sigtimedwait` tests and `guest_itimer` should pass together, with the new `guest_signals` still failing on `main`'s `Signals.cpp`/`Thread.cpp`.
oneandonlydean commented 2026-10-17 03:40:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T03:40:20Z.


Conflicts with main; please rebase. Still open from 2026-10-13: @adriadam10's review above (how the per-thread mask relates to main's process-wide pending set, ExpireAlarm/SignalBlocked, the debt entry now in docs/dev/debt/libkernel.md, and the Signals.cpp:47-48 comment).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6229155440 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3986#issuecomment-6229155440). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T03:40:20Z. --- Conflicts with main; please rebase. Still open from 2026-10-13: @adriadam10's review above (how the per-thread mask relates to main's process-wide pending set, `ExpireAlarm`/`SignalBlocked`, the debt entry now in `docs/dev/debt/libkernel.md`, and the `Signals.cpp:47-48` comment).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!3986
No description provided.