From patchwork Thu Sep 24 13:13:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Morton X-Patchwork-Id: 7256581 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 20F7FBEEC1 for ; Thu, 24 Sep 2015 13:14:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50747208DC for ; Thu, 24 Sep 2015 13:14:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 95795208D9 for ; Thu, 24 Sep 2015 13:14:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F1C466EECE; Thu, 24 Sep 2015 06:14:27 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id D34A96EECE for ; Thu, 24 Sep 2015 06:14:26 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 24 Sep 2015 06:13:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,581,1437462000"; d="scan'208";a="812313469" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga002.jf.intel.com with ESMTP; 24 Sep 2015 06:13:33 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.84]) by irsmsx105.ger.corp.intel.com ([169.254.7.235]) with mapi id 14.03.0248.002; Thu, 24 Sep 2015 14:13:32 +0100 From: "Morton, Derek J" To: "Wood, Thomas" , "intel-gfx@lists.freedesktop.org" Thread-Topic: [Intel-gfx] [PATCH i-g-t] lib/tests: explicitly raise SIGSEGV Thread-Index: AQHQ9rVgtQC2Y34emkS3zNee0CheEZ5Lp99w Date: Thu, 24 Sep 2015 13:13:32 +0000 Message-ID: <2D016F5BA44C744783BA96B1D3EBC5BD13E91636@IRSMSX102.ger.corp.intel.com> References: <1443090618-21269-1-git-send-email-thomas.wood@intel.com> In-Reply-To: <1443090618-21269-1-git-send-email-thomas.wood@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] MIME-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH i-g-t] lib/tests: explicitly raise SIGSEGV 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This relies on signal.h being included by wait.h. Would it be better to include it explicitly? -----Original Message----- From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of Thomas Wood Sent: Thursday, September 24, 2015 11:30 AM To: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH i-g-t] lib/tests: explicitly raise SIGSEGV Dereferencing a NULL pointer is undefined behaviour and may not always result in a segmentation fault. Explicitly raise the SIGSEGV signal to test handling of this signal. Signed-off-by: Thomas Wood --- lib/tests/igt_segfault.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx diff --git a/lib/tests/igt_segfault.c b/lib/tests/igt_segfault.c index b420b1a..bc7641d 100644 --- a/lib/tests/igt_segfault.c +++ b/lib/tests/igt_segfault.c @@ -57,11 +57,15 @@ bool runc; char test[] = "test"; char *argv_run[] = { test }; +static void crashme(void) +{ + raise(SIGSEGV); +} + static int do_fork(void) { int pid, status; int argc; - void (*crashme)(void) = NULL; switch (pid = fork()) { case -1: