From 647475c7df4d13e30c328e6697231781d9d83d46 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 2 Jun 2022 15:32:44 +0200 Subject: [PATCH] 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). --- src/basic/sigbus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/basic/sigbus.c b/src/basic/sigbus.c index 8ff060a8d1..95ecb60fe2 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; }