From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cyan.elm.relay.mailchannels.net (cyan.elm.relay.mailchannels.net [23.83.212.47]) by sourceware.org (Postfix) with ESMTPS id A5A563858C27 for ; Wed, 3 Nov 2021 03:25:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A5A563858C27 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 90FE46207FA; Wed, 3 Nov 2021 03:25:36 +0000 (UTC) Received: from pdx1-sub0-mail-a300.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 31C996207E2; Wed, 3 Nov 2021 03:25:35 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a300.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.97.65.133 (trex/6.4.3); Wed, 03 Nov 2021 03:25:36 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Tangy-Shelf: 5e23a9fc2a3070c6_1635909936152_1763229841 X-MC-Loop-Signature: 1635909936152:2718699616 X-MC-Ingress-Time: 1635909936152 Received: from [192.168.1.174] (unknown [1.186.122.141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a300.dreamhost.com (Postfix) with ESMTPSA id 4HkXGN6GjRz1RS; Tue, 2 Nov 2021 20:25:32 -0700 (PDT) Message-ID: <0deec191-a4c5-c025-2dca-653cb6432c2a@sourceware.org> Date: Wed, 3 Nov 2021 08:55:26 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: sbrk() failure while processing tunables Content-Language: en-US To: DJ Delorie Cc: adhemerval.zanella@linaro.org, libc-alpha@sourceware.org, carlos@redhat.com References: From: Siddhesh Poyarekar In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3488.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 03 Nov 2021 03:25:39 -0000 On 11/3/21 08:45, DJ Delorie wrote: > Siddhesh Poyarekar writes: >> That'll work only for the dynamic case, you'll need special code for >> static linking then. Alternatively, the rtld_malloc code looks >> sufficiently independent that it could be split out into its own file >> and included directly into dl-tunables.c. > > That implies that statically linked executables would have two > independent malloc implementations... Ahh no, not the full rtld_malloc implementation, I meant split out only the rtld_malloc function (with the couple of static vars it depends on) and call rtld_malloc() in dl-tunables instead of malloc(). The tunables allocation is likely the first one and it doesn't need to be freed for the lifetime of the process. Also, it cannot use the system malloc since it sets up variables that control system malloc. Siddhesh