>From defe5bebcd1e2bb75f15eb54ae1135afaae3c477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 15 May 2021 17:50:33 +0100 Subject: [PATCH] realloc-gnu: avoid glibc MALLOC_CHECK_ issue * tests/test-realloc-gnu.c (main): if MALLOC_CHECK_ env var is set then don't check ENOMEM is returned from realloc(). See https://sourceware.org/bugzilla/show_bug.cgi?id=27870 Note it doesn't suffice to unsetenv() this var within the program, as the hooks have already been set up at that stage. --- ChangeLog | 9 +++++++++ tests/test-realloc-gnu.c | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b802233cf..30663cb38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2021-05-15 Pádraig Brady + + realloc-gnu: avoid glibc MALLOC_CHECK_ issue + * tests/test-realloc-gnu.c (main): if MALLOC_CHECK_ env var + is set then don't check ENOMEM is returned from realloc(). + See https://sourceware.org/bugzilla/show_bug.cgi?id=27870 + Note it doesn't suffice to unsetenv() this var within the program, + as the hooks have already been set up at that stage. + 2021-05-14 Paul Eggert c-stack: work around Solaris 11 bugs diff --git a/tests/test-realloc-gnu.c b/tests/test-realloc-gnu.c index 3a787ed91..5534f2ea1 100644 --- a/tests/test-realloc-gnu.c +++ b/tests/test-realloc-gnu.c @@ -38,7 +38,9 @@ main (int argc, char **argv) size_t one = argc != 12345; p = realloc (p, PTRDIFF_MAX + one); ASSERT (p == NULL); - ASSERT (errno == ENOMEM); + /* Avoid https://sourceware.org/bugzilla/show_bug.cgi?id=27870 */ + if (!getenv ("MALLOC_CHECK_")) + ASSERT (errno == ENOMEM); } free (p); -- 2.26.2