From patchwork Tue Sep 20 08:20:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Vlad X-Patchwork-Id: 9341143 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 42395607D0 for ; Tue, 20 Sep 2016 08:21:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 370CF29CCB for ; Tue, 20 Sep 2016 08:21:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BA1829CF1; Tue, 20 Sep 2016 08:21:09 +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 1FBBF29CCB for ; Tue, 20 Sep 2016 08:21:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DD3D4894D4; Tue, 20 Sep 2016 08:21:06 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B3A2894D4 for ; Tue, 20 Sep 2016 08:21:05 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP; 20 Sep 2016 01:21:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,366,1470726000"; d="scan'208";a="11145875" Received: from mcvlad-wk.rb.intel.com ([10.237.105.57]) by fmsmga006.fm.intel.com with ESMTP; 20 Sep 2016 01:21:03 -0700 From: Marius Vlad To: intel-gfx@lists.freedesktop.org Date: Tue, 20 Sep 2016 11:20:38 +0300 Message-Id: <1474359638-30596-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 in initialization/fixture blocks. 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 Likely candidate for this behaviour is the igt_fixture block. Seen in the CI by running tests/kms_psr_sink_crc which is causing segfaults in the fixture block. While at it fix some minor printing bugs. Signed-off-by: Marius Vlad CC: Chris Wilson --- lib/igt_core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index dd27a22..43db468 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1122,7 +1122,7 @@ static void printnum(unsigned long long num, unsigned base) { int i = 0; - unsigned long long __num; + unsigned long long __num = num; /* determine from where we should start dividing */ do { @@ -1264,7 +1264,7 @@ static void print_backtrace_sig_safe(void) unw_word_t off; if (unw_get_proc_name(&cursor, name, 255, &off) < 0) - xstrlcpy(name, "", 9); + xstrlcpy(name, "", 10); xprintf(" #%d [%s+0x%x]\n", stack_num++, name, (unsigned int) off); @@ -1740,7 +1740,7 @@ static void fatal_sig_handler(int sig) igt_assert_eq(write(STDERR_FILENO, ".\n", 2), 2); } - if (in_subtest && crash_signal(sig)) { + if (crash_signal(sig)) { /* Linux standard to return exit code as 128 + signal */ if (!failed_one) igt_exitcode = 128 + sig; @@ -1749,7 +1749,8 @@ static void fatal_sig_handler(int sig) #ifdef HAVE_LIBUNWIND print_backtrace_sig_safe(); #endif - exit_subtest("CRASH"); + if (in_subtest) + exit_subtest("CRASH"); } break; }