From: Daan De Meyer Date: Thu, 2 Jun 2022 13:32:44 +0000 (+0200) Subject: basic: Propagate SIGBUS signal info when re-raising signals X-Git-Tag: v252-rc1~858 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=647475c7df4d13e30c328e6697231781d9d83d46;p=thirdparty%2Fsystemd.git basic: Propagate SIGBUS signal info when re-raising signals raise() won't propagate the siginfo information of the signal that's re-raised. rt_sigqueueinfo() allows us to provide the original siginfo struct which makes sure it is propagated to the next signal handler (or to the coredump). --- diff --git a/src/basic/sigbus.c b/src/basic/sigbus.c index 8ff060a8d1e..95ecb60fe22 100644 --- a/src/basic/sigbus.c +++ b/src/basic/sigbus.c @@ -7,6 +7,8 @@ #include "macro.h" #include "memory-util.h" +#include "missing_syscall.h" +#include "process-util.h" #include "sigbus.h" #define SIGBUS_QUEUE_MAX 64 @@ -88,7 +90,7 @@ static void sigbus_handler(int sn, siginfo_t *si, void *data) { if (si->si_code != BUS_ADRERR || !si->si_addr) { assert_se(sigaction(SIGBUS, &old_sigaction, NULL) == 0); - raise(SIGBUS); + rt_sigqueueinfo(getpid_cached(), SIGBUS, si); return; }