From 9738e8b6d91685cb08ad682b511a7eca09ca1cc4 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 25 Sep 2017 18:34:54 -0400 Subject: Use SIGQUIT for DWARF backtraces instead of SIGUSR2 Reviewers: austin, erikd, simonmar Subscribers: NicolasT, rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3979 --- rts/posix/Signals.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rts/posix') diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c index 6b728905e6..e75f99def8 100644 --- a/rts/posix/Signals.c +++ b/rts/posix/Signals.c @@ -528,10 +528,10 @@ shutdown_handler(int sig STG_UNUSED) } /* ----------------------------------------------------------------------------- - * SIGUSR2 handler. + * SIGQUIT handler. * * We try to give the user an indication of what we are currently doing - * in response to SIGUSR2. + * in response to SIGQUIT. * -------------------------------------------------------------------------- */ static void backtrace_handler(int sig STG_UNUSED) @@ -539,7 +539,7 @@ backtrace_handler(int sig STG_UNUSED) #if USE_LIBDW LibdwSession *session = libdwInit(); Backtrace *bt = libdwGetBacktrace(session); - fprintf(stderr, "\nCaught SIGUSR2; Backtrace:\n"); + fprintf(stderr, "\nCaught SIGQUIT; Backtrace:\n"); libdwPrintBacktrace(session, stderr, bt); backtraceFree(bt); libdwFree(session); @@ -721,12 +721,12 @@ initDefaultHandlers(void) sysErrorBelch("warning: failed to install SIGPIPE handler"); } - // Print a backtrace on SIGUSR2 + // Print a backtrace on SIGQUIT action.sa_handler = backtrace_handler; sigemptyset(&action.sa_mask); action.sa_flags = 0; - if (sigaction(SIGUSR2, &action, &oact) != 0) { - sysErrorBelch("warning: failed to install SIGUSR2 handler"); + if (sigaction(SIGQUIT, &action, &oact) != 0) { + sysErrorBelch("warning: failed to install SIGQUIT handler"); } set_sigtstp_action(true); -- cgit v1.2.1