From patchwork Fri Jun 24 17:34:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 13363 Received: (qmail 24159 invoked by alias); 24 Jun 2016 17:34:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 24146 invoked by uid 89); 24 Jun 2016 17:34:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:all-obj, Hx-languages-length:1227, sk:allobj, o, $ X-HELO: mx1.redhat.com Date: Fri, 24 Jun 2016 19:34:07 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] malloc: Run tests without calling mallopt [BZ #19469] User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20160624173407.9A6194017A860@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) The compiled tests no longer refer to the mallopt symbol from their main functions. (Some tests still call mallopt explicitly, which is fine.) 2016-06-24 Florian Weimer [BZ #19469] * malloc/Makefile (CPPFLAGS): Compile tests with -DTEST_NO_MALLOPT. * test-skeleton.c (main): Only call mallopt if !TEST_NO_MALLOPT. diff --git a/malloc/Makefile b/malloc/Makefile index fa1730e..0ca15d6 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -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. +CPPFLAGS += $(if $(filter $(*F),$(tests) $(test-srcs)),-DTEST_NO_MALLOPT) diff --git a/test-skeleton.c b/test-skeleton.c index d9bf989..5a90c65 100644 --- a/test-skeleton.c +++ b/test-skeleton.c @@ -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);