File 0501-fix-Handle-SIGUSR1-even-under-B-i-B-d.patch of Package erlang
From 4a67224b9396a5aacb9c90d52e4ec769cd92a629 Mon Sep 17 00:00:00 2001
From: Jonathan Klabunde Tomer <jkt@fb.com>
Date: Thu, 25 Feb 2021 14:44:59 -0800
Subject: [PATCH 1/2] fix: Handle SIGUSR1 even under +B i / +B d
The OTP documentation states that SIGUSR1 causes a crash dump unconditionally.
However, under +B i or +B d, the call to install the SIGUSR1 handler was not
made before this change, causing SIGUSR1 to kill process immediately instead.
---
erts/emulator/sys/unix/sys.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/erts/emulator/sys/unix/sys.c b/erts/emulator/sys/unix/sys.c
index 7ddfed7d25..be98b244e5 100644
--- a/erts/emulator/sys/unix/sys.c
+++ b/erts/emulator/sys/unix/sys.c
@@ -677,9 +677,6 @@ void erts_replace_intr(void) {
void init_break_handler(void)
{
sys_signal(SIGINT, request_break);
-#ifndef ETHR_UNUSABLE_SIGUSRX
- sys_signal(SIGUSR1, generic_signal_handler);
-#endif /* #ifndef ETHR_UNUSABLE_SIGUSRX */
sys_signal(SIGQUIT, generic_signal_handler);
}
@@ -694,6 +691,9 @@ void
erts_sys_unix_later_init(void)
{
sys_signal(SIGTERM, generic_signal_handler);
+#ifndef ETHR_UNUSABLE_SIGUSRX
+ sys_signal(SIGUSR1, generic_signal_handler);
+#endif /* #ifndef ETHR_UNUSABLE_SIGUSRX */
/* Ignore SIGCHLD to ensure orphaned processes don't turn into zombies on
* death when we're pid 1. */
--
2.26.2