From 65209e4fbf30d09dda89aa4b1d831461506848d7 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Tue, 8 Oct 2019 20:47:38 -0300 Subject: [PATCH 1/2] configure.ac: fix memory sanitizer test We should test for `-fsanitize=memory` instead of `-fsanitize=thread` when enabling memory sanitizer. While here, fix the error message. Signed-off-by: Rafael Zalamena --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 88f1c4f627..730e2ae6f0 100755 --- a/configure.ac +++ b/configure.ac @@ -328,8 +328,8 @@ if test "$enable_thread_sanitizer" = "yes"; then ]) fi if test "$enable_memory_sanitizer" = "yes"; then - AC_C_FLAG([-fsanitize=thread -fPIE -pie], [ - AC_MSG_ERROR([$CC does not support Thread Sanitizer.]) + AC_C_FLAG([-fsanitize=memory -fPIE -pie], [ + AC_MSG_ERROR([$CC does not support Memory Sanitizer.]) ], [ SAN_FLAGS="-fsanitize=memory -fPIE -pie" ]) From 4260f16567e7435e4615d2a4bcaa928e30914573 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Tue, 8 Oct 2019 21:35:06 -0300 Subject: [PATCH 2/2] doc: update topotests doc for address sanitizer Use the `--enable-address-sanitizer` option instead of the manual version using environment flags. This also avoids the problem of having to remember to skip clippy with the custom flags: ``` make -C lib CFLAGS="-g -O2" LDFLAGS="-g" clippy ``` The snippet above is not needed with `--enable-address-sanitizer`! Signed-off-by: Rafael Zalamena --- doc/developer/topotests.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/doc/developer/topotests.rst b/doc/developer/topotests.rst index a0a574a79c..c2e72e2ec5 100644 --- a/doc/developer/topotests.rst +++ b/doc/developer/topotests.rst @@ -189,11 +189,8 @@ for ``master`` branch: git clone https://github.com/FRRouting/frr.git cd frr ./bootstrap.sh - export CC=gcc - export CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer" - export LD=gcc - export LDFLAGS="-g -fsanitize=address -ldl" - ./configure --enable-shared=no \ + ./configure \ + --enable-address-sanitizer \ --prefix=/usr/lib/frr --sysconfdir=/etc/frr \ --localstatedir=/var/run/frr \ --sbindir=/usr/lib/frr --bindir=/usr/lib/frr \