From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from buffalo.birch.relay.mailchannels.net (buffalo.birch.relay.mailchannels.net [23.83.209.24]) by sourceware.org (Postfix) with ESMTPS id CB3F13857C6F for ; Tue, 22 Jun 2021 12:46:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB3F13857C6F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id EC5EE34260B for ; Tue, 22 Jun 2021 12:46:27 +0000 (UTC) Received: from pdx1-sub0-mail-a45.g.dreamhost.com (100-96-18-93.trex.outbound.svc.cluster.local [100.96.18.93]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 6C745340D82 for ; Tue, 22 Jun 2021 12:46:27 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a45.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.18.93 (trex/6.3.3); Tue, 22 Jun 2021 12:46:27 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Average-Little: 1ffec47f1948da5d_1624365987678_1013816220 X-MC-Loop-Signature: 1624365987678:1067176476 X-MC-Ingress-Time: 1624365987677 Received: from pdx1-sub0-mail-a45.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a45.g.dreamhost.com (Postfix) with ESMTP id 2D3CF7F609 for ; Tue, 22 Jun 2021 05:46:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gotplt.org; h=subject:to :references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=gotplt.org; bh=GiHBVx 2GrNA0VDSOAs5b91c1lt8=; b=ACrdf/rvl5Vf/cWEVlUCs7wL4f9cPbZu2OA/YB IWhHXWJsFvSbOGhBclxrm9e9YUkonwqmYkc3HdtGQK/OiBrZoUdmGcuPoSAHFQSD 6zi8t1lbOOuPdrQw4xs5K42tlOeOBhyVrSPQw5dJlEv4rbe/QAqvGZI7PFYbNfhX tHn9A= Received: from [192.168.1.134] (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a45.g.dreamhost.com (Postfix) with ESMTPSA id 6EEA97E3CC for ; Tue, 22 Jun 2021 05:46:25 -0700 (PDT) Subject: Re: [Patch v2] malloc: Clean up __malloc_initialized To: libc-alpha@sourceware.org References: <875yybsedu.fsf@oldenburg.str.redhat.com> <20210618095351.1557461-1-siddhesh@sourceware.org> X-DH-BACKEND: pdx1-sub0-mail-a45 From: Siddhesh Poyarekar Message-ID: <4ba153a0-014b-9502-4778-4fd074ba78ad@gotplt.org> Date: Tue, 22 Jun 2021 18:16:20 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210618095351.1557461-1-siddhesh@sourceware.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3029.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 12:46:33 -0000 On 6/18/21 3:23 PM, Siddhesh Poyarekar via Libc-alpha wrote: > It can be assumed that ptmalloc_init is always called in a > single-threaded context because pthread_create calls malloc before > spawning a thread. As a result, a boolean value for > __malloc_initialized is sufficient to ensure that the function body is > executed only once. > > Further, __malloc_initialized is mentioned in Versions when it is > actually an internal symbol. Drop that reference and the macro > definition to __libc_malloc_initialized since it does not have an > external use. Ahh no, this breaks mcheck initialization, which depends on the intermediate value to ensure it is initialized only once. I'll figure out a way to work this into the hooks removal patchset since it simplifies the mcheck functionality a bit. Siddhesh