diff --git a/lib/Makefile b/lib/Makefile index b9f61c6cd0..b94dd2fc65 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -77,6 +77,10 @@ ifeq ($(WITHASAN),1) WASAN := -fsanitize=address # Force the disable of JEMALLOC, since ASAN isn't compatible. export NOJEMALLOC=1 + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif NOJEM := diff --git a/src/Makefile b/src/Makefile index 67ea80f12d..0d2e577cf2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -140,6 +140,10 @@ ifeq ($(WITHASAN),1) WASAN := -fsanitize=address # Force the disable of JEMALLOC, since ASAN isn't compatible. export NOJEMALLOC=1 + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif ifeq ($(TEST_WITHASAN),1) WASAN += -DTEST_WITHASAN diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 627fde406d..b4650be943 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -50,9 +50,12 @@ STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPL WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address + # Force the disable of JEMALLOC, since ASAN isn't compatible. + export NOJEMALLOC=1 # workaroud ASAN limitation ASLR > 28bits # https://github.com/google/sanitizers/issues/1716 - DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed $(WASAN) diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 965146eeeb..b1f73e5c0b 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -148,9 +148,12 @@ endif WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address -DTEST_WITHASAN + # Force the disable of JEMALLOC, since ASAN isn't compatible. + export NOJEMALLOC=1 # workaroud ASAN limitation ASLR > 28bits # https://github.com/google/sanitizers/issues/1716 - DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) 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 16fcbf35b8..b4060cdb18 100644 --- a/test/tap/tests_with_deps/deprecate_eof_support/Makefile +++ b/test/tap/tests_with_deps/deprecate_eof_support/Makefile @@ -103,9 +103,12 @@ endif WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address + # Force the disable of JEMALLOC, since ASAN isn't compatible. + export NOJEMALLOC=1 # workaroud ASAN limitation ASLR > 28bits # https://github.com/google/sanitizers/issues/1716 - DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed -Wl,-rpath,"../../tap" $(WGCOV) $(WASAN)