Skip to content

Commit

Permalink
warn about ASAN limitation ASLR > 28bits
Browse files Browse the repository at this point in the history
  • Loading branch information
mirostauder committed Mar 14, 2024
1 parent f6aea2f commit 8a0e326
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand Down
4 changes: 4 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion test/tap/tap/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion test/tap/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)\"
Expand Down
5 changes: 4 additions & 1 deletion test/tap/tests_with_deps/deprecate_eof_support/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8a0e326

Please sign in to comment.