From patchwork Sat Aug 20 15:32:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 9291745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6D4C7607FF for ; Sat, 20 Aug 2016 15:42:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6091C28C92 for ; Sat, 20 Aug 2016 15:42:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54C6528C94; Sat, 20 Aug 2016 15:42:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DF8EE28C92 for ; Sat, 20 Aug 2016 15:42:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 269006E0D2; Sat, 20 Aug 2016 15:42:12 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: delayed 566 seconds by postgrey-1.35 at gabe; Sat, 20 Aug 2016 15:42:10 UTC Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTP id ECE3A6E0D2 for ; Sat, 20 Aug 2016 15:42:10 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 20 Aug 2016 08:32:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,550,1464678000"; d="scan'208";a="751362174" Received: from mcvlad-wk.rb.intel.com ([10.237.105.57]) by FMSMGA003.fm.intel.com with ESMTP; 20 Aug 2016 08:32:43 -0700 From: Marius Vlad To: intel-gfx@lists.freedesktop.org Date: Sat, 20 Aug 2016 18:32:36 +0300 Message-Id: <1471707156-6683-1-git-send-email-marius.c.vlad@intel.com> X-Mailer: git-send-email 2.8.1 Subject: [Intel-gfx] [PATCH i-g-t] lib/igt_core: Print stacktrace when receiving one of the crash signals. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP While at it add SIGFPE as a crash signal. Signed-off-by: Marius Vlad CC: Chris Wilson --- lib/igt_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 801f02f..67e1a4f 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1482,7 +1482,8 @@ static bool exit_handler_disabled; #define SILENT(x) { x, NULL, 0 } static const struct { int number; const char *name; size_t name_len; } handled_signals[] = { SILENT(SIGINT), SILENT(SIGHUP), SILENT(SIGTERM), SILENT(SIGQUIT), - SILENT(SIGPIPE), SIGDEF(SIGABRT), SIGDEF(SIGSEGV), SIGDEF(SIGBUS) }; + SILENT(SIGPIPE), SIGDEF(SIGABRT), SIGDEF(SIGSEGV), SIGDEF(SIGBUS), + SIGDEF(SIGFPE) }; #undef SILENT #undef SIGDEF @@ -1542,6 +1543,7 @@ static bool crash_signal(int sig) switch (sig) { case SIGILL: case SIGBUS: + case SIGFPE: case SIGSEGV: return true; default: @@ -1571,7 +1573,7 @@ static void fatal_sig_handler(int sig) igt_exitcode = 128 + sig; failed_one = true; - + print_backtrace(); exit_subtest("CRASH"); } break;