-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
Fix signal handling for platforms without SA_ONSTACK #118962
base: main
Are you sure you want to change the base?
Conversation
|
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
|
@llvm/pr-subscribers-llvm-support Author: Valery Chernov (vvchernov) ChangesSome platforms such as QNX do not define or implement SA_ONSTACK, so default that flag to 0 to just use the pre-existing stack there. Full diff: https://github.com/llvm/llvm-project/pull/118962.diff 1 Files Affected:
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc
index 088ca33e3c8c56..3a79246b5f14b8 100644
--- a/llvm/lib/Support/Unix/Signals.inc
+++ b/llvm/lib/Support/Unix/Signals.inc
@@ -309,6 +309,12 @@ static void RegisterHandlers() { // Not signal-safe.
struct sigaction NewHandler;
+#ifndef SA_ONSTACK
+ // Some platforms such as QNX do not define or implement SA_ONSTACK,
+ // so default that flag to 0 to just use the pre-existing stack there.
+ int SA_ONSTACK = 0;
+#endif
+
switch (Kind) {
case SignalKind::IsKill:
NewHandler.sa_handler = SignalHandler;
|
|
cc @AlexMaclean |
|
cc @Artem-B |
|
I have no context for this change. Based on the folks CC'ed, it may have something to do with NVPTX back-end, but I don't quite see how it may be related to QNX. |
Hello @Artem-B! May be do you know who can review it? |
|
Check who made meaningful commits to https://github.com/llvm/llvm-project/blob/main/llvm/lib/Support/Unix/Signals.inc and who reviewed those changes. That would be a good starting point. |
|
@boomanaiden154 @s-barannikov could you review this small patch, please? |
Some platforms such as QNX do not define or implement SA_ONSTACK, so default that flag to 0 to just use the pre-existing stack there.