Repository navigation
fix(libkernel): block guest signals by FreeBSD's bit n - 1 - #1652
Conversation
|
Windows run, since the description says it wasn't tested there: Windows 11 Pro (26200), MinGW-w64 GCC 15.2.0 (WinLibs r7, the CI build), Release, configured like CI, Ryzen 9 5900X. This commit merged onto
So the bit AI-assisted: yes (Claude Code). |
|
Thanks for the Windows run; the description now points to it, so the CRT path is covered on both hosts. |
sigprocmask keeps the first word of the title's set as it is, where FreeBSD keeps signal n at bit n - 1 (_SIG_BIT), but Dispatch tested bit n. A title that blocked SIGTERM with a FreeBSD-built set (bit 14) was not protected, and a set with bit 15 blocked SIGTERM instead of SIGURG. Dispatch now tests bit n - 1; the stored mask and the set returned by sigprocmask are unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
28ec8f5 to
c26c1ca
Compare
|
Rebased onto Linux (CachyOS, kernel 7.2.9, GCC 16.2.1), Release,
AI-assisted: yes (Claude Code) |
…-mask-bit fix(libkernel): block guest signals by FreeBSD's bit n - 1
What
DispatchinSystem/src/Signals.cpptested the blocked mask with1u << guest, bit n.sigprocmaskkeeps the first word of the title's set as it is, and FreeBSD keeps signal n at bit n − 1 (_SIG_BIT), which is what FreeBSD'ssigaddset(and #1641's) produces. So a title that blocked SIGTERM (bit 14) was not protected, and a set with bit 15 blocked SIGTERM instead of SIGURG.Dispatchnow tests1u << (guest - 1). The stored mask and the setsigprocmaskreturns are unchanged, so they keep the title's layout. Nothing else interprets the mask's bits;sigprocmaskonly combines and returns it.Found while adding the sigset functions in #1641: with them a title can build such a set without importing anything else, so the mismatch stops being latent. The two are independent changes; #1641 lists this one under Depends on so they land in order.
Tested
BUILD_TESTING=ONandANYPS5_ENABLE_SPIRV_TOOLS=ONon this branch (based onmain4b005b2):ctest --repeat until-fail:3466/466;tools/check_conventions.py --base upstream/mainpasses.guest_signalsgains two cases: block{1u << 14}withSIG_BLOCK,raise(15)is not delivered,SIG_UNBLOCK,raise(15)is delivered; and block{1u << 15},raise(15)is still delivered. The first was written before the change: onmainit aborts (the raise is delivered through the block); it passes with the change. The existing round-trip assertions are untouched.guest_signals5/5 with this change, 5/5 failures withmain'sSignals.cppand the new cases, full suite 457/457. Pending delivery of a blocked signal after unblocking is not implemented here or onmain; this only corrects which bit is tested.main6b56175), run 37822080210:guest_signalspasses its three repeats on Windows, full suite 473/473. Linux passed on a rerun afteragc_driver_buffer_formathit its 120 s limit on the software Vulkan runner (the test takes 92 to 108 s onmain's own runs; ci: warn about tests that take more than 30 s #1744).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code