libkernel: blocked signal masks are shared between threads instead of inherited per thread #2879

Closed
opened 2026-10-10 17:21:10 +00:00 by Amoenus · 2 comments
Amoenus commented 2026-10-10 17:21:10 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-10T17:21:10Z.


Maintenance status, 7 November 2026

Resolved upstream: #3986 is merged and this issue is closed. Its submitted head 694b2b470440bbd3d8764bd742c7496a2f81921d supplied per-thread blocked masks/handler holds and creator-mask inheritance while preserving main's process-wide pending-signal model. The earlier “keep open” status is superseded.

The original probe below is historical evidence at its named source pin, not a current-main failure. This sweep verified the merge/closure and source scope; it did not rerun the signal suite. Host-delivery limitations remain as documented by the merged change.

AI-assisted report maintenance: yes.

Original reproduction on the pinned main below

Windows 11 Enterprise build 26200, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja Release. Full system libraries built from main 57f96fd2b36563e8380c603a92b1ef0d9d3a6aa4, without PR2754 or any local signal changes.

A standalone probe calls the existing sigprocmask NID aPcyptbOiZs in the built library. It uses actual guest pthread_create/pthread_join. Five separate processes produced the same failures:

Check Expected Observed on main
Child changes its mask Parent remains 0x4000 Parent becomes child's 0x2
Upper mask word round trip bits[2] == 1 bits[2] == 0
SIGKILL/SIGSTOP mask request Those bits are removed Readback retains 0x00010100
Block SIGTERM, raise it, unblock Deferred handler runs No delivery; handler value stays 0

Child inheritance appeared to pass, but the mask is global, so this is not evidence of proper inheritance.

inherited=1 isolated=0 full_width=0 nonblockable=0 pending_delivery=0
parent_expected=0x00004000 parent_actual=0x00000002 upper_expected=0x00000001 upper_actual=0x00000000 protected_actual=0x00010100 delivered=0

The global/32-bit limitations are already documented in technical debt. This report adds a reproducible behavioral check, including lost pending delivery and unblockable-signal readback. It is not a regression introduced by the proposed pthread_sigmask adapter.

The expected model follows FreeBSD 11's kern_sigprocmask (thread mask, SIG_CANTMASK, pending notification on unblock) and sigset_t, plus the POSIX pthread_sigmask contract. No console behavior was measured.

Existing work and verification

Zaid-Talib's separate guest-signal-masks branch already contains broader mask work. PR1431's current diff does not contain that mask work. With the separate branch combined locally with the pinned main, preserving main's Windows AVX restoration and retry logic, the same five checks pass. Relevant Windows tests (signals, exception delivery, thread identity, stacks, CPU clocks, cancellation and nested sleeps) each passed five repetitions. Combined exception test runs were 15.95–16.08 s. Linux and the full CTest suite were not run.

No PR or branch was published. Suggested direction: validate the existing per-thread/pending-signal work rather than treating a new export alone as complete signal-mask support.

Standalone Windows probe

Build full libraries with BUILD_TESTING=ON, save the source below as mask_probe.cpp outside the repository, then use the same MinGW toolchain:

g++ -std=gnu++20 -O3 -fno-exceptions -fno-asynchronous-unwind-tables -I core/libs mask_probe.cpp -o mask_probe.exe
./mask_probe.exe ./build-review/core/libs/libs

The toolchain runtime DLL directory must be on PATH. The argument is the patched library directory, not unpatched. Exit 1 reports behavioral failure; loader/probe errors use different exit codes. The probe restores its mask and handler before exiting.

Probe source
#include "SceTypes.hpp"
#include <csignal>
#include <cstdint>
#include <cstdio>
#include <cstring>

struct SignalSet { std::uint32_t bits[4]; };
extern "C" {
int APS5_VABI pthread_sigmask_nid_postfix(int, const SignalSet*, SignalSet*);
int APS5_VABI pthread_create_nid_postfix(Pthread*, const PthreadAttr*, PthreadEntry, void*);
int APS5_VABI pthread_join_nid_postfix(Pthread, void**);
int* APS5_VABI __error_nid_postfix();
using Handler = void (APS5_VABI *)(int);
Handler APS5_VABI signal_nid_postfix(int, Handler);
int APS5_VABI raise_nid_postfix(int);
}

#include <filesystem>
#include <stdexcept>
#include <windows.h>
static HMODULE kernel;
template<class TFunction> static TFunction Export(const char* nid) {
    const auto result = GetProcAddress(kernel, nid);
    if (result == nullptr) { std::fprintf(stderr, "Missing probe export: %s\n", nid); std::exit(23); }
    return reinterpret_cast<TFunction>(result);
}
extern "C" int APS5_VABI pthread_sigmask_nid_postfix(int how, const SignalSet* set, SignalSet* previous) {
    return Export<decltype(&pthread_sigmask_nid_postfix)>("aPcyptbOiZs")(how, set, previous);
}
extern "C" int APS5_VABI pthread_create_nid_postfix(Pthread* thread, const PthreadAttr* attr, PthreadEntry entry, void* arg) {
    return Export<decltype(&pthread_create_nid_postfix)>("OxhIB8LB-PQ")(thread, attr, entry, arg);
}
extern "C" int APS5_VABI pthread_join_nid_postfix(Pthread thread, void** result) {
    return Export<decltype(&pthread_join_nid_postfix)>("h9CcP3J0oVM")(thread, result);
}
extern "C" Handler APS5_VABI signal_nid_postfix(int signal, Handler handler) {
    return Export<decltype(&signal_nid_postfix)>("VADc3MNQ3cM")(signal, handler);
}
extern "C" int APS5_VABI raise_nid_postfix(int signal) {
    return Export<decltype(&raise_nid_postfix)>("0t0-MxQNwK4")(signal);
}

struct Observation { SignalSet initial{}; SignalSet final{}; int query{}; int update{}; };
static void* APS5_VABI Worker(void* value) {
    auto& observed = *static_cast<Observation*>(value);
    observed.query = pthread_sigmask_nid_postfix(0, nullptr, &observed.initial);
    const SignalSet replacement{{2, 0, 0, 0}};
    observed.update = pthread_sigmask_nid_postfix(3, &replacement, nullptr);
    pthread_sigmask_nid_postfix(0, nullptr, &observed.final);
    return nullptr;
}
static volatile std::sig_atomic_t received = 0;
static void APS5_VABI Callback(int value) { received = value; }
int main(int argc, char** argv) {
    SetErrorMode(0x8003);
    if (argc != 2) return 20;
    const std::filesystem::path directory(argv[1]);
    if (!SetDllDirectoryW(directory.c_str())) return 21;
    kernel = LoadLibraryW((directory / "libkernel.prx").c_str());
    if (kernel == nullptr) { std::printf("LoadLibrary error=%lu\n", GetLastError()); return 22; }

    SignalSet original{};
    if (pthread_sigmask_nid_postfix(0, nullptr, &original) != 0) return 10;
    const SignalSet parentMask{{0x4000, 0, 0, 0}};
    if (pthread_sigmask_nid_postfix(3, &parentMask, nullptr) != 0) return 11;
    Observation worker;
    Pthread thread = nullptr;
    if (pthread_create_nid_postfix(&thread, nullptr, Worker, &worker) != 0) return 12;
    if (pthread_join_nid_postfix(thread, nullptr) != 0) return 13;
    SignalSet parentAfter{};
    pthread_sigmask_nid_postfix(0, nullptr, &parentAfter);
    const bool inherited = worker.query == 0 && std::memcmp(&worker.initial, &parentMask, sizeof(parentMask)) == 0;
    const bool isolated = worker.update == 0 && std::memcmp(&parentAfter, &parentMask, sizeof(parentMask)) == 0;
    const SignalSet upper{{0, 0, 1, 0}};
    pthread_sigmask_nid_postfix(3, &upper, nullptr);
    SignalSet upperRead{};
    pthread_sigmask_nid_postfix(0, nullptr, &upperRead);
    const bool fullWidth = std::memcmp(&upperRead, &upper, sizeof(upper)) == 0;
    const SignalSet protectedSignals{{(1u << 8) | (1u << 16), 0, 0, 0}};
    pthread_sigmask_nid_postfix(3, &protectedSignals, nullptr);
    SignalSet protectedRead{};
    pthread_sigmask_nid_postfix(0, nullptr, &protectedRead);
    const bool nonblockable = (protectedRead.bits[0] & protectedSignals.bits[0]) == 0;
    const SignalSet empty{};
    pthread_sigmask_nid_postfix(3, &empty, nullptr);
    const auto oldHandler = signal_nid_postfix(15, Callback);
    pthread_sigmask_nid_postfix(1, &parentMask, nullptr);
    received = 0;
    const int raised = raise_nid_postfix(15);
    const bool deferred = raised == 0 && received == 0;
    pthread_sigmask_nid_postfix(2, &parentMask, nullptr);
    const int delivered = received;
    const bool pending = deferred && delivered == 15;
    signal_nid_postfix(15, oldHandler);
    pthread_sigmask_nid_postfix(3, &original, nullptr);
    std::printf("inherited=%d isolated=%d full_width=%d nonblockable=%d pending_delivery=%d\n", inherited, isolated, fullWidth, nonblockable, pending);
    std::printf("parent_expected=0x%08x parent_actual=0x%08x upper_expected=0x%08x upper_actual=0x%08x protected_actual=0x%08x delivered=%d\n", parentMask.bits[0], parentAfter.bits[0], upper.bits[2], upperRead.bits[2], protectedRead.bits[0], delivered);
    return inherited && isolated && fullWidth && nonblockable && pending ? 0 : 1;
}

AI-assisted: OpenAI Codex assisted with investigation, the probe, local integration and this report. No game files are included, and no game execution or compatibility is claimed by this probe.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5793563578 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2879). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-10T17:21:10Z. --- <!-- codex-issue-maintenance-20261022-2879 --> ### Maintenance status, 7 November 2026 **Resolved upstream:** [#3986](https://github.com/boykopovar/AnyPS5/pull/3986) is merged and this issue is closed. Its submitted head `694b2b470440bbd3d8764bd742c7496a2f81921d` supplied per-thread blocked masks/handler holds and creator-mask inheritance while preserving main's process-wide pending-signal model. The earlier “keep open” status is superseded. The original probe below is historical evidence at its named source pin, not a current-main failure. This sweep verified the merge/closure and source scope; it did not rerun the signal suite. Host-delivery limitations remain as documented by the merged change. AI-assisted report maintenance: yes. ### Original reproduction on the pinned main below Windows 11 Enterprise build 26200, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja Release. Full system libraries built from main `57f96fd2b36563e8380c603a92b1ef0d9d3a6aa4`, without PR2754 or any local signal changes. A standalone probe calls the existing `sigprocmask` NID `aPcyptbOiZs` in the built library. It uses actual guest `pthread_create`/`pthread_join`. Five separate processes produced the same failures: | Check | Expected | Observed on main | |---|---|---| | Child changes its mask | Parent remains `0x4000` | Parent becomes child's `0x2` | | Upper mask word round trip | `bits[2] == 1` | `bits[2] == 0` | | SIGKILL/SIGSTOP mask request | Those bits are removed | Readback retains `0x00010100` | | Block SIGTERM, raise it, unblock | Deferred handler runs | No delivery; handler value stays 0 | Child inheritance appeared to pass, but the mask is global, so this is not evidence of proper inheritance. ```text inherited=1 isolated=0 full_width=0 nonblockable=0 pending_delivery=0 parent_expected=0x00004000 parent_actual=0x00000002 upper_expected=0x00000001 upper_actual=0x00000000 protected_actual=0x00010100 delivered=0 ``` The global/32-bit limitations are already documented in technical debt. This report adds a reproducible behavioral check, including lost pending delivery and unblockable-signal readback. It is not a regression introduced by the proposed `pthread_sigmask` adapter. The expected model follows FreeBSD 11's [kern_sigprocmask](https://github.com/freebsd/freebsd-src/blob/stable/11/sys/kern/kern_sig.c#L979) (thread mask, `SIG_CANTMASK`, pending notification on unblock) and [sigset_t](https://github.com/freebsd/freebsd-src/blob/stable/11/sys/sys/_sigset.h), plus the [POSIX pthread_sigmask contract](https://pubs.opengroup.org/onlinepubs/009695299/functions/pthread_sigmask.html). No console behavior was measured. ### Existing work and verification [Zaid-Talib's separate guest-signal-masks branch](https://github.com/Zaid-Talib/AnyPS5/tree/28bea19c49379a30332e5ba207ef4a0ceffe3a4f) already contains broader mask work. PR1431's current diff does not contain that mask work. With the separate branch combined locally with the pinned main, preserving main's Windows AVX restoration and retry logic, the same five checks pass. Relevant Windows tests (signals, exception delivery, thread identity, stacks, CPU clocks, cancellation and nested sleeps) each passed five repetitions. Combined exception test runs were 15.95–16.08 s. Linux and the full CTest suite were not run. No PR or branch was published. Suggested direction: validate the existing per-thread/pending-signal work rather than treating a new export alone as complete signal-mask support. ### Standalone Windows probe Build full libraries with `BUILD_TESTING=ON`, save the source below as `mask_probe.cpp` outside the repository, then use the same MinGW toolchain: ```powershell g++ -std=gnu++20 -O3 -fno-exceptions -fno-asynchronous-unwind-tables -I core/libs mask_probe.cpp -o mask_probe.exe ./mask_probe.exe ./build-review/core/libs/libs ``` The toolchain runtime DLL directory must be on PATH. The argument is the patched library directory, not `unpatched`. Exit 1 reports behavioral failure; loader/probe errors use different exit codes. The probe restores its mask and handler before exiting. <details> <summary>Probe source</summary> ```cpp #include "SceTypes.hpp" #include <csignal> #include <cstdint> #include <cstdio> #include <cstring> struct SignalSet { std::uint32_t bits[4]; }; extern "C" { int APS5_VABI pthread_sigmask_nid_postfix(int, const SignalSet*, SignalSet*); int APS5_VABI pthread_create_nid_postfix(Pthread*, const PthreadAttr*, PthreadEntry, void*); int APS5_VABI pthread_join_nid_postfix(Pthread, void**); int* APS5_VABI __error_nid_postfix(); using Handler = void (APS5_VABI *)(int); Handler APS5_VABI signal_nid_postfix(int, Handler); int APS5_VABI raise_nid_postfix(int); } #include <filesystem> #include <stdexcept> #include <windows.h> static HMODULE kernel; template<class TFunction> static TFunction Export(const char* nid) { const auto result = GetProcAddress(kernel, nid); if (result == nullptr) { std::fprintf(stderr, "Missing probe export: %s\n", nid); std::exit(23); } return reinterpret_cast<TFunction>(result); } extern "C" int APS5_VABI pthread_sigmask_nid_postfix(int how, const SignalSet* set, SignalSet* previous) { return Export<decltype(&pthread_sigmask_nid_postfix)>("aPcyptbOiZs")(how, set, previous); } extern "C" int APS5_VABI pthread_create_nid_postfix(Pthread* thread, const PthreadAttr* attr, PthreadEntry entry, void* arg) { return Export<decltype(&pthread_create_nid_postfix)>("OxhIB8LB-PQ")(thread, attr, entry, arg); } extern "C" int APS5_VABI pthread_join_nid_postfix(Pthread thread, void** result) { return Export<decltype(&pthread_join_nid_postfix)>("h9CcP3J0oVM")(thread, result); } extern "C" Handler APS5_VABI signal_nid_postfix(int signal, Handler handler) { return Export<decltype(&signal_nid_postfix)>("VADc3MNQ3cM")(signal, handler); } extern "C" int APS5_VABI raise_nid_postfix(int signal) { return Export<decltype(&raise_nid_postfix)>("0t0-MxQNwK4")(signal); } struct Observation { SignalSet initial{}; SignalSet final{}; int query{}; int update{}; }; static void* APS5_VABI Worker(void* value) { auto& observed = *static_cast<Observation*>(value); observed.query = pthread_sigmask_nid_postfix(0, nullptr, &observed.initial); const SignalSet replacement{{2, 0, 0, 0}}; observed.update = pthread_sigmask_nid_postfix(3, &replacement, nullptr); pthread_sigmask_nid_postfix(0, nullptr, &observed.final); return nullptr; } static volatile std::sig_atomic_t received = 0; static void APS5_VABI Callback(int value) { received = value; } int main(int argc, char** argv) { SetErrorMode(0x8003); if (argc != 2) return 20; const std::filesystem::path directory(argv[1]); if (!SetDllDirectoryW(directory.c_str())) return 21; kernel = LoadLibraryW((directory / "libkernel.prx").c_str()); if (kernel == nullptr) { std::printf("LoadLibrary error=%lu\n", GetLastError()); return 22; } SignalSet original{}; if (pthread_sigmask_nid_postfix(0, nullptr, &original) != 0) return 10; const SignalSet parentMask{{0x4000, 0, 0, 0}}; if (pthread_sigmask_nid_postfix(3, &parentMask, nullptr) != 0) return 11; Observation worker; Pthread thread = nullptr; if (pthread_create_nid_postfix(&thread, nullptr, Worker, &worker) != 0) return 12; if (pthread_join_nid_postfix(thread, nullptr) != 0) return 13; SignalSet parentAfter{}; pthread_sigmask_nid_postfix(0, nullptr, &parentAfter); const bool inherited = worker.query == 0 && std::memcmp(&worker.initial, &parentMask, sizeof(parentMask)) == 0; const bool isolated = worker.update == 0 && std::memcmp(&parentAfter, &parentMask, sizeof(parentMask)) == 0; const SignalSet upper{{0, 0, 1, 0}}; pthread_sigmask_nid_postfix(3, &upper, nullptr); SignalSet upperRead{}; pthread_sigmask_nid_postfix(0, nullptr, &upperRead); const bool fullWidth = std::memcmp(&upperRead, &upper, sizeof(upper)) == 0; const SignalSet protectedSignals{{(1u << 8) | (1u << 16), 0, 0, 0}}; pthread_sigmask_nid_postfix(3, &protectedSignals, nullptr); SignalSet protectedRead{}; pthread_sigmask_nid_postfix(0, nullptr, &protectedRead); const bool nonblockable = (protectedRead.bits[0] & protectedSignals.bits[0]) == 0; const SignalSet empty{}; pthread_sigmask_nid_postfix(3, &empty, nullptr); const auto oldHandler = signal_nid_postfix(15, Callback); pthread_sigmask_nid_postfix(1, &parentMask, nullptr); received = 0; const int raised = raise_nid_postfix(15); const bool deferred = raised == 0 && received == 0; pthread_sigmask_nid_postfix(2, &parentMask, nullptr); const int delivered = received; const bool pending = deferred && delivered == 15; signal_nid_postfix(15, oldHandler); pthread_sigmask_nid_postfix(3, &original, nullptr); std::printf("inherited=%d isolated=%d full_width=%d nonblockable=%d pending_delivery=%d\n", inherited, isolated, fullWidth, nonblockable, pending); std::printf("parent_expected=0x%08x parent_actual=0x%08x upper_expected=0x%08x upper_actual=0x%08x protected_actual=0x%08x delivered=%d\n", parentMask.bits[0], parentAfter.bits[0], upper.bits[2], upperRead.bits[2], protectedRead.bits[0], delivered); return inherited && isolated && fullWidth && nonblockable && pending ? 0 : 1; } ``` </details> AI-assisted: OpenAI Codex assisted with investigation, the probe, local integration and this report. No game files are included, and no game execution or compatibility is claimed by this probe.
Silverash-i8 commented 2026-10-11 17:21:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-11T17:21:40Z.


@Amoenus thanks for the probe and the table, it made this easy to pin down. Fix branch: Silverash-i8/AnyPS5-fork:fix/per-thread-signal-mask (43b1020a, one commit on main a11c8f7f).

Following FreeBSD's kern_sigprocmask, Signals.cpp now keeps a blocked and a pending set per guest thread instead of the one process-wide 32-bit mask. Against your four checks:

  • Isolation: each thread has its own mask, and scePthreadCreate starts the new thread with its creator's mask, so a child changing its mask leaves the parent's alone.
  • Full width: all four words are kept and read back.
  • SIGKILL/SIGSTOP: removed from any mask that is set, so the readback no longer has 0x00010100.
  • Pending delivery: a raise (and so kill and pthread_kill to self) of a blocked signal is kept pending and delivered before sigprocmask returns from the unblock. A signal whose disposition is ignore is discarded instead of kept.

guest_signals gains these checks: the child thread inheriting 0x4000, changing to 0x2 and the parent still reading 0x4000 after the join, a full-width round trip, the SIGKILL/SIGSTOP bits dropped, the deferred handler running on unblock, and an ignored blocked signal not running a handler later.

Windows 11 Home 26200, WinLibs GCC 15.2.0 r7, Release:

  • guest_signals, guest_signal_sets, guest_user_context and guest_user_context_exit pass 5 of 5 (--repeat until-fail:5). The sigsetjmp/siglongjmp and getcontext/setcontext paths go through _sigprocmask, so those last three cover them.
  • The new guest_signals against main's Signals.cpp and Thread.cpp aborts, so it catches the old behaviour.
  • ctest -R '^guest_' (-j8): 288 of 290. The two failures are on main too: guest_filesystem (#3518) and guest_kernel_sys (#3510).
  • The rest of the non-GPU tests: only windows_exceptions fails, as on main (#3411).
  • check_conventions.py --base upstream/main passes.

Linux (WSL2 Ubuntu 22.04, kernel 6.18.33.2-microsoft-standard-WSL2, glibc 2.35, GCC 13.4.0, Release):

  • The same four tests pass 5 of 5. Against main's Signals.cpp and Thread.cpp the new guest_signals aborts here too (checked in a GCC 11.4 build of the same tree, which builds libkernel and its tests).
  • ctest -R '^guest_' (-j4): 269 of 270. The failure is guest_kernel_stack_protect, which fails the same way with main's Signals.cpp and Thread.cpp; it's #3459 (GCC 13 on main), not this change.
  • The rest of the non-GPU tests: 263 of 265. pr_overlap_encoding uses subprocess._text_encoding, which WSL's Python 3.10 doesn't have, and linux_executable_exports stops compiling its own C probe (RTLD_DEFAULT undeclared), so neither reaches AnyPS5 code.

One limitation stays, and I replaced the TechnicalDebt entry with it: a host signal from outside the guest (Ctrl+C, or SIGTERM from another process) is checked against the mask of whichever host thread receives it and stays pending on that thread, where FreeBSD would hand it to a thread that doesn't block it.

My one open PR slot is in use (#3518), so I can't open this myself. Anyone eligible is welcome to carry it with the commit as it is. A run on native Linux, rather than WSL, would still be welcome.

AI-assisted (Claude Code); I ran the above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111646188 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2879#issuecomment-6111646188). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-11T17:21:40Z. --- @Amoenus thanks for the probe and the table, it made this easy to pin down. Fix branch: [`Silverash-i8/AnyPS5-fork:fix/per-thread-signal-mask`](https://github.com/Silverash-i8/AnyPS5-fork/tree/fix/per-thread-signal-mask) (`43b1020a`, one commit on `main` `a11c8f7f`). Following FreeBSD's `kern_sigprocmask`, `Signals.cpp` now keeps a blocked and a pending set per guest thread instead of the one process-wide 32-bit mask. Against your four checks: - **Isolation:** each thread has its own mask, and `scePthreadCreate` starts the new thread with its creator's mask, so a child changing its mask leaves the parent's alone. - **Full width:** all four words are kept and read back. - **SIGKILL/SIGSTOP:** removed from any mask that is set, so the readback no longer has `0x00010100`. - **Pending delivery:** a `raise` (and so `kill` and `pthread_kill` to self) of a blocked signal is kept pending and delivered before `sigprocmask` returns from the unblock. A signal whose disposition is ignore is discarded instead of kept. `guest_signals` gains these checks: the child thread inheriting `0x4000`, changing to `0x2` and the parent still reading `0x4000` after the join, a full-width round trip, the SIGKILL/SIGSTOP bits dropped, the deferred handler running on unblock, and an ignored blocked signal not running a handler later. Windows 11 Home 26200, WinLibs GCC 15.2.0 r7, Release: - `guest_signals`, `guest_signal_sets`, `guest_user_context` and `guest_user_context_exit` pass 5 of 5 (`--repeat until-fail:5`). The `sigsetjmp`/`siglongjmp` and `getcontext`/`setcontext` paths go through `_sigprocmask`, so those last three cover them. - The new `guest_signals` against `main`'s `Signals.cpp` and `Thread.cpp` aborts, so it catches the old behaviour. - `ctest -R '^guest_'` (-j8): 288 of 290. The two failures are on `main` too: `guest_filesystem` (#3518) and `guest_kernel_sys` (#3510). - The rest of the non-GPU tests: only `windows_exceptions` fails, as on `main` (#3411). - `check_conventions.py --base upstream/main` passes. Linux (WSL2 Ubuntu 22.04, kernel 6.18.33.2-microsoft-standard-WSL2, glibc 2.35, GCC 13.4.0, Release): - The same four tests pass 5 of 5. Against `main`'s `Signals.cpp` and `Thread.cpp` the new `guest_signals` aborts here too (checked in a GCC 11.4 build of the same tree, which builds `libkernel` and its tests). - `ctest -R '^guest_'` (-j4): 269 of 270. The failure is `guest_kernel_stack_protect`, which fails the same way with `main`'s `Signals.cpp` and `Thread.cpp`; it's #3459 (GCC 13 on `main`), not this change. - The rest of the non-GPU tests: 263 of 265. `pr_overlap_encoding` uses `subprocess._text_encoding`, which WSL's Python 3.10 doesn't have, and `linux_executable_exports` stops compiling its own C probe (`RTLD_DEFAULT` undeclared), so neither reaches AnyPS5 code. One limitation stays, and I replaced the TechnicalDebt entry with it: a host signal from outside the guest (Ctrl+C, or `SIGTERM` from another process) is checked against the mask of whichever host thread receives it and stays pending on that thread, where FreeBSD would hand it to a thread that doesn't block it. My one open PR slot is in use (#3518), so I can't open this myself. Anyone eligible is welcome to carry it with the commit as it is. A run on native Linux, rather than WSL, would still be welcome. AI-assisted (Claude Code); I ran the above on my machine.
Silverash-i8 commented 2026-10-11 20:39:42 +00:00 (Migrated from github.com)
Author
Contributor

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


Now that my first PR has merged I can open this myself: #3986, the same change rebased onto main 0a8b1d32, with Windows (540 of 540 non-GPU tests) and WSL Linux runs in its description.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113509949 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2879#issuecomment-6113509949). Originally posted by [Silverash-i8](https://github.com/Silverash-i8) on 2026-10-11T20:39:42Z. --- Now that my first PR has merged I can open this myself: #3986, the same change rebased onto `main` `0a8b1d32`, with Windows (540 of 540 non-GPU tests) and WSL Linux runs in its description. AI-assisted (Claude Code).
Sign in to join this conversation.
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#2879
No description provided.