signal/sig_dispatch: Signal action was not performed if TCB_FLAG_SYSC…#8563
Merged
Conversation
…ALL is set For some reason the signal action was never performed if the receiveing task was within a system call, the pending queue inser was simply missing. This fixes the issue.
fa596c2 to
ef99151
Compare
Contributor
Author
|
Some strange code style issue with the original patch, fixed now |
xiaoxiang781216
approved these changes
Feb 17, 2023
pussuw
added a commit
to tiiuae/nuttx
that referenced
this pull request
Feb 21, 2023
As far as I can interpret how signal delivery should work when the signal is blocked, it should still be sent to the pending queue even if the signal is masked. When the sigmask changes it will be delivered. The original implementation did not add the pending signal action, if stcb->task_state == TSTATE_WAIT_SIG is true. An attempt to patch this was made in apache#8563 but it is insufficient as it creates an issue when the task is not waiting for a signal, but is in syscall, in this case the signal is incorrectly queued twice.
xiaoxiang781216
pushed a commit
that referenced
this pull request
Feb 21, 2023
As far as I can interpret how signal delivery should work when the signal is blocked, it should still be sent to the pending queue even if the signal is masked. When the sigmask changes it will be delivered. The original implementation did not add the pending signal action, if stcb->task_state == TSTATE_WAIT_SIG is true. An attempt to patch this was made in #8563 but it is insufficient as it creates an issue when the task is not waiting for a signal, but is in syscall, in this case the signal is incorrectly queued twice.
anchao
pushed a commit
to anchao/nuttx
that referenced
this pull request
Mar 6, 2023
As far as I can interpret how signal delivery should work when the signal is blocked, it should still be sent to the pending queue even if the signal is masked. When the sigmask changes it will be delivered. The original implementation did not add the pending signal action, if stcb->task_state == TSTATE_WAIT_SIG is true. An attempt to patch this was made in apache#8563 but it is insufficient as it creates an issue when the task is not waiting for a signal, but is in syscall, in this case the signal is incorrectly queued twice.
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.
…ALL is set
Summary
For some reason the signal action was never performed if the receiving task was within a system call, the pending queue insert was simply missing.
This fixes the issue.
Impact
Fixes signal action delivery when CONFIG_LIB_SYSCALL=y
Testing
icicle:knsh