Skip to content

signal/sig_dispatch: Signal action was not performed if TCB_FLAG_SYSC…#8563

Merged
xiaoxiang781216 merged 1 commit into
apache:masterfrom
tiiuae:fix_sigact_syscall
Feb 17, 2023
Merged

signal/sig_dispatch: Signal action was not performed if TCB_FLAG_SYSC…#8563
xiaoxiang781216 merged 1 commit into
apache:masterfrom
tiiuae:fix_sigact_syscall

Conversation

@pussuw
Copy link
Copy Markdown
Contributor

@pussuw pussuw commented Feb 17, 2023

…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

…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.
@pussuw pussuw force-pushed the fix_sigact_syscall branch from fa596c2 to ef99151 Compare February 17, 2023 11:52
@pussuw
Copy link
Copy Markdown
Contributor Author

pussuw commented Feb 17, 2023

Some strange code style issue with the original patch, fixed now

@xiaoxiang781216 xiaoxiang781216 merged commit 0e44666 into apache:master Feb 17, 2023
@pussuw pussuw deleted the fix_sigact_syscall branch February 17, 2023 16:03
@pussuw pussuw restored the fix_sigact_syscall branch February 21, 2023 09:27
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.
@pussuw pussuw deleted the fix_sigact_syscall branch February 21, 2023 09:27
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.
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.

3 participants