From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128121 invoked by alias); 28 Aug 2018 19:03:23 -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 128107 invoked by uid 89); 28 Aug 2018 19:03:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=non-working, Finally, ship, nonworking X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Aug 2018 19:03:21 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2F680400738B; Tue, 28 Aug 2018 19:03:20 +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 AF0AB2026D6B; Tue, 28 Aug 2018 19:03:19 +0000 (UTC) Subject: Re: [PATCH 0/9] Add UBSan to the build To: Tom Tromey , gdb-patches@sourceware.org References: <20180827145620.11055-1-tom@tromey.com> From: Pedro Alves Message-ID: <152ef6ac-cd48-72be-6fae-9397bca2c8b8@redhat.com> Date: Tue, 28 Aug 2018 19:03:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180827145620.11055-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-08/txt/msg00709.txt.bz2 On 08/27/2018 03:56 PM, Tom Tromey wrote: > This series adds undefined behavior checking to the build and fixes > all the cases of UB that are found by the test suite. See the final > patch for details, but basically UBsan is enabled by default only in > development mode. > > None of the current cases of UB seem to cause any bugs; but of course > compilers have a history of exploiting UB for optimizations, so it's > possible that UB will result in bugs in the future. > > This series could be improved in a couple of ways. > > First, it does not check for UB in any of the libraries used by gdb. > > Second, most of the builders do not have the ubsan runtime library > installed. (I don't know why this isn't just a dependency of gcc; it > seems strange to ship a non-working -fsanitize=undefined by default.) > It's possible that installing this library on the builders will result > in new failures. > > Finally, I think it would be good -- in fact, even more useful -- to > treat the address sanitizer in a similar way. I have some patches > toward this goal, but I haven't submitted them yet because there is > one ASan failure that I haven't fixed. > > Let me know what you think. I think this is a good idea. On enabling this by default on devel builds, do you have a sense of CPU/memory overhead this introduces? Thanks, Pedro Alves