From 0e82fcd999a0515fee912ca040a265a08bfa2cc1 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 18 Sep 2018 15:56:36 +0200 Subject: [PATCH] Always notify about crashes And by crash I mean anything that exits with SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGSYS. Fixes #4962. --- src/proc.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/proc.cpp b/src/proc.cpp index adb59d8b2..593418e3d 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -55,6 +55,9 @@ /// Status of last process to exit. static int last_status = 0; +/// The signals that signify crashes to us. +static const std::vector crashsignals = { SIGABRT, SIGBUS, SIGFPE, SIGILL, SIGSEGV, SIGSYS }; + bool job_list_is_empty() { ASSERT_IS_MAIN_THREAD(); return parser_t::principal_parser().job_list().empty(); @@ -533,7 +536,8 @@ static int process_clean_after_marking(bool allow_interactive) { // Handle signals other than SIGPIPE. int proc_is_job = (p->is_first_in_job && p->is_last_in_job); if (proc_is_job) j->set_flag(JOB_NOTIFIED, true); - if (j->get_flag(JOB_SKIP_NOTIFICATION)) { + // Always report crashes. + if (j->get_flag(JOB_SKIP_NOTIFICATION) && !contains(crashsignals,WTERMSIG(p->status))) { continue; }