Project

General

Profile

Actions

Bug #5331

closed

stacktrace-on-signal: Kills all processes in the same process group

Added by Arne Welzel over 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

A test in our CI pipeline tickled a Suricata segfault, `stacktrace-on-signal` functionality was enabled and our test driver was killed when re-raising the signal to the whole process group rather than just the Suricata process.

Will open a PR.

Author: Arne Welzel <arne.welzel@corelight.com>
Date:   Wed May 4 20:06:36 2022 +0200

    stacktrace-on-signal: Use kill(getpid(), sig_num)

    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.

diff --git a/src/suricata.c b/src/suricata.c
index 24ffa0fe6..b246ce13f 100644
--- a/src/suricata.c
+++ b/src/suricata.c
@@ -342,7 +342,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);
 }

Subtasks 1 (0 open1 closed)

Bug #5351: stacktrace-on-signal: Kills all processes in the same process group (6.0.x backport)ClosedJeff LucovskyActions

Related issues 1 (0 open1 closed)

Copied to Suricata - Bug #5334: stacktrace-on-signal: Kills all processes in the same process groupRejectedJeff LucovskyActions
Actions #1

Updated by Jason Ish over 2 years ago

  • Status changed from New to In Review
Actions #2

Updated by Jeff Lucovsky over 2 years ago

  • Assignee changed from OISF Dev to Arne Welzel
Actions #3

Updated by Jeff Lucovsky over 2 years ago

  • Copied to Bug #5334: stacktrace-on-signal: Kills all processes in the same process group added
Actions #4

Updated by Jeff Lucovsky over 2 years ago

  • Status changed from In Review to Resolved
  • Target version changed from TBD to 7.0.0-beta1
Actions #5

Updated by Shivani Bhardwaj about 2 years ago

  • Label deleted (Needs backport to 6.0)
Actions #6

Updated by Victor Julien about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF