From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20469 invoked by alias); 9 Oct 2018 18:05:08 -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 20454 invoked by uid 89); 9 Oct 2018 18:05:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Tue, 09 Oct 2018 18:05:06 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82B2E317C411; Tue, 9 Oct 2018 18:05:05 +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 AFBCA7E57B; Tue, 9 Oct 2018 18:05:04 +0000 (UTC) Subject: Re: [PATCH] Disable the undefined behavior sanitizer by default To: Tom Tromey , gdb-patches@sourceware.org References: <20181009180231.20321-1-tom@tromey.com> From: Pedro Alves Message-ID: <7f7e560e-d005-04e0-92fb-94d959b3ed6f@redhat.com> Date: Tue, 09 Oct 2018 18:05: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: <20181009180231.20321-1-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00232.txt.bz2 On 10/09/2018 07:02 PM, Tom Tromey wrote: > There have been a few undefined behavior failures reported, and Pedro > suggested that the sanitizer be disabled by default. This patch > implements this. Thanks. TBC, I think it'll be good to enable it by default. But for now, we're already aware of a few issues that need fixing, and the people fixing them can do --enable-ubsan explicitly. Please push. > > 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 > Thanks, Pedro Alves