Skip to content

uucore: handle SIGRTMIN+N and SIGRTMAX-N notation#12149

Open
enr0n wants to merge 3 commits intouutils:mainfrom
enr0n:rt-signal-notation
Open

uucore: handle SIGRTMIN+N and SIGRTMAX-N notation#12149
enr0n wants to merge 3 commits intouutils:mainfrom
enr0n:rt-signal-notation

Conversation

@enr0n
Copy link
Copy Markdown

@enr0n enr0n commented May 4, 2026

On Linux, signals in the range SIGRTMIN..SIGRTMAX are valid in addition to SIGRTMIN and SIGRTMAX themselves. The notation SIGRTMIN+N and SIGRTMAX-N is used to reference signals in that range.

Adapt signal helpers to understand this.

Fixes: #11151

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/pr/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.
Congrats! The gnu test tests/printf/printf-surprise is now passing!
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@sylvestre
Copy link
Copy Markdown
Contributor

some jobs are failing

@enr0n enr0n force-pushed the rt-signal-notation branch from ff4ee52 to 5aeaabe Compare May 5, 2026 12:08
@enr0n
Copy link
Copy Markdown
Author

enr0n commented May 5, 2026

This is actually not enough to fix #11151 yet. The parsing is fixed, but the signals are not actually blocked, because nix::sys::signal does not understand real-time signals.

On Linux, signals in the range SIGRTMIN..SIGRTMAX are valid in addition
to SIGRTMIN and SIGRTMAX themselves. The notation SIGRTMIN+N and
SIGRTMAX-N is used to reference signals in that range.

Adapt signal helpers to understand this.
@enr0n enr0n force-pushed the rt-signal-notation branch from 5aeaabe to 9bbd658 Compare May 5, 2026 16:12
The nix::sys::signal::Signal enum type does not cover real-time signals.
In the current env code, this means that trying to block e.g. SIGRTMIN+7
is silently ignored, apply_signal_action() silently drops signals that
cannot be represented as that enum.

However, the enum cannot simply be extended to represent the real-time
signals, because SIGRTMIN and SIGRTMAX cannot be considered constants.

To workaround this, do not use the Signal enum type, and use libc where
needed instead of the wrappers.

Fixes: uutils#11151
@enr0n enr0n force-pushed the rt-signal-notation branch from 9bbd658 to c938b58 Compare May 5, 2026 16:50
Right now it is not possible to send real-time signals using kill
because the underlying nix::sys::signal code does not support real-time
signals. Workaround this by using libc directly.

With this, the "EXIT" workaround can be dropped, because we no longer
need to convert to nix::sys::signal::Signal.
@enr0n
Copy link
Copy Markdown
Author

enr0n commented May 5, 2026

With the two additional commits, env and kill should both properly support real-time signals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

env: signal flags do not understand RTMIN+n

2 participants