Skip to content

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

Open
enr0n wants to merge 4 commits into
uutils:mainfrom
enr0n:rt-signal-notation
Open

uucore: handle SIGRTMIN+N and SIGRTMAX-N notation#12149
enr0n wants to merge 4 commits into
uutils: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:

Note: The gnu test tests/basenc/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Congrats! The gnu test tests/printf/printf-surprise is now passing!

@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.

@enr0n enr0n force-pushed the rt-signal-notation branch 2 times, most recently from 9bbd658 to c938b58 Compare May 5, 2026 16:50
@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.

@enr0n enr0n force-pushed the rt-signal-notation branch 4 times, most recently from 9f8b1f2 to 3af4e8c Compare May 7, 2026 07:45
@enr0n
Copy link
Copy Markdown
Author

enr0n commented May 7, 2026

I think the remaining CI failure is unrelated.

@enr0n enr0n force-pushed the rt-signal-notation branch from 3af4e8c to de761af Compare May 8, 2026 13:04
enr0n added 4 commits May 8, 2026 14:10
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.
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
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 enr0n force-pushed the rt-signal-notation branch from de761af to cad60c0 Compare May 8, 2026 18:12
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