Skip to content

Commit

Permalink
fix: Handle SIGUSR1 even under +B i / +B d
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jktomer committed Feb 25, 2021
1 parent af06b43 commit 1a54ba2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions erts/emulator/sys/unix/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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. */
Expand Down

0 comments on commit 1a54ba2

Please sign in to comment.