fix(libkernel): let signal() record every valid signal number like sigaction #2760
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2760"
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 husseinkad on 2026-10-10T13:11:26Z.
What
signal()returnedSIG_ERRwithEINVALfor every guest signal that has no host equivalent: only 2, 4, 6, 8, 11 and 15 worked, sosignal(SIGPIPE, SIG_IGN),signal(SIGHUP, h)orsignal(SIGUSR1, h)failed whilesigaction()in the same file accepted the same numbers. FreeBSD'ssignal()issigaction()withSA_RESTARTand an empty mask (neverSA_RESETHAND), and the kernel'skern_sigactionrejects only numbers outside 1..128 andSIGKILL/SIGSTOPwith a handler other thanSIG_DFL.signal_nid_postfixnow does the same:EINVALfor numbers outside 1..128 and forSIGKILL/SIGSTOPwith a non-default handler (signal(SIGKILL, SIG_DFL)succeeds, as in FreeBSD), the disposition of every other number is recorded in the tablesigactionuses, and the previous handler is returned. The rejection of aSIG_ERRhandler value, which FreeBSD does not have, is removed.Delivery is unchanged: only the six signals with host equivalents take effect or can be raised, and
raise/killof the others still fail withEINVAL. In particularsignal(SIGPIPE, SIG_IGN)is now recorded and succeeds but does not stop the hostSIGPIPEon Linux. TechnicalDebt (the SIGPIPE and the sigaction/signal entries) is updated to say exactly that.Tested
Windows 11 (10.0.26200), WinLibs GCC 15.2.0 r7, Release:
guest_signalsgains: every unmapped number 1..128 accepted withSIG_IGN, a handler andSIG_DFLwith the previous handler returned,errnoleft alone on success, the stored mask and flags replaced bySA_RESTARTand 0 after an earliersigaction, 9 and 17 acceptingSIG_DFLand rejecting a handler orSIG_IGN, and out-of-range numbers failing. It fails without the change (exit0xc0000409) and passes with it.ctest -R "guest_(signal|kill|sigaltstack)"passes (4 of 4).main's and this branch'slibkernelside by side with 155 signal numbers (-5 to 140 and the integer extremes) x 5 handler-chain scenarios (4,992signal()calls, read back throughsigaction): the six mapped numbers and all invalid numbers are byte-identical; only the 120 previously rejected numbers change, and each now behaves exactly like mapped signal 15; real delivery of the six mapped signals in 8 modes (48 runs per build, in separate processes) is identical; 4 to 8 threads for 2 seconds on private and shared numbers show no corruption of the table.tools/check_conventions.py --base origin/mainpasses;tools/pr_overlap.py --branchreports no overlap.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 repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T13:11:35Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Pull request closed