{"id":816180,"url":"http://patchwork.ozlabs.org/api/patches/816180/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/patch/20170920122718.0CE36404D127B@oldenburg.str.redhat.com/","project":{"id":41,"url":"http://patchwork.ozlabs.org/api/projects/41/?format=json","name":"GNU C Library","link_name":"glibc","list_id":"libc-alpha.sourceware.org","list_email":"libc-alpha@sourceware.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170920122718.0CE36404D127B@oldenburg.str.redhat.com>","list_archive_url":null,"date":"2017-09-20T12:27:18","name":"malloc: Perform full initialization before __malloc_check_init","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c8809c7d7af4365f2c4c52fc1c6da7ce1d8c150e","submitter":{"id":14312,"url":"http://patchwork.ozlabs.org/api/people/14312/?format=json","name":"Florian Weimer","email":"fweimer@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/glibc/patch/20170920122718.0CE36404D127B@oldenburg.str.redhat.com/mbox/","series":[{"id":4102,"url":"http://patchwork.ozlabs.org/api/series/4102/?format=json","web_url":"http://patchwork.ozlabs.org/project/glibc/list/?series=4102","date":"2017-09-20T12:27:18","name":"malloc: Perform full initialization before __malloc_check_init","version":1,"mbox":"http://patchwork.ozlabs.org/series/4102/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816180/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816180/checks/","tags":{},"related":[],"headers":{"Return-Path":"<libc-alpha-return-84777-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84777-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"GfwLIVVo\"; dkim-atps=neutral","sourceware.org; auth=none","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=fweimer@redhat.com"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxzXJ4Tk9z9t2Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 20 Sep 2017 22:27:28 +1000 (AEST)","(qmail 38130 invoked by alias); 20 Sep 2017 12:27:21 -0000","(qmail 38116 invoked by uid 89); 20 Sep 2017 12:27:21 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:to:subject:mime-version:content-type\n\t:content-transfer-encoding:message-id:from; q=dns; s=default; b=\n\tiNl3Bs/5yLyUa+ukosJRJf67iTfnVZXGgGAgF0g4Zg/fX2mQAZ5nRacExWfpSKVt\n\t2PpeeGH7Yk4NG3hZ1Jd46c/XMStq9X/fwwSPzOKqVDtT37qR9ZkFPTYkkeZCCYq6\n\twbEqJ3cYUwPYrmx3D9y1i8Vo1Hltw85F+jyllNzOXlY=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:to:subject:mime-version:content-type\n\t:content-transfer-encoding:message-id:from; s=default; bh=I3CiKi\n\t5iK3p3Q3WIxz5B9yFChfo=; b=GfwLIVVoWN52lzDwE+ZX6OMqnhQQbaT2y72wfX\n\tWcP4H+Vg511ArUzsVqBY5sAj20WKDz6WxFF4An4e0n8tJSoT78b1nqiCdKyFbtaR\n\tfgg9BXQPQfXM4rwOVdjDDKSJ52DmpeWp652uVrGSfhbAv6o03tnOl5UwH/UPxwNO\n\tohRSo=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0,\n\tGIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD,\n\tSPF_HELO_PASS autolearn=ham version=3.3.2\n\tspammy=Hx-languages-length:1547","X-HELO":"mx1.redhat.com","DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 236CEC047B82","Date":"Wed, 20 Sep 2017 14:27:18 +0200","To":"libc-alpha@sourceware.org","Subject":"[PATCH] malloc: Perform full initialization before\n\t__malloc_check_init","User-Agent":"Heirloom mailx 12.5 7/5/10","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Transfer-Encoding":"7bit","Message-Id":"<20170920122718.0CE36404D127B@oldenburg.str.redhat.com>","From":"fweimer@redhat.com (Florian Weimer)"},"content":"Previously, initialization was implicitly performed by mallopt,\nbut commit ac3ed168d0c0b2b702319ac0db72c9b475a8c72e (malloc:\nRemove check_action variable) removed the mallopt call.\n\n2017-09-20  Florian Weimer  <fweimer@redhat.com>\n\n\t* malloc/arena.c [!HAVE_TUNABLES] (ptmalloc_init): Call\n\tmalloc_consolidate before __malloc_check_init.","diff":"diff --git a/malloc/arena.c b/malloc/arena.c\nindex 9e5a62d260..eabff741ee 100644\n--- a/malloc/arena.c\n+++ b/malloc/arena.c\n@@ -322,14 +322,14 @@ ptmalloc_init (void)\n   TUNABLE_GET (mmap_max, int32_t, TUNABLE_CALLBACK (set_mmaps_max));\n   TUNABLE_GET (arena_max, size_t, TUNABLE_CALLBACK (set_arena_max));\n   TUNABLE_GET (arena_test, size_t, TUNABLE_CALLBACK (set_arena_test));\n-#if USE_TCACHE\n+# if USE_TCACHE\n   TUNABLE_GET (tcache_max, size_t, TUNABLE_CALLBACK (set_tcache_max));\n   TUNABLE_GET (tcache_count, size_t, TUNABLE_CALLBACK (set_tcache_count));\n   TUNABLE_GET (tcache_unsorted_limit, size_t,\n \t       TUNABLE_CALLBACK (set_tcache_unsorted_limit));\n-#endif\n+# endif\n   __libc_lock_unlock (main_arena.mutex);\n-#else\n+#else /* !HAVE_TUNABLES */\n   const char *s = NULL;\n   if (__glibc_likely (_environ != NULL))\n     {\n@@ -393,8 +393,12 @@ ptmalloc_init (void)\n         }\n     }\n   if (s && s[0] != '\\0' && s[0] != '0')\n-    __malloc_check_init ();\n-#endif\n+    {\n+      /* Perform full initialization.  */\n+      malloc_consolidate (&main_arena);\n+      __malloc_check_init ();\n+    }\n+#endif /* !HAVE_TUNABLES */\n \n #if HAVE_MALLOC_INIT_HOOK\n   void (*hook) (void) = atomic_forced_read (__malloc_initialize_hook);\n","prefixes":[]}