From b0ef600a5af812b00a924637b5e4808d38da0161 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 19:12:42 +0000 Subject: [PATCH] sudo sysctl vm.mmap_rnd_bits=28 for ASAN testing --- test/tap/tap/Makefile | 3 +++ test/tap/tests/Makefile | 3 +++ test/tap/tests_with_deps/deprecate_eof_support/Makefile | 3 +++ 3 files changed, 9 insertions(+) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index a79508ece9..39d6986f55 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -50,6 +50,9 @@ STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPL WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed $(WASAN) diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index ed0de23b3d..235c9a8540 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -148,6 +148,9 @@ endif WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address -DTEST_WITHASAN + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed -Wl,-rpath,$(TAP_LDIR) $(WGCOV) $(WASAN) -DGITVERSION=\"$(GIT_VERSION)\" diff --git a/test/tap/tests_with_deps/deprecate_eof_support/Makefile b/test/tap/tests_with_deps/deprecate_eof_support/Makefile index e800475998..a1d7192942 100644 --- a/test/tap/tests_with_deps/deprecate_eof_support/Makefile +++ b/test/tap/tests_with_deps/deprecate_eof_support/Makefile @@ -103,6 +103,9 @@ endif WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed -Wl,-rpath,"../../tap" $(WGCOV) $(WASAN)