From patchwork Tue Jun 28 13:35:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 641563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rf6Js3Z7Yz9sDk for ; Tue, 28 Jun 2016 23:36:13 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=y73Utngf; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=ItPq Ka0KGh43ApX1keJ2NvW2ejQ7hjpxq3U4rths+gh70uZr1RrtWUwsnh22DUxy3SCU y4cGtvUzWFVRY+VBIt3les4cum+3X49+R0Nh+GA3Dm4bUyX5qbxCzVpMPY5rDmve mzX4lpbOQd33wlcxxA3ISrjSiwPwi//U7GBSxT8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=iSQnboW+cL SfY4NEfgZOzKGykBE=; b=y73Utngf/skTwdVB/pt/BQUQ5EXum9D19INdIARzcv /u/TkzXEmycv5TopSwyBkzKx6VCMeplrYsR19+MCk8dvCfQoXrNf73ZABc7t90HF YbsjIGZc5K3t/EPdi7cYAqgBuIt9rxaPGrK4GcuG8t3b9FxHr425a4LGV7agBJAf g= Received: (qmail 305 invoked by alias); 28 Jun 2016 13:36:05 -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 131057 invoked by uid 89); 28 Jun 2016 13:36:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1616, o X-HELO: mx1.redhat.com Subject: [PATCH v2] malloc: Run tests without calling mallopt [BZ #19469] To: libc-alpha@sourceware.org References: <20160624173407.9A6194017A860@oldenburg.str.redhat.com> From: Florian Weimer Message-ID: <6be298b6-d4ed-03bb-0e6e-0382be31a530@redhat.com> Date: Tue, 28 Jun 2016 15:35:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160624173407.9A6194017A860@oldenburg.str.redhat.com> On 06/24/2016 07:34 PM, Florian Weimer wrote: > The compiled tests no longer refer to the mallopt symbol > from their main functions. (Some tests still call mallopt > explicitly, which is fine.) New version, avoiding quadratic behavior and delayed expansion. Also see: Thanks, Florian malloc: Run tests without calling mallopt [BZ #19469] 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-28 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..4d5c81d 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. +$(tests:%=$(objpfx)%.o): CPPFLAGS += -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);