From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44749 invoked by alias); 16 Oct 2018 16:11:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 44721 invoked by uid 89); 16 Oct 2018 16:11:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_1,SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 16 Oct 2018 16:11:38 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2C316B001; Tue, 16 Oct 2018 16:11:36 +0000 (UTC) Subject: Re: [PATCH][gdb/testsuite] Rewrite catch-follow-exec.exp To: Simon Marchi Cc: Gary Benson , gdb-patches@sourceware.org, Pedro Alves References: <20181005101122.GA23867@delia> <20181009135155.GB12668@blade.nx> <8f8ffb94-5a0c-8b2b-d541-eaacd7d1f42c@suse.de> <20181010092735.GA29557@blade.nx> <20181010134423.GA23926@blade.nx> <20181011074744.GA7677@delia> <750f69f3ea27d2ca530c896eef51e9eb@polymtl.ca> From: Tom de Vries Message-ID: <0a78e831-debc-8dfd-2446-6e6e99f3c76b@suse.de> Date: Tue, 16 Oct 2018 16:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <750f69f3ea27d2ca530c896eef51e9eb@polymtl.ca> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00348.txt.bz2 On 10/16/18 12:11 AM, Simon Marchi wrote: >> +    gdb_test_multiple "" "run til exit" { >> +    "runtime error:" { >> +        # Error in case of --enable-ubsan >> +        fail "No runtime error" >> +    } > > Can you explain what this catches?  If this isn't there but UBSan is > enabled, the crash isn't detected properly by the code below? Indeed. If I disable the fix this test-case is testing (so, I'm trying to make the test-case fail), and I build with --disable-ubsan, I get: ... 27079 exp8 0 0 CHILDKILLED SIGSEGV {segmentation violation} PASS: gdb.base/catch-follow-exec.exp: [lindex $result 2] == 0 FAIL: gdb.base/catch-follow-exec.exp: [lindex $result 3] == 1 FAIL: gdb.base/catch-follow-exec.exp: [llength $result] == 4 ... and with --enable-ubsan: ... ^[[1m/data/gdb_versions/devel/src/gdb/infcmd.c:2099:11:^[[1m^[[31m runtime error: ^[[1m^[[0m^[[1mmember access wi\ thin null pointer of type 'struct thread_info'^[[1m^[[0m^M FAIL: gdb.base/catch-follow-exec.exp: No runtime error ... Without the extra "runtime error:" clause, I'm not detecting the fail: ... ^[[1m/data/gdb_versions/devel/src/gdb/infcmd.c:2099:11:^[[1m^[[31m runtime error: ^[[1m^[[0m^[[1mmember access wi\ thin null pointer of type 'struct thread_info'^[[1m^[[0m^M PASS: gdb.base/catch-follow-exec.exp: [lindex $result 2] == 0 PASS: gdb.base/catch-follow-exec.exp: [lindex $result 3] == 1 PASS: gdb.base/catch-follow-exec.exp: [llength $result] == 4 ... Thanks, - Tom