block: Keep RTMIN through RTMAX signals blocked in child#454
Open
nfraprado wants to merge 1 commit into
Open
Conversation
When a child process is forked for a block, it has the signals RTMIN through RTMAX blocked by default, but block_child_sig() unblocks all signals including these. Unblocking these signals is troublesome given that: - The easiest way to signal i3blocks for an update is through pkill (as shown at https://vivien.github.io/i3blocks/#_signal ). But pkill sends a signal to all processes with that name, which includes the child fork. - Since those signals are unblocked, but not handled, in the child, when one of them is sent to i3blocks, and while it is being handled in the child process, another one is sent, the child process will also receive the signal and therefore crash since it is unhandled. If we assume that the RTMIN through RTMAX signals are uncommon enough that they won't be used in the child process, the solution is as easy as keeping these signals blocked for the child process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a child process is forked for a block, it has the signals RTMIN
through RTMAX blocked by default, but block_child_sig() unblocks all
signals including these.
Unblocking these signals is troublesome given that:
shown at https://vivien.github.io/i3blocks/#_signal ). But pkill sends
a signal to all processes with that name, which includes the child
fork.
one of them is sent to i3blocks, and while it is being handled in
the child process, another one is sent, the child process will also
receive the signal and therefore crash since it is unhandled.
If we assume that the RTMIN through RTMAX signals are uncommon enough
that they won't be used in the child process, the solution is as easy as
keeping these signals blocked for the child process.
Fixes #455.