Skip to content

Commit d777ef9

Browse files
committed
Merge branch 'pw/test-malloc-with-sanitize-address' into maint
Avoid problems from interaction between malloc_check and address sanitizer. source: <[email protected]> * pw/test-malloc-with-sanitize-address: tests: make SANITIZE=address imply TEST_NO_MALLOC_CHECK
2 parents ac8f6b6 + 067109a commit d777ef9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,8 +1267,9 @@ PTHREAD_CFLAGS =
12671267
SPARSE_FLAGS ?= -std=gnu99
12681268
SP_EXTRA_FLAGS = -Wno-universal-initializer
12691269

1270-
# For informing GIT-BUILD-OPTIONS of the SANITIZE=leak target
1270+
# For informing GIT-BUILD-OPTIONS of the SANITIZE=leak,address targets
12711271
SANITIZE_LEAK =
1272+
SANITIZE_ADDRESS =
12721273

12731274
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
12741275
# usually result in less CPU usage at the cost of higher peak memory.
@@ -1314,6 +1315,7 @@ SANITIZE_LEAK = YesCompiledWithIt
13141315
endif
13151316
ifneq ($(filter address,$(SANITIZERS)),)
13161317
NO_REGEX = NeededForASAN
1318+
SANITIZE_ADDRESS = YesCompiledWithIt
13171319
endif
13181320
endif
13191321

@@ -2862,6 +2864,7 @@ GIT-BUILD-OPTIONS: FORCE
28622864
@echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
28632865
@echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
28642866
@echo SANITIZE_LEAK=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_LEAK)))'\' >>$@+
2867+
@echo SANITIZE_ADDRESS=\''$(subst ','\'',$(subst ','\'',$(SANITIZE_ADDRESS)))'\' >>$@+
28652868
@echo X=\'$(X)\' >>$@+
28662869
ifdef FSMONITOR_DAEMON_BACKEND
28672870
@echo FSMONITOR_DAEMON_BACKEND=\''$(subst ','\'',$(subst ','\'',$(FSMONITOR_DAEMON_BACKEND)))'\' >>$@+

t/test-lib.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,10 @@ case $GIT_TEST_FSYNC in
535535
;;
536536
esac
537537

538-
# Add libc MALLOC and MALLOC_PERTURB test
539-
# only if we are not executing the test with valgrind
538+
# Add libc MALLOC and MALLOC_PERTURB test only if we are not executing
539+
# the test with valgrind and have not compiled with SANITIZE=address.
540540
if test -n "$valgrind" ||
541+
test -n "$SANITIZE_ADDRESS" ||
541542
test -n "$TEST_NO_MALLOC_CHECK"
542543
then
543544
setup_malloc_check () {

0 commit comments

Comments
 (0)