-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove configurable assignment of signal numbers. #8898
Labels
Comments
Configurable signal numbers should be removed because the feature is useless. But removing configurable signal numbers has another benefit. We can, for example, greatly simplify logic like that of strsignal(). @pkarashchenko has been looking into that and this would facilitate a good solution. |
Yes, I think so: the configurable signal number make the thing more complex, but the benefit is very small. |
xiaoxiang781216
added a commit
to xiaoxiang781216/incubator-nuttx
that referenced
this issue
Mar 25, 2023
please reference the issue here for more information: apache#8898 Signed-off-by: Xiang Xiao <[email protected]>
xiaoxiang781216
added a commit
to xiaoxiang781216/incubator-nuttx
that referenced
this issue
Mar 25, 2023
please reference the issue here for more information: apache#8898 Signed-off-by: Xiang Xiao <[email protected]>
xiaoxiang781216
added a commit
to xiaoxiang781216/incubator-nuttx
that referenced
this issue
Mar 25, 2023
please reference the issue here for more information: apache#8898 Signed-off-by: Xiang Xiao <[email protected]>
+1 |
xiaoxiang781216
added a commit
to xiaoxiang781216/incubator-nuttx
that referenced
this issue
Mar 25, 2023
please reference the issue here for more information: apache#8898 Signed-off-by: Xiang Xiao <[email protected]>
patacongo
pushed a commit
that referenced
this issue
Mar 26, 2023
please reference the issue here for more information: #8898 Signed-off-by: Xiang Xiao <[email protected]>
anchao
pushed a commit
to anchao/nuttx
that referenced
this issue
Jul 14, 2023
please reference the issue here for more information: apache#8898 Signed-off-by: Xiang Xiao <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently there are 31 possible signals. Zero is the NULL signal, Signals 1-29 are all of the standard signals, and 30-31 are available for real time signals. Applications may only allocate signals from this pool*.
The logic in include/signal.h assigns values to the the standard signals so that they agree with the signal number used by Linux. Logic in include/signal.h and sched/Kconfig seem to permit the reassignment of any value to the standard signals:
In sched/Kconfig for example:
With matching logic in include/signal.h
I say "seems to permit reassignment" of the standard signal numbers because this conditional logic cannot work. That is because:
So what could you possibly re-assign those 29 signals to since there are only 29 available values? Certainly you could scramble up the signal numbers within that range of 29 signal numbers. But that is a really bad thing, we should not support them.
Hence, I propose that we remove this non-functional and potentially dangerous capability to reconfigure signal numbers. Currently, I see two MCUs under board that set SIGPIPE to 11 (the ancient lm3s6965-ek and sim:nimble). 11 is SIGSEGV.
Related to this: Many signals defined in header files and Kconfig files have not been updated since the standard signals were expanded and renumbered to match Linux. That has to be addressed to. What if someone is trying to use SIGABRT as an IPC???
In Kconfig files, default application/driver signal numbers should be based at SIGRTMIN. That should also be confined to the range of SIGRTMIN through SIGRTMAX.
I propose that reviewing and correcting real time signal numbers so that the usage is pristine should be a part of this change.
*PR #8885 increases the number of real time signals to 32, but that is not yet merged as of this writing.
The text was updated successfully, but these errors were encountered: