]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
malloc: Run tests without calling mallopt [BZ #19469]
authorFlorian Weimer <fweimer@redhat.com>
Tue, 2 Aug 2016 15:01:02 +0000 (17:01 +0200)
committerTulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Fri, 26 May 2017 17:57:22 +0000 (14:57 -0300)
The compiled tests no longer refer to the mallopt symbol
from their main functions.  (Some tests still call mallopt
explicitly, which is fine.)

(cherry picked from commit f690b56979dea81340a397c1b5e44827a6fb06e7)

ChangeLog
malloc/Makefile
test-skeleton.c

index f257b2be8219cc31712d441ce278fbe0b8a28c53..32faf08e7d7aeb8fc4b710226f136df06844a02a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-08-02  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #19469]
+       * malloc/Makefile (CPPFLAGS): Compile tests with
+       -DTEST_NO_MALLOPT.
+       * test-skeleton.c (main): Only call mallopt if !TEST_NO_MALLOPT.
+
 2017-01-05  Joseph Myers  <joseph@codesourcery.com>
 
        [BZ #21026]
index fa1730ecb75b9248efc45844ef27ed24c04318f3..4d5c81dce6332b35da45341d5160b2dc3f830d18 100644 (file)
@@ -166,3 +166,7 @@ $(objpfx)libmemusage.so: $(libdl)
 
 # Extra dependencies
 $(foreach o,$(all-object-suffixes),$(objpfx)malloc$(o)): arena.c hooks.c
+
+# Compile the tests with a flag which suppresses the mallopt call in
+# the test skeleton.
+$(tests:%=$(objpfx)%.o): CPPFLAGS += -DTEST_NO_MALLOPT
index d9bf989fa8381641912ba37401f09be2a51bbc57..5a90c65826011ceff652071f252a9750e5a2fbf8 100644 (file)
@@ -346,8 +346,10 @@ main (int argc, char *argv[])
   unsigned int timeoutfactor = 1;
   pid_t termpid;
 
+#ifndef TEST_NO_MALLOPT
   /* Make uses of freed and uninitialized memory known.  */
   mallopt (M_PERTURB, 42);
+#endif
 
 #ifdef STDOUT_UNBUFFERED
   setbuf (stdout, NULL);