From d9166bd62dd9f9765a9df086ed11ed97fb3a1de8 Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Thu, 5 Dec 2019 20:16:44 +0100 Subject: [PATCH] Disable address sanitizer (ASan) now that we are preparing for 5.0.0 stable. This can still be enabled during ./Config by answering to the last question: --with-asan But it is no longer enabled by default since it causes a slowdown of X and increases memory by a factor Y. --- configure | 9 ++++----- configure.ac | 14 ++++---------- unrealircd.in | 6 ++---- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/configure b/configure index c28cdd57b..a581f8937 100755 --- a/configure +++ b/configure @@ -1410,8 +1410,8 @@ Optional Features: rather than dynamically (noone knows if disabling dynamic linking actually does anything or not) --enable-werror Turn compilation warnings into errors (-Werror) - --disable-asan Disable address sanitizer and other debugging - options + --enable-asan Enable address sanitizer and other debugging + options, not recommended for production servers! --enable-libcurl=DIR enable libcurl (remote include) support Optional Packages: @@ -6553,12 +6553,11 @@ else fi - # Check whether --enable-asan was given. if test "${enable_asan+set}" = set; then : - enableval=$enable_asan; ac_cv_asan="no" + enableval=$enable_asan; ac_cv_asan="$enableval" else - ac_cv_asan="yes" + ac_cv_asan="no" fi diff --git a/configure.ac b/configure.ac index 8c9ba7593..11274a0cd 100644 --- a/configure.ac +++ b/configure.ac @@ -509,17 +509,11 @@ AC_ARG_ENABLE([werror], [ac_cv_werror="$enableval"], [ac_cv_werror="no"]) -dnl AC_ARG_ENABLE([asan], -dnl [AS_HELP_STRING([--enable-asan], -dnl [Enable address sanitizer and other debugging options, not recommended for production servers!])], -dnl [ac_cv_asan="$enableval"], -dnl [ac_cv_asan="no"]) - AC_ARG_ENABLE([asan], - [AS_HELP_STRING([--disable-asan], - [Disable address sanitizer and other debugging options])], - [ac_cv_asan="no"], - [ac_cv_asan="yes"]) + [AS_HELP_STRING([--enable-asan], + [Enable address sanitizer and other debugging options, not recommended for production servers!])], + [ac_cv_asan="$enableval"], + [ac_cv_asan="no"]) AC_CHECK_FUNCS([poll], AC_DEFINE([HAVE_POLL], [], [Define if you have poll])) diff --git a/unrealircd.in b/unrealircd.in index 159802f76..eed10f85b 100644 --- a/unrealircd.in +++ b/unrealircd.in @@ -14,10 +14,8 @@ if [ "$1" = "start" ] ; then if [ -r $PID_FILE ] ; then mv -f $PID_FILE $PID_BACKUP fi - # We use AddressSanitizer in development builds, but ASan does not dump core - # by default because older gcc/clang might dump a 16TB core file. - # We explicitly enable it here. Note that this only applies to 5.0.0-alpha - # and 5.0.0-beta releases and explicit --with-asan development builds: + # When built with --with-asan, ASan does not dump core by default because + # older gcc/clang might dump a 16TB core file. We explicitly enable it here. export ASAN_OPTIONS="abort_on_error=1:disable_coredump=0:unmap_shadow_on_exit=1:log_path=@TMPDIR@/unrealircd_asan:detect_leaks=0" # Check if ~/Unrealxxx/unrealircd.conf exists but the file