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).
This commit is contained in:
Daan De Meyer
2022-06-07 19:10:34 +01:00
parent db6f9b02a7
commit 647475c7df
+3 -1
View File
@@ -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;
}