]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stacktrace-on-signal: Use kill(getpid(), sig_num)
authorArne Welzel <arne.welzel@corelight.com>
Wed, 4 May 2022 18:06:36 +0000 (20:06 +0200)
committerJeff Lucovsky <jeff@lucovsky.org>
Fri, 27 May 2022 11:51:21 +0000 (07:51 -0400)
kill(0, ...) re-raises the signal to every processes in the process
group which may impact unrelated processes.

Concretely, in our CI pipeline, a segfaulting Suricata process killed
the test driver.

(cherry picked from commit b6407c4253b2037cec7390364b4f0f69ccea6b0e)

src/suricata.c

index 340b7b8b1826d16b89e518661b813a35d157acc3..e005c736d0dadbdd19f7c4f9c53797b84ba270b8 100644 (file)
@@ -336,7 +336,7 @@ static void SignalHandlerUnexpected(int sig_num, siginfo_t *info, void *context)
 
 terminate:
     // Propagate signal to watchers, if any
-    kill(0, sig_num);
+    kill(getpid(), sig_num);
 }
 #undef UNW_LOCAL_ONLY
 #endif /* HAVE_LIBUNWIND */