From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63929 invoked by alias); 27 Aug 2018 14:57:32 -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 63032 invoked by uid 89); 27 Aug 2018 14:56:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=ship, installing X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.64.36) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Aug 2018 14:56:25 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 74678400F0BDC for ; Mon, 27 Aug 2018 09:56:23 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id uIwJf7ymDkBj6uIwJfM8tM; Mon, 27 Aug 2018 09:56:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=L7PS6za106f2pBHfinfh+Jr7C0ugFkns03Z8m18TYq4=; b=Z6Qx0QlHcr5EQEGZMJ1oh7j+Ze 05Sah5vn8H40c+6P1ZGzOuJs81oUweHxFuWl8eVwidzoFwRYU+SYl2UO0SToXWEzE4+2MDeAkLCYT BNhSToe8FyOgKMt6yLy0u5ujF; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:54030 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fuIwJ-000csy-4d for gdb-patches@sourceware.org; Mon, 27 Aug 2018 09:56:23 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [PATCH 0/9] Add UBSan to the build Date: Mon, 27 Aug 2018 14:57:00 -0000 Message-Id: <20180827145620.11055-1-tom@tromey.com> X-SW-Source: 2018-08/txt/msg00654.txt.bz2 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. Tom