{"thread":{"id":"49645","subject":"[PATCH] test: avoid failures when USE_NED_ALLOCATOR","startedAt":"2018-10-23T09:40:36Z","lastAt":"2018-10-24T03:10:38Z","messageCount":2,"participants":["Carlo Marcelo Arenas Belón","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"361266","messageId":"20181023093856.78944-1-carenas@gmail.com","threadId":"49645","inReplyTo":null,"subject":"[PATCH] test: avoid failures when USE_NED_ALLOCATOR","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2018-10-23T09:38:56Z","receivedAt":"2018-10-23T09:40:36Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"contrib/nedmalloc doesn't support MALLOC_CHECK_ or MALLOC_PERTURB_\nso add it to the same exception that is being used with valgrind\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n t/test-lib.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 44288cbb59..2ad9e6176c 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -143,7 +143,7 @@ fi\n # Add libc MALLOC and MALLOC_PERTURB test\n # only if we are not executing the test with valgrind\n if expr \" $GIT_TEST_OPTS \" : \".* --valgrind \" >/dev/null ||\n-   test -n \"$TEST_NO_MALLOC_CHECK\"\n+   test -n \"$TEST_NO_MALLOC_CHECK\" || test -n \"$USE_NED_ALLOCATOR\"\n then\n \tsetup_malloc_check () {\n \t\t: nothing\n-- \n2.19.1\n\n"},{"id":"361350","messageId":"xmqqlg6oqeq3.fsf@gitster-ct.c.googlers.com","threadId":"49645","inReplyTo":"20181023093856.78944-1-carenas@gmail.com","subject":"Re: [PATCH] test: avoid failures when USE_NED_ALLOCATOR","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-10-24T02:07:48Z","receivedAt":"2018-10-24T03:10:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:\n\n> contrib/nedmalloc doesn't support MALLOC_CHECK_ or MALLOC_PERTURB_\n> so add it to the same exception that is being used with valgrind\n>\n> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n> ---\n>  t/test-lib.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n\nUnlike the case for valgrind, where we actively do not want to set\nthese two environment variables [*1*], I am assuming that nedmalloc\nsimply ignores these two environment variables.  Is there a reason\nwhy we want to special case nedmalloc like this patch does, but\nleave these set for other implementations that do not pay attention\nto them?  \n\nOf course, I am also assuming that there are implementations of\nmalloc(3), which are not nedmalloc, that can be used to build and\ntest Git and that do not react to these two environment variables.\nThe patch would make sense if all the other implementations of\nmalloc(3) paid attention to MALLOC_{CHECK,PERTURB}_ and nedmalloc\nwere the only odd-man out, but I do not think that is the case.\n\n[Footnote] \n\n*1* see the last two paragraphs of the log message of a731fa91 (\"Add\nMALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for\ndetecting heap corruption\", 2012-09-14)\n\n\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 44288cbb59..2ad9e6176c 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -143,7 +143,7 @@ fi\n>  # Add libc MALLOC and MALLOC_PERTURB test\n>  # only if we are not executing the test with valgrind\n>  if expr \" $GIT_TEST_OPTS \" : \".* --valgrind \" >/dev/null ||\n> -   test -n \"$TEST_NO_MALLOC_CHECK\"\n> +   test -n \"$TEST_NO_MALLOC_CHECK\" || test -n \"$USE_NED_ALLOCATOR\"\n>  then\n>  \tsetup_malloc_check () {\n>  \t\t: nothing\n"}]}