From patchwork Thu Apr 22 15:54:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaetan Rivet X-Patchwork-Id: 1469280 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=u256.net header.i=@u256.net header.a=rsa-sha256 header.s=fm1 header.b=iyHlTcDf; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=UxJJlK3i; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FR2770ThGz9sW5 for ; Fri, 23 Apr 2021 01:54:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id DBF06405EA; Thu, 22 Apr 2021 15:54:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gbdoTOr1OYgv; Thu, 22 Apr 2021 15:54:51 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTP id 4C2D7403B9; Thu, 22 Apr 2021 15:54:50 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C248FC001B; Thu, 22 Apr 2021 15:54:48 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6E97DC001F for ; Thu, 22 Apr 2021 15:54:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 30152608E5 for ; Thu, 22 Apr 2021 15:54:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=u256.net header.b="iyHlTcDf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="UxJJlK3i" Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d8CX3cdmXJRf for ; Thu, 22 Apr 2021 15:54:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by smtp3.osuosl.org (Postfix) with ESMTPS id 213B36068C for ; Thu, 22 Apr 2021 15:54:40 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 721AE160C; Thu, 22 Apr 2021 11:54:39 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 22 Apr 2021 11:54:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u256.net; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=yQH7JP6AybdTn RonVs39ILJOOXSxqsuufmeRIjlKvc4=; b=iyHlTcDfux9qiFPKVOS4n+gdTmb54 HSxUolmzkSUPx+wbbJx6whxPApKNEXq+BDk7vyzGeSdZr0tSAYWHQW1QIRACTuvF 4DfZJvPK6w5QuG1+ZFCRFUa/dapGXbxYfDdffPXvZv3gFhBarnOqyP3PgOEiCjmq ri6hx+ubZ0G83aAsJrqnFmAkfeWjJg8GGiSjJWhdPVEWj5bwXxfAeIumbytQ2V76 92c5ibCBP6jXPWawgI8BuYZAkVOa4gvhULMMABEN/7AVctBNWCvHtD8ysj+dUjmd Esbmhwfwy4hUqj+yQ2d6wf7tAeVt0VXzjvI0ZCRKLmGdIM3GSzPyHXMSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=yQH7JP6AybdTnRonVs39ILJOOXSxqsuufmeRIjlKvc4=; b=UxJJlK3i tmjUVq8aIm4HcbvvFIqakrOQRI1lQUACUa9qBx8iFyRrA1xr2rpIGlVrFlS5TPE2 tZom6FdJcMOk0ab7XaWWJVkHbXihYQwxb0/CU/o5LUvFTYv//cpbh1ZrjgNz9ptG Fj3GbB8JiKqk5tZyjXCNrEbxBTu9LGSojG9Df3gbakaJpkLMloOOyUWadqxJkNhA SpiHQmKLUQi0CEWp67UrxiaJJ6zuqHnGAaIu1Ziy8o4F1UlYfiaVQ4SLnadj34nO agDsddC/KFJeU5SqqZEfxg3MuY74LrTjVJv13PhMpwWmMpUtcrByeHTTjELAKxKy hsmwawwLUEb/Ig== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddutddgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepifgrvghtrghnucftihhvvghtuceoghhrihhvvgesuhdvheei rdhnvghtqeenucggtffrrghtthgvrhhnpeduheekveehfedtueejjeeigeehvdfggefhte dugedutdefhfekhedugeetveeuhfenucffohhmrghinhepshhhsgdrtghinecukfhppeek iedrvdehgedrvdegfedrudegieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehgrhhivhgvsehuvdehiedrnhgvth X-ME-Proxy: Received: from inocybe.home (lfbn-poi-1-930-146.w86-254.abo.wanadoo.fr [86.254.243.146]) by mail.messagingengine.com (Postfix) with ESMTPA id 04DED240066; Thu, 22 Apr 2021 11:54:37 -0400 (EDT) From: Gaetan Rivet To: ovs-dev@openvswitch.org Date: Thu, 22 Apr 2021 17:54:26 +0200 Message-Id: <146a494ac326cb9175bf608398c9f18e35b9db3c.1619106089.git.grive@u256.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Cc: i.maximets@ovn.org Subject: [ovs-dev] [RFC PATCH 1/8] configure: add --enable-asan option X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Add a configure option to enable ASAN in a simple way. Adding an AC variable to allow checking for support in the testsuite. Signed-off-by: Gaetan Rivet --- .ci/linux-build.sh | 4 ++-- NEWS | 1 + acinclude.m4 | 16 ++++++++++++++++ configure.ac | 1 + tests/atlocal.in | 1 + 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index 977449350..3c58637b4 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -229,10 +229,10 @@ fi if [ "$ASAN" ]; then # This will override default option configured in tests/atlocal.in. export ASAN_OPTIONS='detect_leaks=1' + EXTRA_OPTS="$EXTRA_OPTS --enable-asan" # -O2 generates few false-positive memory leak reports in test-ovsdb # application, so lowering optimizations to -O1 here. - CLFAGS_ASAN="-O1 -fno-omit-frame-pointer -fno-common -fsanitize=address" - CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} ${CLFAGS_ASAN}" + CFLAGS_FOR_OVS="${CFLAGS_FOR_OVS} -O1" fi save_OPTS="${OPTS} $*" diff --git a/NEWS b/NEWS index 95cf922aa..57e1f041b 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ Post-v2.15.0 * New option '--no-record-hostname' to disable hostname configuration in ovsdb on startup. * New command 'record-hostname-if-not-set' to update hostname in ovsdb. + - New --enable-asan configure option enables AddressSanitizer. v2.15.0 - 15 Feb 2021 diff --git a/acinclude.m4 b/acinclude.m4 index 15a54d636..615e7f962 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -58,6 +58,22 @@ AC_DEFUN([OVS_ENABLE_WERROR], fi AC_SUBST([SPARSE_WERROR])]) +dnl OVS_ENABLE_ASAN +AC_DEFUN([OVS_ENABLE_ASAN], + [AC_ARG_ENABLE( + [asan], + [AC_HELP_STRING([--enable-asan], + [Enable the Address Sanitizer])], + [ASAN_ENABLED=yes], [ASAN_ENABLED=no]) + AC_SUBST([ASAN_ENABLED]) + AC_CONFIG_COMMANDS_PRE([ + if test "$ASAN_ENABLED" = "yes"; then + OVS_CFLAGS="$OVS_CFLAGS -fno-omit-frame-pointer" + OVS_CFLAGS="$OVS_CFLAGS -fno-common -fsanitize=address" + fi + ]) + ]) + dnl OVS_CHECK_LINUX dnl dnl Configure linux kernel source tree diff --git a/configure.ac b/configure.ac index c077034d4..eec5a9d1b 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,7 @@ OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER]) OVS_CONDITIONAL_CC_OPTION([-mavx512f], [HAVE_AVX512F]) OVS_CHECK_CC_OPTION([-mavx512f], [CFLAGS="$CFLAGS -DHAVE_AVX512F"]) OVS_ENABLE_WERROR +OVS_ENABLE_ASAN OVS_ENABLE_SPARSE OVS_CTAGS_IDENTIFIERS OVS_CHECK_DPCLS_AUTOVALIDATOR diff --git a/tests/atlocal.in b/tests/atlocal.in index cfca7e192..f61e752bf 100644 --- a/tests/atlocal.in +++ b/tests/atlocal.in @@ -220,6 +220,7 @@ export OVS_SYSLOG_METHOD OVS_CTL_TIMEOUT=30 export OVS_CTL_TIMEOUT +ASAN_ENABLED='@ASAN_ENABLED@' # Add some default flags to make the tests run better under Address # Sanitizer, if it was used for the build. #