From patchwork Tue Oct 9 18:02:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 29684 Received: (qmail 16109 invoked by alias); 9 Oct 2018 18:02:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 15962 invoked by uid 89); 9 Oct 2018 18:02:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=rebuild, Rebuild X-HELO: gateway31.websitewelcome.com Received: from gateway31.websitewelcome.com (HELO gateway31.websitewelcome.com) (192.185.143.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 Oct 2018 18:02:35 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 9B32552D8D for ; Tue, 9 Oct 2018 13:02:33 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 9wL3gyYvqaSey9wL3gKiy5; Tue, 09 Oct 2018 13:02:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=cB9E/L2d4ckN4UtTTWb7bnO3j1kJ5Jrx/hKkGJiRXtQ=; b=SCvj0+vYVEog+J34fj75RD9Vo0 8yqVgb+48U3PvuJawItJddS29PyEfttdsb6yylw3RbnpdNankoormyZt0zVNddGsbmfSewgmQiP+8 /AXsU4L4P+dA9cBDArvuIpePS; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:51588 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1g9wL3-001Xe0-BR; Tue, 09 Oct 2018 13:02:33 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Disable the undefined behavior sanitizer by default Date: Tue, 9 Oct 2018 12:02:31 -0600 Message-Id: <20181009180231.20321-1-tom@tromey.com> There have been a few undefined behavior failures reported, and Pedro suggested that the sanitizer be disabled by default. This patch implements this. gdb/ChangeLog 2018-10-09 Tom Tromey * configure: Rebuild. * sanitize.m4 (AM_GDB_UBSAN): Default to no. * NEWS: Update --enable-ubsan documentation. gdb/doc/ChangeLog 2018-10-09 Tom Tromey * gdb.texinfo (Configure Options): Update --enable-ubsan documentation. --- gdb/ChangeLog | 6 ++++++ gdb/NEWS | 10 +++++----- gdb/configure | 2 +- gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 13 +++++++------ gdb/sanitize.m4 | 2 +- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index 8a0dd52fa7..126e61e282 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -122,11 +122,11 @@ FreeBSD/riscv riscv*-*-freebsd* --enable-ubsan - Enable or disable the undefined behavior sanitizer. Release - versions of GDB disable this by default if it is available, but - development versions enable it. Enabling this can cause a - performance penalty. The undefined behavior sanitizer was first - introduced in GCC 4.9. + Enable or disable the undefined behavior sanitizer. This is + disabled by default, but passing --enable-ubsan=yes or + --enable-ubsan=auto to configure will enable it. Enabling this can + cause a performance penalty. The undefined behavior sanitizer was + first introduced in GCC 4.9. *** Changes in GDB 8.2 diff --git a/gdb/configure b/gdb/configure index 304adc81fe..adb26e5d4d 100755 --- a/gdb/configure +++ b/gdb/configure @@ -15614,7 +15614,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "${enable_ubsan+set}" = set; then : enableval=$enable_ubsan; else - enable_ubsan=auto + enable_ubsan=no fi if test "x$enable_ubsan" = xauto; then diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index efd6dffb1e..b0dc3bf67c 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -35771,12 +35771,13 @@ to the compiler, which will fail the compilation if the compiler outputs any warning messages. @item --enable-ubsan -Enable the GCC undefined behavior sanitizer. By default this is -disabled in @value{GDBN} releases, but enabled, when available, when -building from git. The undefined behavior sanitizer checks for -C@t{++} undefined behavior. It has a performance cost, so if you are -looking at @value{GDBN}'s performance, you should disable it. The -undefined behavior sanitizer was first introduced in GCC 4.9. +Enable the GCC undefined behavior sanitizer. This is disabled by +default, but passing @code{--enable-ubsan=yes} or +@code{--enable-ubsan=auto} to @code{configure} will enable it. The +undefined behavior sanitizer checks for C@t{++} undefined behavior. +It has a performance cost, so if you are looking at @value{GDBN}'s +performance, you should disable it. The undefined behavior sanitizer +was first introduced in GCC 4.9. @end table @node System-wide configuration diff --git a/gdb/sanitize.m4 b/gdb/sanitize.m4 index 76df44da4f..979f6461c0 100644 --- a/gdb/sanitize.m4 +++ b/gdb/sanitize.m4 @@ -20,7 +20,7 @@ AC_DEFUN([AM_GDB_UBSAN],[ AC_ARG_ENABLE(ubsan, AS_HELP_STRING([--enable-ubsan], [enable undefined behavior sanitizer (auto/yes/no)]), - [],enable_ubsan=auto) + [],enable_ubsan=no) if test "x$enable_ubsan" = xauto; then if $development; then enable_ubsan=yes