Skip to contentSkip to conversation

test: avoid failures when USE_NED_ALLOCATOR

PATCH In review Carlo Marcelo Arenas Belón 2 participants 2 messages Oct 23, 2018 – Oct 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: avoid failures when USE_NED_ALLOCATOR

contrib/nedmalloc doesn't support MALLOC_CHECK_ or MALLOC_PERTURB_ so add it to the same exception that is being used with valgrind

---
 t/test-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/test-lib.sh +1 -1
index 44288cbb59..2ad9e6176c 100644
@@ -143,7 +143,7 @@ fi
 # Add libc MALLOC and MALLOC_PERTURB test
 # only if we are not executing the test with valgrind
 if expr " $GIT_TEST_OPTS " : ".* --valgrind " >/dev/null ||
-   test -n "$TEST_NO_MALLOC_CHECK"
+   test -n "$TEST_NO_MALLOC_CHECK" || test -n "$USE_NED_ALLOCATOR"
 then
 	setup_malloc_check () {
 		: nothing
Signature · 1 line
2.19.1
#1 lore raw
Quoted 7 lines · Carlo Marcelo Arenas Belón

contrib/nedmalloc doesn't support MALLOC_CHECK_ or MALLOC_PERTURB_ so add it to the same exception that is being used with valgrind

---
 t/test-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Unlike the case for valgrind, where we actively do not want to set these two environment variables [*1*], I am assuming that nedmalloc simply ignores these two environment variables. Is there a reason why we want to special case nedmalloc like this patch does, but leave these set for other implementations that do not pay attention to them?

Of course, I am also assuming that there are implementations of malloc(3), which are not nedmalloc, that can be used to build and test Git and that do not react to these two environment variables. The patch would make sense if all the other implementations of malloc(3) paid attention to MALLOC_{CHECK,PERTURB}_ and nedmalloc were the only odd-man out, but I do not think that is the case.

[Footnote]

*1* see the last two paragraphs of the log message of a731fa91 ("Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for detecting heap corruption", 2012-09-14)

Quoted 13 lines
t/test-lib.sh +1 -1
index 44288cbb59..2ad9e6176c 100644
@@ -143,7 +143,7 @@ fi
 # Add libc MALLOC and MALLOC_PERTURB test
 # only if we are not executing the test with valgrind
 if expr " $GIT_TEST_OPTS " : ".* --valgrind " >/dev/null ||
-   test -n "$TEST_NO_MALLOC_CHECK"
+   test -n "$TEST_NO_MALLOC_CHECK" || test -n "$USE_NED_ALLOCATOR"
 then
 	setup_malloc_check () {
 		: nothing