Skip to content

sched/signal/sig_dispatch.c: Correct signal dispatch to specific thread#16939

Merged
anchao merged 2 commits into
apache:masterfrom
tiiuae:fix_signal_not_delivered
Sep 2, 2025
Merged

sched/signal/sig_dispatch.c: Correct signal dispatch to specific thread#16939
anchao merged 2 commits into
apache:masterfrom
tiiuae:fix_signal_not_delivered

Conversation

@jlaitine

Copy link
Copy Markdown
Contributor

Summary

Use of this_task() to identify which thread the signal should be delivered to is just wrong. Replace is with stcb.

Impact

Fixes signal delivery from uart driver (tty), e.g. ctrl-c.

Testing

Tested on qemu

@github-actions github-actions Bot added Area: OS Components OS Components issues Size: XS The size of the change in this PR is very small labels Aug 29, 2025
Comment thread sched/signal/sig_dispatch.c Outdated
The signal dispatch is called from interrupt handlers as well, so
this_task() is wrong. The thread to which the signal is supposed to
be delivered is known (stcb), use that.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
@jlaitine jlaitine force-pushed the fix_signal_not_delivered branch from 740b7de to 6a41b52 Compare August 29, 2025 15:42
acassis
acassis previously approved these changes Aug 29, 2025
Comment thread sched/signal/sig_dispatch.c Outdated
@acassis

acassis commented Aug 29, 2025

Copy link
Copy Markdown
Contributor

I added requires more tests, we had agreed that modifications in the core part needs extensive tests in real hardware

@github-actions github-actions Bot added the Size: S The size of the change in this PR is small label Aug 29, 2025
@jlaitine jlaitine force-pushed the fix_signal_not_delivered branch 2 times, most recently from 3534af0 to 6a41b52 Compare August 29, 2025 16:39
@xiaoxiang781216 xiaoxiang781216 linked an issue Aug 30, 2025 that may be closed by this pull request
1 task
Comment thread sched/signal/sig_dispatch.c Outdated
The nxsig_dispatch should just deliver the signal to either a
thread by pid (tid) or to the process (group) by pid.

Simplify the code so that the intent is more obvious.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
@jlaitine jlaitine force-pushed the fix_signal_not_delivered branch from e0d9dad to 26bae56 Compare August 30, 2025 04:15

@anchao anchao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, We had a similar problem that the signal cannot be delivered from different groups, thanks for the fix

@anchao anchao merged commit a030e3c into apache:master Sep 2, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OS Components OS Components issues Size: S The size of the change in this PR is small Size: XS The size of the change in this PR is very small State: Needs more testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Serial TTY Signal Regression

4 participants