Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH] Disable the undefined behavior sanitizer by default
Date: Tue, 09 Oct 2018 18:02:00 -0000	[thread overview]
Message-ID: <20181009180231.20321-1-tom@tromey.com> (raw)

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  <tom@tromey.com>

	* configure: Rebuild.
	* sanitize.m4 (AM_GDB_UBSAN): Default to no.
	* NEWS: Update --enable-ubsan documentation.

gdb/doc/ChangeLog
2018-10-09  Tom Tromey  <tom@tromey.com>

	* 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
-- 
2.17.1


             reply	other threads:[~2018-10-09 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 18:02 Tom Tromey [this message]
2018-10-09 18:05 ` Pedro Alves
2018-10-09 18:20 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181009180231.20321-1-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox