From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87731 invoked by alias); 17 Jan 2019 17:47:54 -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 87714 invoked by uid 89); 17 Jan 2019 17:47:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,KAM_SHORT,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=H*MI:sk:2019010 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Jan 2019 17:47:52 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D649DC07753B; Thu, 17 Jan 2019 17:47:50 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B25560BE8; Thu, 17 Jan 2019 17:47:49 +0000 (UTC) Subject: Re: [PATCH] Testsuite: Ensure stack protection is off for GCC To: Alan Hayward , "gdb-patches@sourceware.org" References: <20190107163715.5591-1-alan.hayward@arm.com> Cc: nd From: Pedro Alves Message-ID: <85a74180-c847-39b1-8ae7-6e59340fb61c@redhat.com> Date: Thu, 17 Jan 2019 17:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190107163715.5591-1-alan.hayward@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-01/txt/msg00410.txt.bz2 On 01/07/2019 04:37 PM, Alan Hayward wrote: > Using -fstack-protector-strong will cause GDB to break on the wrong line > when placing a breakpoint on a function. This is caused by due to > inadequate dwarf line numbering, and is being tracked by the GCC bug > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88432 > > GCC (and Clang) provided by Debian/Ubuntu default to Stack Protector > being enabled. > > So, ensure that when running the GDB testsuite, stack protector is always > turned off for GCC (option has existed since GCC 4.1.0). I think it'd still be good to add a GCC version check instead of unconditionally adding the option to all GCCs. The version of GCC we support building GDB with is not the same concept as which GCC version the target uses/supports, considering cross debugging / bare metal, etc. It's plausible some port may be using GCC 4.0, say. Or if someone wants to test against an old GCC to see what it generated, etc. Since it's easy to do, I think we should just do it. A regex similar to the old_gcc variable in gdb.ada/arrayidx.exp should do it? > > Also, ensure that this does not cause infinite recursion due to > test_compiler_info having to compile a file itself. > > Restore change in ovldbreak.exp which worked around the issue. Thanks for doing this. My suspicion was correct. :-) > > [Side note - this fix would be improved by checking for Ubuntu/Debian, > but I don't see any existing checks for that in the testsuite] Could you add a small test that tests the opposite? I.e., a smoke testcase with "-fstack-protector-strong" force-enabled? Probably test both force on and off for full coverage. Then xfail the test on unfixed GCCs. Which means all GCCs for now. Thanks, Pedro Alves